A modern, responsive full-stack web application designed to manage laboratory inventory, streamline stock tracking, and notify users of critical levels. Built with React, Flask, MongoDB, and Docker, LIMS provides secure authentication, real-time dashboards, and alert mechanisms for effective lab resource management.
Status: β Production Ready | License: MIT
# Clone and navigate
git clone <repo-url>
cd "Lab Inventory Management System"
# Start all services with Docker Compose
docker-compose up --build
# Access the application
Frontend: http://localhost:4000
Backend: http://localhost:5000/apiLIMS helps laboratories efficiently manage their inventory by:
- β Tracking components and stock levels
- β Managing inward and outward stock movements
- β Notifying users about low or critical inventory levels
- β Providing role-based access control
- β Enabling secure user authentication with bcrypt password hashing
- β Supporting real-time dashboard and inventory management
Ideal for educational institutions, research labs, and any organization needing robust inventory management.
| Layer | Technology |
|---|---|
| Frontend | React 19, Vite, TailwindCSS, Axios |
| Backend | Python 3.11, Flask, Gunicorn |
| Database | MongoDB 7.0 |
| Authentication | JWT, bcrypt (10-round hashing) |
| DevOps | Docker & Docker Compose |
| UI Framework | React Router, Lucide Icons |
- β Email/Password Registration: New users can create accounts with secure bcrypt hashing
- β JWT Sessions: 24-hour token-based authentication
- β Role-Based Access: Admin and Staff roles with different permissions
- β Session Persistence: Automatic login on page refresh
- β Feedback Messages: Clear success/error notifications
- β Password Security: Minimum 6 characters, bcrypt 10-round hashing
POST /api/auth/register Register new user
POST /api/auth/login Login with email/password
POST /api/auth/verify-token Verify JWT token
POST /api/auth/logout Logout and invalidate sessionLab Inventory Management System/
βββ client/ # React Frontend
β βββ src/
β β βββ components/ # React components
β β βββ pages/ # Login, Register, Dashboard
β β βββ context/ # AuthContext for state
β β βββ utils/ # Axios API client
β β βββ constants/ # Sample data
β βββ Dockerfile
β βββ vite.config.js
β
βββ backend/ # Python Flask Backend
β βββ app/
β β βββ routes/ # API endpoints
β β βββ models/ # MongoDB models
β β βββ services/ # Business logic
β β βββ utils/ # Helpers
β βββ Dockerfile
β βββ requirements.txt
β
βββ docker-compose.yml # Docker orchestration
βββ .env # Environment variables
βββ docs/ # Documentation
- Docker and Docker Compose installed
- Port 4000 (Frontend), 5000 (Backend), 27017 (MongoDB) available
- Git
- Clone the repository
git clone <repo-url>
cd "Lab Inventory Management System"- Create environment file
cp .env.example .env- Start all services
docker-compose up --build- Access the application
- Frontend: http://localhost:4000
- Backend API: http://localhost:5000/api
- MongoDB: mongodb://admin:password@localhost:27017/lims
-
Register a new account
- Visit http://localhost:4000/register
- Create account with email, password (min 6 chars), and name
- Success! β Redirected to dashboard
-
Login
- Visit http://localhost:4000/login
- Enter your credentials
- Success! β Redirected to dashboard
-
View Dashboard
- Your name and avatar display in the navbar
- Access inventory, notifications, and user management
- β Secure user registration with email/password
- β bcrypt password hashing (10 rounds)
- β JWT token-based sessions (24-hour expiration)
- β Role-based access control (Admin/Staff)
- β Session persistence across browser refreshes
- β Success/error feedback messages
- β Add, edit, delete laboratory components
- β Track component quantities and values
- β Inward/outward stock movements
- β Category-based filtering
- β Search functionality
- β Color-coded stock status indicators
- β Supplier tracking
- β Real-time inventory overview
- β Total components count and value
- β Category distribution charts
- β Low stock alerts
- β Critical stock warnings
- β Recent activity logs
- β Critical stock alerts
- β Low stock warnings
- β Outdated inventory notifications
- β Notification badge with count
- β Detailed notification view
- β View all users
- β Manage user roles (Admin/Staff)
- β Track user activity
- β Department management
- β Responsive design (mobile, tablet, desktop)
- β Dark/light gradient backgrounds
- β Success/error feedback messages
- β Loading states
- β User profile with auto-generated avatar
- β Clean, modern interface with Tailwind CSS
POST /api/auth/register Register new user
POST /api/auth/login Login with credentials
POST /api/auth/verify-token Verify JWT token
POST /api/auth/logout Logout
GET /api/components Get all components
POST /api/components Add new component (Admin)
PUT /api/components/{id} Update component (Admin)
DELETE /api/components/{id} Delete component (Admin)
POST /api/transactions Record stock movement
GET /api/transactions/{id} Get transaction details
GET /api/notifications Get all notifications
GET /api/notifications/recent Get recent notifications
POST /api/notifications/read Mark as read
GET /api/users Get all users
POST /api/users Create new user
PUT /api/users/{id} Update user
DELETE /api/users/{id} Delete user
# Start all services
docker-compose up --build
# Run in background
docker-compose up -d --build
# View logs
docker-compose logs -f
# View specific service
docker-compose logs -f backend
docker-compose logs -f frontend
# Stop services
docker-compose down
# Restart service
docker-compose restart backend
# Access MongoDB
docker-compose exec mongo mongosh -u admin -p password
# Check status
docker-compose psCreate a .env file in the project root:
# Frontend
VITE_API_URL=http://localhost:5000/api
# Backend
FLASK_ENV=production
DEBUG=False
SECRET_KEY=your-secret-key-here
JWT_SECRET=your-jwt-secret-here
JWT_EXPIRATION_HOURS=24
MONGODB_URI=mongodb://admin:password@mongo:27017/lims
# MongoDB
MONGO_INITDB_ROOT_USERNAME=admin
MONGO_INITDB_ROOT_PASSWORD=password# Via Frontend: http://localhost:4000/register
Email: test@example.com
Password: test123456
Name: Test User# Via Frontend: http://localhost:4000/login
Email: test@example.com
Password: test123456# Register
curl -X POST http://localhost:5000/api/auth/register \
-H "Content-Type: application/json" \
-d '{
"email": "user@example.com",
"password": "password123",
"name": "John Doe"
}'
# Login
curl -X POST http://localhost:5000/api/auth/login \
-H "Content-Type: application/json" \
-d '{
"email": "user@example.com",
"password": "password123"
}'For detailed documentation, see the docs folder:
- QUICK_REFERENCE.md - Quick setup and common commands
- COMPLETE_SETUP.md - Detailed setup instructions
- DOCKER_DEPLOYMENT.md - Docker deployment guide
- ARCHITECTURE_OVERVIEW.md - System architecture
- START_HERE.md - Getting started guide
- Docker 20.10+
- Docker Compose 1.29+
- 2GB RAM minimum
- 500MB disk space
- Internet connection for initial setup
# Windows - Find process using port
netstat -ano | findstr :4000
# Kill the process
taskkill /PID <PID> /F# Check MongoDB logs
docker-compose logs mongo
# Verify connection string
MONGODB_URI=mongodb://admin:password@mongo:27017/lims# Rebuild frontend
docker-compose up -d --build frontend
# Check logs
docker-compose logs -f frontend# Check backend logs
docker-compose logs -f backend
# Verify services
docker-compose psFor production deployment, consider:
- AWS ECS - Managed container service
- Azure Container Instances - Serverless containers
- Google Cloud Run - Pay-per-use serverless
- Kubernetes - Self-managed orchestration
- DigitalOcean App Platform - Simple Docker deployment
See DOCKER_DEPLOYMENT.md for more details.
- Fork the repository
- Create your feature 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
This project is licensed under the MIT License. See LICENSE file for details.
- π Check docs folder for documentation
- π Report issues via GitHub Issues
- π¬ Start a discussion for questions
- β Complete authentication system with bcrypt
- β Docker containerization
- β Real-time inventory management
- β Role-based access control
- β Responsive UI with Tailwind CSS
- β MongoDB integration
- β JWT-based sessions
Built with β€οΈ for laboratory inventory management