# Shop Management System - Backend
This is the backend of the Shop Management System, built with Django and Django REST Framework. It provides APIs for managing inventory, sales, customers, expenses, debts, suppliers, and user authentication.
## Features
- User authentication with JWT (JSON Web Tokens)
- Inventory management
- Sales tracking
- Customer management
- Expense tracking
- Debt and supplier management
- RESTful API endpoints
## Requirements
- Python 3.10+
- Django 5.1+
- Django REST Framework
- PostgreSQL (or SQLite for development)-
Clone the repository:
git clone github.com/DulshanRerg/Shop-Information-Management-System cd BackEnd -
Create and activate a virtual environment:
python -m venv venv source venv/bin/activate # On macOS/Linux .\venv\Scripts\activate # On Windows
-
Install dependencies:
pip install -r requirements.txt
-
Apply migrations:
python manage.py migrate
-
Run the development server:
python manage.py runserver
- Authentication
POST /api/accounts/register/- Register a new userPOST /api/accounts/login/- Login and obtain JWT tokensPOST /api/accounts/refresh/- Refresh access token
- User
GET /api/accounts/user/- Get current user details
- Other Endpoints
- Inventory, sales, customers, expenses, debts, and suppliers (see API documentation)
Create a .env file in the BackEnd directory with the following variables:
SECRET_KEY=your_secret_key
DEBUG=True
ALLOWED_HOSTS=localhost,127.0.0.1
DATABASE_URL=sqlite:///db.sqlite3Run tests using:
python manage.py testEnsure the frontend URL is added to CORS_ALLOWED_ORIGINS in settings.py:
CORS_ALLOWED_ORIGINS = [
"http://localhost:8080",
"http://localhost:8081",
]This project is licensed under the MIT License.
======================================================================================================================================================================
# Shop Management System - Frontend
This is the frontend of the Shop Management System, built with React, Vite, and TypeScript. It provides a user-friendly interface for managing inventory, sales, customers, expenses, debts, and suppliers.
## Features
- User authentication with JWT
- Responsive design with Tailwind CSS
- Integration with the backend API
- Dashboard for managing shop operations
## Requirements
- Node.js 18+
- npm or yarn-
Clone the repository:
git clone github.com/DulshanRerg/Shop-Information-Management-System cd FrontEnd -
Install dependencies:
npm install
-
Start the development server:
npm run dev
-
Open the app in your browser:
http://localhost:8080
Create a .env file in the FrontEnd directory with the following variables:
VITE_API_BASE_URL=http://127.0.0.1:8000/apisrc/api/- API service files (e.g.,authService.ts,customerService.ts)src/components/- Reusable UI componentssrc/pages/- Page components (e.g., Login, Register, Dashboard)src/hooks/- Custom React hookssrc/styles/- Global styles and Tailwind CSS configuration
npm run dev- Start the development servernpm run build- Build the app for productionnpm run lint- Run ESLint to check for code issues
The app uses JWT for authentication. Tokens are stored in localStorage and attached to API requests via the Authorization header.
Run tests using:
npm testThis project is licensed under the MIT License.