APIs designed for a point of sale (POS) system. The POS system has the capability to control the menu and perform CRUD operations also which can place an order successfully by validating the payment correctness and item availability
- Dev environment uses Docker and Docker compose.
tool | version |
---|---|
docker-compose | 1.29.x |
docker | 20.10.x |
git clone https://github.com/HimavarshaVS/POS.git
- Switch to project directory
cd POS
- Once you are in the root directory of the project run
docker-compose up --build -d
to build the image and start the app. - This will download and provision two containers: one running PostgreSQL and other running the Flask app. Initial run will take a while but the subsequent runs will be faster
- When docker-compose up completes, the app should be accessible at http://127.0.0.1:8085
- Database configurations are set in .env at the root of the repository.
- The directory /app contains the API application
- URL mapping is managed in /app/routers/init.py
- Functionality is organized in packages. Example: /app/routers/enpoints
- Tests are contained in each package. Example: app/test/test_menu.py
API Documentation can be accessible at http://127.0.0.1:8085/v1/api-doc
- Unit tests are included in the project under app/tests
- run
docker exec -it pythonapp pytest app/tests
to execute all tests of the app