
š Inventory Management System
š¦ A Full-Stack Inventory Management Solution with š User Authentication and Authorization. ⨠Built with Django | Django REST Framework for the backend and Vite | React | Tailwind CSS for the frontend. Fully ā” Optimized Code with š± Fully Responsive.

š Key Features
š Authentication & Security
- š¤ User Registration - Create new accounts with validation
- š JWT Authentication - Secure login/logout system
- š”ļø Role-Based Access - Protected routes & endpoints
- š CSRF Protection - Enhanced security against Cross-Site Request Forgery attacks
š¦ Product Management
- š CRUD Operations - Add/Edit/View/Delete products
- š·ļø Smart Categorization - Organize with nested categories
- š Real-Time Inventory - Track stock levels & alerts
š¼ Business Operations
- š„ Customer Management - Track purchases & history
- š Supplier Integration - Manage procurement workflow
- š° Sales & Purchases - Complete transaction tracking
š ļø Advanced Functionality
- š Powerful Search - Filter products by multiple criteria
- š Reporting Dashboard - Visualize sales & inventory data
- š± Mobile-Friendly - Works flawlessly on all devices
- š± Mobile-First Design - Optimized for all devices
- š SEO Optimized - Enhanced meta tags and semantic HTML
- š Performance Metrics - Optimized loading times and Core Web Vitals
- š Search Engine Friendly - Improved crawlability and indexing
š„ Tech Stack
šļø Backend
- š Python: Programming language.
- šÆ Django: Web framework.
- š Django REST Framework (DRF): For building RESTful APIs.
- š JWT Authentication: Secure user authentication.
šØ Frontend
- ā” Vite: Fast build tool for React.
- āļø React: JavaScript library for building user interfaces.
- šØ Tailwind CSS: Utility-first CSS framework for styling.
- š Axios: For making HTTP requests to the backend.
š Quick Start
š Prerequisites
- Python 3.10+
- Node.js 16+
- PostgreSQL 12+
Backend Setup
- Clone the repository:
git clone https://github.com/kevinThulnith/Inventory-Management-System.git
- Create a virtual environment:
python -m venv venv
source venv/bin/activate # On Windows: .\venv\Scripts\activate
- Install dependencies:
- install postgressSQL and c++ buid tool first.
pip install -r requirements.txt
- Run migrations:
python manage.py migrate
- Start the Django development server:
python manage.py runserver
ā”ļø Backend runs at http://localhost:8000
Frontend Setup
- Navigate to the frontend directory:
cd ../frontend
- Install dependencies:
npm i
- Start the Vite development server:
npm run dev
ā”ļø Frontend runs at http://localhost:3000
š To Host on Local Network
- Get device Ip address
ipconfig getifaddr en0 // in windows ipconfig
- Start bachend
py .\manage.py runserver <Device Ip address>:8000
Start frontend
npx vite --host {Device Ip Address}
Configuration: āļø
- Database: Configure your database settings in
backend/inventory/settings.py
. You can use SQLite (default, good for development) or PostgreSQL, MySQL, etc. for production.
- Environment Variables: Consider using environment variables (e.g., using
python-dotenv
) for sensitive information like secret keys and database credentials. Don't commit these to your repository! š¤«
- API Base URL: Update the API base URL in your frontend React components to point to your Django backend (usually
http://localhost:8000
).
š Project Structure
š¦ inventory-management-system
āāā š backend # Django REST API
ā āāā š core # Main app (settings, models, views)
ā āāā š products # Product & Category logic
ā āāā š customers # Customer management
ā āāā š suppliers # Supplier management
ā āāā š sales # Sales tracking
ā āāā š purchases # Purchase tracking
ā
āāā š frontend # React Frontend
ā āāā š src
ā ā āāā š components # Reusable UI components
ā ā āāā š pages # Page components
ā ā āāā š hooks # Custom React hooks
ā ā āāā š api # API service functions
ā āāā vite.config.js # Vite configuration
ā
āāā š README.md # You're here!
š Authentication Flow
- Register
api/user/register/
: Users can create an account by providing their details.
- Login
api/token/
: Users log in with their credentials and receive an authentication token.
- Protected Routes: Only authenticated users can access product management features.
- Logout
api/token/blacklist/
: Users can log out, and their token is invalidated.
š API Endpoints:
The backend provides a RESTful API using Django REST Framework. You can access the API documentation at http://localhost:8000/api/
(or the correct port for your development server) after running the Django server. Example endpoints:
/api/categories/
(GET, POST, PUT, DELETE)
/api/customers/
(GET, POST, PUT, DELETE)
/api/suppliers/
(GET, POST, PUT, DELETE)
/api/products/
(GET, POST, PUT, DELETE)
/api/sales/
(GET, POST, PUT, DELETE)
/api/purchases/
(GET, POST, PUT, DELETE)
/api/token/
(POST) - Obtain JWT token
/api/token/refresh/
(POST) - Refresh JWT token
X-CSRFToken: <csrf-token>
Authorization: Bearer <jwt-token>
š Configuration Steps
CSRF Setup
- Include CSRF token in HTML template:
<meta name="csrf-token" content="{{ csrf_token }}" />
- Add to API requests:
axios.defaults.headers.common["X-CSRFToken"] = getCookie("csrftoken");
SEO Configuration
- Update meta tags in
index.html
:
<meta name="description" content="Your description" />
<meta name="keywords" content="inventory, management, system" />
- Configure social media tags:
<meta property="og:title" content="Your Title" />
<meta property="og:description" content="Your Description" />
š”ļø Security Features
CSRF Protection
- Django's built-in CSRF middleware for form protection
- Custom CSRF token handling for API requests
- Secure cookie handling and validation
- Protection against cross-site request forgery attacks
SEO Implementation
- Custom meta tags for better search engine visibility
- OpenGraph and Twitter Card meta tags for social sharing
- Semantic HTML structure for better accessibility
- Optimized page titles and descriptions
- Mobile-friendly responsive design
š” Why Choose This Project?
- š Modern Stack - Cutting-edge technologies
- š Scalable Architecture - Ready for growth
- šØ Beautiful UI - Tailwind-powered design
- š Real-Time Updates - Instant data reflection
- š± Mobile-Ready - Perfect for all devices
š¤ Contributing
We ā¤ļø contributions! Here's how:
- š“ Fork the repository
- šæ Create a branch (git checkout -b feature/amazing-feature)
- š¾ Commit changes (git commit -m 'Add amazing feature')
- š¤ Push to branch (git push origin feature/amazing-feature)
- š Open a Pull Request
Show Your Support: ā¤ļø
If you find Inventory Management System
helpful, please consider:
- Starring the repository on GitHub! ā
- Sharing it with your network.
- Contributing to the project.
Happy Coding! ššØāš»š©āš»