Skip to content

MariOlya/2074903-task-force-4

 
 

Repository files navigation

taskforce

TaskForce

study project by Olga Marinina


About project

"TaskForce" is an online platform for finding executors for one-time tasks. The site functions as an ad exchange where individual customers publish tasks. Executors can respond to these tasks by offering their services and the cost of the work.

Main use cases

  • Publishing a task
  • Adding a response to a task
  • Search for tasks by category and name
  • Selecting an executor and assigning him to a task
  • Editing a profile

DIRECTORY STRUCTURE

  assets/             contains assets definition
  commands/           contains console commands (controllers)
  config/             contains application configurations
  controllers/        contains Web controller classes
  docker/             contains data from DB volumes
  fixtures/           contains fake data for DB
  mail/               contains view files for e-mails
  migrations/         contains migrations to create current tables for DB
  runtime/            contains files generated during runtime
  src/                contains classes (domain, infrustacture, application)
    application/      contains classes for services
    domain/           contains models of main entities and helpers (traits, task actions)
    infrastructure/   contains helped models (forms) and constants
  tests/              contains various tests for the basic application (just unit)
  vendor/             contains dependent 3rd-party packages
  views/              contains view files for the Web application
  web/                contains the entry script and Web resources
  widgets/            contains some widgets

REQUIREMENTS

We work on this project with docker-compose.

Images:

  • yiisoftware/yii2-php:8.1-apache
  • mysql:latest
  • redis:5

You can then access the application through the following URL:

http://127.0.0.1:8000

CONFIGURATION

Database

File config/db.php with real data. For example:

return [
    'class' => 'yii\db\Connection',
    'dsn' => 'mysql:host=localhost;dbname=yii2basic',
    'username' => 'root',
    'password' => '1234',
    'charset' => 'utf8',
];

Migrations

Migrations can be started via the command

docker-compose run php ./yii migrate

Migrations can be denied via the command

docker-compose run --rm php ./yii migrate/down

Fake data aka fixtures

We have already generated data and add they app/fistures/data. You should run they sequentially via the command (for example, for ExampleFixture)

docker-compose run --rm php yii fixture/load Example

The sequence:

  • Users
  • ExecutorCategories
  • Tasks
  • Responds
  • Reviews

If you want to generate your personal data then use our templates in app/fixtures/templates but you should keep these rules:

  1. absolutely follow the sequence above
  2. generate data one at a time
  3. run the same fixture
  4. take new table and generate data for this

The command to generate data

docker-compose run --rm php yii fixture/generate example --count=n

TESTING

Tests are located in tests directory. We use only unit tests on this project.

Unit tests can be executed by running

vendor/bin/codecept run unit

The command above will execute unit. Unit tests are testing the system components.

Code coverage support

By default, code coverage is disabled in codeception.yml configuration file, you should uncomment needed rows to be able to collect code coverage. You can run your tests and collect coverage with the following command:

#collect coverage only for unit tests
vendor/bin/codecept run unit --coverage --coverage-html --coverage-xml

You can see code coverage output under the tests/_output directory.

About

Ольга Маринина

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 85.5%
  • HTML 12.6%
  • Shell 0.6%
  • JavaScript 0.6%
  • CSS 0.3%
  • Awk 0.2%
  • Batchfile 0.2%