- Student: Olga Marinina.
- Mentor: Mikhail Selyatin.
"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.
- 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
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
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
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 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
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:
- absolutely follow the sequence above
- generate data one at a time
- run the same fixture
- take new table and generate data for this
The command to generate data
docker-compose run --rm php yii fixture/generate example --count=n
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.
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.