Skip to content

JaShCa (Just another Shopping Cart) is a RESTful API for managing Shopping Carts. – ⚠️ PoC Only Not Ready for Production

License

Notifications You must be signed in to change notification settings

macghriogair/jashca-rest-api

Repository files navigation

JaShCa RESTful API

JaShCa (Just another Shopping Cart) is a RESTful API for managing Shopping Carts.

TechStack

  • Docker Compose
  • PHP 8.2+
  • Symfony 6.3
  • PostgreSQL
  • Redis

Development Setup

Requirements

  • Docker Version ^24.0 (e.g. via Docker Desktop 4.24)
  • Docker Compose Version v2.22.0-desktop.2
  • make (installable on macOS via brew install make)

Note: tested only on OS/Arch: darwin/arm64)

Installation

via Makefile:

make dev-init

The application, by default, should be running at: http://localhost:4444

Open Api Docs

Check out the docs: http://localhost:4444/api/doc

Start Queue Workers manually

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.

Execute Symfony Console Commands

Shell inside PHP-Container

make shell
bin/console about

Tests

Execute all the tests:

make docker.up
make test

Authentication

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.

Test Data

Reset the test data by executing the Alice fixtures:

make fixtures

Postman Collection

All available endpoints can be tested via Postman.

Import the collection from ./docs/Jashca API.postman_collection.json and run all tests:

Postman Tests

About

JaShCa (Just another Shopping Cart) is a RESTful API for managing Shopping Carts. – ⚠️ PoC Only Not Ready for Production

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published