This project made with Django REST Framework on backend and will be added with React on frontend (future addition).
User can register, create your account and choose user_type - Customer, Courier, Cook or Manager. For booking purpose user can add your card with validate card number.
Manager can add new menu items, update and delete ones.
Future plans:
I want to implement orders logic, user can order some food and couriers can deliver it to users.
The main goal is to learn how to build RESTful API with DRF. Test all urls with services Postman and Insomnia, and also with TestCase.
Project is created with:
- Django: 4.2.4
- Django Rest Framework: 3.14.0
- Faker
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
Clone project to your local machine
git clone https://github.com/AlexMiller93/Food_delivery_project.git
cd Food_delivery_project
For Windows
Creating virtual env
python3 -m venv venv
Activating virtual env
.venv\Scripts\activate
For Linux/Mac
Creating virtual env
python3 -m venv venv
Activating virtual env
source venv/bin/activate
Install all needed packages
pip install -r requirements.txt
To synchronize the database sqlite3
python manage.py migrate
To run server
python manage.py runserver
To test accounts app
python manage.py test accounts
Authentication staff
Create superuser
python manage.py createsuperuser
To register new user run
http://localhost:8000/users/register
To login user run
http://localhost:8000/users/login
Admin urls
Login as superuser and watch all users:
http://localhost:8000/users/admin
To watch all accounts run:
http://localhost:8000/users/admin/accounts/
To watch one account run using pk
http://localhost:8000/users/admin/accounts/<int:pk>
To watch all user's cards
http://localhost:8000/users/admin/cards/
Menu urls
To read all menu items and add new one run:
http://localhost:8000/menu
To read menu item via pk run:
http://localhost:8000/menu/<int:pk>
Accounts urls
To add new account run:
http://localhost:8000/users/accounts/add
To watch user account run:
http://localhost:8000/users/accounts/<int:pk>
Cards urls
To add new card run:
http://localhost:8000/users/cards
To read, update and delete user card run:
http://localhost:8000/users/cards/<int:pk>