Build a backend for an on-counter billing system for a small-scale shopping mall.
The application is able to do the following:
- Authenticate employees using JWT authentication
- Add, Update, and Delete products to/from the system
- Add, update, and delete customers
- Bill customer
Before you begin, ensure you have met the following requirements:
- Python installed on your local machine. You can download it from here.
- Pip package manager installed. If you installed Python using Anaconda, you already have pip installed.
- Virtualenv installed. You can install it via pip by running
pip install virtualenv
.
This project mainly has 4 tables - Products, Employees, Customers, Orders for tracking all the things required by a small scale shopping mall. The API endpoints are:
- baseurl/api/v1/products
- baseurl/api/v1/product/id
- baseurl/api/v1/employees
- baseurl/api/v1/employee/id
- baseurl/api/v1/customers
- baseurl/api/v1/customer/id
- baseurl/api/v1/orders
- baseurl/api/v1/order/id
- baseurl/api/v1/place-order
- baseurl/api/v1/analytics
For accessing the above APIs, you first need to get and access token for it and pass it in the request authorization section as the bearer token. Without it you will be unauthorized to access it. To get the access token and refresh token visit:-
- baseurl/api/v1/register/ If you are a new user, and if you already an user with you account created then visit:-
- baseurl/api/token/ to get the access token and refresh token.
{
"customer_id": {id} ,
"employee_id": {id},
"products":[
{"product_id": {id}, "quantity": {qty} },
{"product_id": {id}, "quantity": {qty}}
]
}
- Clone the project
git clone https://github.com/AbhishekSingh-22/space-Y-Assignment.git
- Go to the project directory
cd space-Y-Assignment
- Create virtual environment
virtualenv venv
- Activate virtual environment:
- On Windows
venv\Scripts\activate
- On macOS and Linux
source venv/bin/activate
- Install the project dependencies
pip install -r requirements.txt
- Navigate to directory which contains manage.py file
cd billingSystem
- Run database migrations
python manage.py migrate
- Start the development server
python manage.py runserver
- Open your web browser and navigate to http://localhost:8000/swagger/ to view the project