Skip to content

It is a repository for an internship assignment for Space Y Capital

Notifications You must be signed in to change notification settings

AbhishekSingh-22/space-Y-Assignment

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Space-Y-Assignment

Statement

Build a backend for an on-counter billing system for a small-scale shopping mall.

Features

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

Prerequisites

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.

API Reference

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:

  1. baseurl/api/v1/products
  2. baseurl/api/v1/product/id
  3. baseurl/api/v1/employees
  4. baseurl/api/v1/employee/id
  5. baseurl/api/v1/customers
  6. baseurl/api/v1/customer/id
  7. baseurl/api/v1/orders
  8. baseurl/api/v1/order/id
  9. baseurl/api/v1/place-order
  10. baseurl/api/v1/analytics

NOTE:

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.

Request structure for placing order api:-

{
"customer_id": {id} ,
"employee_id": {id},
"products":[
{"product_id": {id}, "quantity": {qty} },
{"product_id": {id}, "quantity": {qty}}
]
}

Run Locally

  1. Clone the project
  git clone https://github.com/AbhishekSingh-22/space-Y-Assignment.git
  1. Go to the project directory
  cd space-Y-Assignment
  1. Create virtual environment
  virtualenv venv
  1. Activate virtual environment:
  • On Windows
venv\Scripts\activate
  • On macOS and Linux
source venv/bin/activate
  1. Install the project dependencies
  pip install -r requirements.txt
  1. Navigate to directory which contains manage.py file
  cd billingSystem
  1. Run database migrations
  python manage.py migrate
  1. Start the development server
  python manage.py runserver
  1. Open your web browser and navigate to http://localhost:8000/swagger/ to view the project

About

It is a repository for an internship assignment for Space Y Capital

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages