- Only Back End (no needs to add UI);
- REST architecture;
- Tech stack: Django + DRF, JWT, PostgreSQL, Docker(docker-compose), PyTests;
- Added at least a few different tests;
- README.md with a description of how to run the system;
- Will be a + to add flake8 or smth similar
A company needs internal service for its employees which helps them to make a decision at the lunch place. Each restaurant will be uploading menus using the system every day over API. Employees will vote for the menu before leaving for lunch on a mobile app for whom the backend has to be implemented. There are users who did not update the app to the latest version and the backend has to support both versions. The mobile app always sends the build version in headers
- Authentication
- Creating restaurant
- Uploading menu for restaurant (There should be a menu for each day)
- Creating employee
- Getting current day menu
- Getting results for the current day
- Clone code
- Go to application root folder: "RestaurantProject_TestApp/restaurants_project"
- Create .env file with your Django secret key(SECRET_KEY=<your secret key>)
- Run "sudo docker-compose up"
How to create an initial admin:
- Run "sudo docker ps" and check name of the container with image "restaurants_project_dm_web"
- Run "sudo docker exec -it <name from first paragraph> python ./manage.py createsuperuser"
- Enter your admin data
After registering an account in the system, every person needs to get his access token:
- Go to "/api/token/" and enter your data
- Get your token
(All following methods work only with the "Bearer <your access token>", which must be in the header " Authorization")
- Check their profile: "/api/profile/"
- Check all restaurants and their menus for all days: "/api/restaurants/"
- Check all today's menus: "/api/menus/"
- Vote: "api/vote/"
- Check results of the today's vote: "/api/result/"
(All following methods work only with the "Bearer <your access token>", which must be in the header " Authorization")
- All the features of a regular user
- Register anybody(other admins or regular users): "/api/registration/"
- Create restaurant: "/api/restaurant/add/"
- Update restaurant: "/api/restaurant/<uuid:id>/update/"
- Add menu for any restaurant: "/api/adding_menu/"
- Create local virtual environment and activate it
- Go to application root folder: "RestaurantProject_TestApp/restaurants_project"
- Create .env file with your Django secret key(SECRET_KEY=<your secret key>)
- Run "pip install -r requirements.txt"
- Go to the folder with tests "tests/restaurant_project"
- Run them using command "pytest" or directly from "test_user.py"