Dima Pristupa: test assignment for an adtech company
- Role: Rust Back-End Engineer
- Task: TaskWebServer.pdf
# Run the application
cp .env.example .env
docker compose -f ./docker/db.yml --env-file ./docker/.env.db up
cargo run --release # or `just start-prod`
# Call the run endpoint
curl localhost:8080/api/v1/run -v # or `just call-run`
# Get all request group entities
curl -u "api_user:not_qwerty_password" localhost:8080/api/v1/request_group/ -v
# Get all request entities
curl -u "api_user:not_qwerty_password" localhost:8080/api/v1/request/ -v
Tip: you can use the admin panel to view tables via http://localhost:9000
# Run all tests (unit & integration)
cargo test --features integration_tests # or `just test`
Additional dependencies:
- mold
- cargo-watch
- just is used to run commands:
$ just
馃敡 Available commands:
路 start-prod # Start the application (release build)
路 start # Start the application (debug build)
路 start-watch # Start the application (and watch for changes)
路 migrator_cli *ARGS # Run migrator_cli (check `just migrator_cli --help`)
路 test # Run all tests (unit & integration)
路 test-watch # Run all tests (and watch for changes)
路 format # Format code
路 lint # Run a linter
路 call-run # Call /run endpoint
# Example
$ just start-watch
- Pagination for get all API requests
- Test coverage via cargo-tarpaulin