This project is an internal service for employees to help them make a decision on where to have lunch. It provides functionality for restaurants to upload menus, employees to vote for menus, and retrieving the current day's menu and voting results.
To run the system, follow the steps below:
- Docker and Docker Compose installed on your machine.
- Clone the repository:
git clone <repository-url>-
Copy the
.env.samplefile and create a new file named.env. Populate the.envfile with all the required data (API keys, database credentials, etc.). -
Build and run the application using Docker Compose:
docker-compose up --build- Create a superuser for accessing the Django admin site:
docker-compose exec web python manage.py createsuperuser- Access the API in your web browser at
http://localhost:8000/.
POST /api/user/register/: Register a new user.GET /api/user/me/: Get the authenticated user's details.POST /api/user/token/: Obtain an access and refresh token.POST /api/user/token/refresh/: Refresh an access token.POST /api/user/token/verify/: Verify an access token.
POST /api/restaurant/create/: Create a new restaurant.POST /api/restaurant/menu/create/: Create a menu for a restaurant.GET /api/restaurant/menu/list/: Get the list of menus for the current day.POST /api/restaurant/{restaurant_id}/vote/: Vote for a menu of a specific restaurant.GET /api/restaurant/menu/winner/: Get the highest voted menu of the day (admin-only).
GET /api/restaurant/menu/list/: Get the current day's menu.
GET /api/doc/: API documentation in JSON format.GET /api/doc/swagger/: Swagger UI for interactive API documentation.
To run the tests, execute the following command:
docker-compose exec web pytestThis project adheres to the PEP 8 style guide. To check the code quality, you can run flake8 using the command:
docker-compose exec web flake8