π¦ 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.
- π€ 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
- π CRUD Operations - Add/Edit/View/Delete products
- π·οΈ Smart Categorization - Organize with nested categories
- π Real-Time Inventory - Track stock levels & alerts
- π₯ Customer Management - Track purchases & history
- π Supplier Integration - Manage procurement workflow
- π° Sales & Purchases - Complete transaction tracking
- π 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
- π Python: Programming language.
- π― Django: Web framework.
- π Django REST Framework (DRF): For building RESTful APIs.
- π JWT Authentication: Secure user authentication.
- β‘ 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.
- Python 3.10+
- Node.js 16+
- PostgreSQL 12+
- 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
- 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
- Get device Ip address
ipconfig getifaddr en0 // in windows ipconfig
- Start bachend
py .\manage.py runserver <Device Ip address>:8000
-
Start frontend
- change .env file fist
npx vite --host {Device Ip Address}
- 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
).
π¦ 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!
- 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.
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>
- 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");
- 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" />
- 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
- 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
- π 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
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
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! ππ¨βπ»π©βπ»