JaShCa (Just another Shopping Cart) is a RESTful API for managing Shopping Carts.
- Docker Compose
- PHP 8.2+
- Symfony 6.3
- PostgreSQL
- Redis
- Docker Version ^24.0 (e.g. via Docker Desktop 4.24)
- Docker Compose Version v2.22.0-desktop.2
make
(installable on macOS viabrew install make
)
Note: tested only on OS/Arch: darwin/arm64)
via Makefile:
make dev-init
The application, by default, should be running at: http://localhost:4444
Check out the docs: http://localhost:4444/api/doc
A Symfony Messenger Consumer is running in a dedicated worker container. If for some reason it fails to start, you can start it manually via:
make worker.start
Note: For demo purposes, Postges/Doctrine is used as a transport. In a real world scenario, you might want to use sth. like RabbitMQ or Beanstalkd.
Shell inside PHP-Container
make shell
bin/console about
Execute all the tests:
make docker.up
make test
Authentication is provided through the LexikJWTAuthenticationBundle.
A JWT can be obtained via
curl -X POST -H "Content-Type: application/json" \
http://localhost:4444/api/login \
-d '{"username":"[email protected]","password":"pwned1234"}'
See ./fixtures/users.yaml
for available test Users.
Reset the test data by executing the Alice fixtures:
make fixtures
All available endpoints can be tested via Postman.
Import the collection from ./docs/Jashca API.postman_collection.json
and run all tests: