A production-ready, full-stack inventory and order management system built with Next.js 14, PostgreSQL, and Flutter.
Universal platform for inventory and order management that can be customized for 15+ different industries (Retail, Pharmacy, Restaurant, Warehouse, etc.).
6 Modules Live | 40 Tests Passing | Ready for Production
-
Authentication & Authorization - User registration, login with NextAuth, session management, role-based access control (Admin, Staff, Customer)
-
User Management - Admin can create, view, update, and deactivate users. Manage roles and permissions across the system.
-
Role-Based Dashboards - Separate dashboards for Admin (full system control), Staff (order fulfillment), and Customer (shopping and order tracking)
-
Products & Inventory Management - Product catalog with categories, product details page, inventory tracking, stock management, SKU system
-
Order Management & Shopping Cart - Shopping cart with quantity controls, order placement with payment method selection, order status workflow (Pending, Confirmed, Processing, Shipped, Delivered, Cancelled), customer order history, admin/staff order management interface
-
Sales Analytics & Reporting - Interactive sales charts with daily, monthly, and yearly views using Recharts, revenue analytics dashboard showing total sales and average order value, real-time performance metrics for today and current month, sales data based on delivered orders only
Recommended: Use Docker for easiest setup (just 5 minutes!)
👉 Setup with Docker - No PostgreSQL installation needed, just Docker Desktop + 4 commands
Alternative: Setup without Docker - Manual PostgreSQL installation
Both setups use same credentials:
- PostgreSQL:
postgres/postgres - App runs on:
http://localhost:3001
Already set up?
docker-compose up -d # Start database (Docker only)
npm run dev # Start appVisit http://localhost:3001
Web: Next.js 14, TypeScript, PostgreSQL, Prisma, NextAuth, Tailwind CSS Mobile: Flutter (Coming Soon) Testing: Vitest (40 tests, 100% passing)
Setup Guides:
- Setup with Docker (Recommended)
- Setup without Docker (Manual)
Development:
npm test # Run all tests
npm run test:watch # Watch mode
npm run test:ui # Interactive UICoverage: 40/40 tests passing (100%)
- Authentication: 24 tests
- Products & Categories: 8 tests
- Product Details: 8 tests
Deploy for FREE to production:
- Vercel - Web app + PostgreSQL database (Recommended)
- Railway - Full-stack hosting (App + Database)
- Render + Supabase - Free tier (with cold starts)
See Production Deployment Guide for complete step-by-step instructions.
MIT
What it does: User registration, login, and session management
User Registration
- Public signup page at
/register - Required fields: Email, Password, Name
- Email validation (valid format check)
- Password validation:
- Minimum 8 characters
- At least 1 uppercase letter
- At least 1 number
- At least 1 special character (@$!%*?&)
- Duplicate email check
- Auto-assign CUSTOMER role by default
- Admin accounts cannot be created via public signup
User Login
- Login page at
/login - Authenticate with email and password
- NextAuth.js for secure authentication
- Session management with JWT tokens
- Auto-redirect based on role:
- ADMIN →
/admin/dashboard - STAFF →
/staff/dashboard - CUSTOMER →
/customer/dashboard
- ADMIN →
Session Management
- Maintain login session
- Check authentication on protected routes
- Auto-logout on session expiry
- Role stored in session for access control
User Roles
ADMIN
- Full system access
- Route prefix:
/admin/... - Home:
/admin/dashboard - Can access all features
STAFF
- Limited to operations
- Route prefix:
/staff/... - Home:
/staff/dashboard - Cannot access admin settings
CUSTOMER
- Shopping and orders only
- Route prefix:
/customer/... - Home:
/customer/dashboard - Cannot access admin or staff areas
Route Protection
- Middleware checks user role before page access
- Unauthorized access shows 403 Forbidden page
- Public routes:
/,/login,/register
What it does: Admin can view, search, and manage all user accounts
Access: /admin/users (Admin only)
Features:
- View all users in table (Name, Email, Role, Status, Registration Date/Time)
- Search by name or email
- Filter by role (ALL, ADMIN, STAFF, CUSTOMER)
- Filter by status (Active, Inactive)
- Change user roles via dropdown
- Activate/Deactivate accounts
- Delete users (with confirmation)
- Admin cannot delete themselves
- Only accessible by ADMIN role
What it does: Provide role-specific home pages after login
Admin Dashboard (/admin/dashboard)
- Metrics: Total Revenue, Orders, Users, Products
- Quick Actions: Manage Users, Add Product, View Orders, Settings
- Access to all admin features
Staff Dashboard (/staff/dashboard)
- Metrics: Today's Sales, Pending Orders, Assigned Orders, Low Stock Alerts
- Quick Actions: Add Product, Process Order, Update Inventory
- Limited to operational features
Customer Dashboard (/customer/dashboard)
- Metrics: Active Orders, Order History, Wishlist Items
- Quick Actions: Browse Products, Track Order, My Profile
- Shopping and order features only
Auto-Redirect (/dashboard)
- Redirects to role-specific dashboard based on user role
- ADMIN →
/admin/dashboard - STAFF →
/staff/dashboard - CUSTOMER →
/customer/dashboard
What it does: Manage products, stock levels, and categories
Requirements:
- Real-time stock level tracking
- Low stock alerts (configurable threshold)
- Product categorization
- Product images (multiple per product)
- Bulk operations (CSV import/export)
- Search functionality (name, category, SKU)
- Product variants (size, color, etc.)
- Pricing tiers
- Archive/delete products
- Complete change history (audit trail)
What it does: Handle order creation, processing, and tracking throughout the complete order lifecycle
Completed Features:
- Shopping cart system with add to cart, quantity adjustment, and cart persistence using localStorage
- Order placement with payment method selection (Cash on Delivery, Card, UPI, Net Banking)
- Complete order workflow with seven status stages: Pending, Confirmed, Processing, Packed, Shipped, Delivered, Cancelled
- Customer order history showing all placed orders with status tracking
- Admin and Staff order management dashboard with ability to update order status
- Role-based order actions where Staff can process daily orders and Admin has full control
- Order details including customer information, order items, quantities, and total amount
- Automatic inventory stock reduction when orders are placed
- Unique order number generation for tracking
Future Enhancements:
- Staff assignment to specific orders
- Advanced order history filters by date range and status
- Cancel and refund capability for admins
- Print invoice and receipt functionality
- Email or SMS notifications on status changes
What it does: Provide insights and reports on sales, users, and products
Completed Features:
- Sales charts with daily, monthly, and yearly views using Recharts library
- Line charts for revenue trends and bar charts for order counts
- Revenue analytics dashboard with real-time sales data from delivered orders
- Summary statistics including total sales, total orders, and average order value
- Performance metrics for today and current month
- Interactive chart view modes allowing users to switch between time periods
- Admin-only access with role-based authentication
Future Enhancements:
- Top selling products report
- User growth graphs
- Low stock alerts
- Export reports to PDF and Excel formats
- Audit logs for all system actions
Users
- Email, password, name, role
- Contact information
- Address (for customers)
- Created date, last login
Products
- Name, description, price
- SKU/barcode
- Category
- Stock quantity
- Images (multiple)
- Status (active/inactive)
- Created/updated dates
Categories
- Name, description
- Parent category (for subcategories)
Orders
- Order number (auto-generated)
- Customer details
- Items with quantities
- Total amount
- Status
- Assigned staff
- Timestamps for each status change
Audit Logs
- Who did what, when
- IP address
- Action type
Authentication
POST /api/auth/register- User registrationPOST /api/auth/callback/credentials- User loginGET /api/auth/session- Get session
Admin - User Management
GET /api/admin/users- Get all usersPATCH /api/admin/users/[id]- Update userDELETE /api/admin/users/[id]- Delete user
Products
GET /api/products- List productsPOST /api/products- Create productPATCH /api/products/[id]- Update productDELETE /api/products/[id]- Delete product
Orders
GET /api/orders- List ordersPOST /api/orders- Create orderPATCH /api/orders/[id]- Update status
Categories
GET /api/categories- List categories
Best for products/services with simple attributes:
- Bookstores - Add: author, ISBN, publisher
- Retail Stores - Add: expiry date, barcode
- Electronics Stores - Add: brand, model, warranty
- Fashion Stores - Add: size, color, material
- Plant Nursery - Add: plant type, care instructions
- Music Stores - Add: instrument type, brand
- Art Marketplace - Add: artist, materials, dimensions
Requires additional fields and workflow adjustments: 8. Restaurant/Food Delivery - Add: cuisine, spice level, ingredients 9. Pharmacy - Add: composition, prescription required 10. Gym Membership - Change to memberships, add duration 11. Car Rental - Change to vehicles, add booking calendar 12. Event Ticketing - Change to events, add venue, date 13. Course Platform - Change to courses, add instructor, syllabus
Requires data model changes and feature additions: 14. Real Estate - Change to properties, add location, bedrooms 15. Hotel Booking - Change to rooms, add booking calendar
Must work flawlessly on:
- Google Chrome (latest)
- Mozilla Firefox (latest)
- Safari (macOS & iOS)
- Microsoft Edge (latest)
- Opera (latest)
- Samsung Internet (mobile)
Must be fully responsive on:
- Mobile phones (all sizes: 320px - 480px)
- Tablets (768px - 1024px)
- Laptops (1200px - 1440px)
- Desktop monitors (1440px - 1920px)
- Ultra-wide screens (1920px+)
- Keyboard navigation support
- Screen reader compatible
- High contrast mode
- Font size adjustable
- Touch-friendly (minimum 44px buttons)
- Passwords must be encrypted (not stored as plain text)
- Secure login with session timeout
- Protection against common attacks (SQL injection, XSS)
- Role-based access (users cannot access unauthorized pages)
- Data validation on all inputs
- Secure password reset process
- Activity logging for security audit
- Two-factor authentication (2FA)
- Password reset via email
- Email verification on registration
- Failed login attempt tracking (lock account after 5 attempts)
- Activity logging for all actions
- IP address tracking
- Session timeout after inactivity
- Rate limiting on API endpoints
- Multi-language support (English & Hindi)
- Dark mode (toggle switch)
- Mobile app (Flutter)
- Real-time notifications
- Payment gateway integration
- Email notifications
- Advanced search filters
- Product recommendations
- Export to CSV/PDF
- Bulk operations (select multiple users, bulk role change)
- Export user list to CSV
- View user activity history
- Send notification/email to user
- Reset user password (admin only)
- View orders placed by specific user
- Impersonate user (for debugging, with audit log)
- Role approval workflow (users request role upgrade, admin approves/rejects)
- Must be deployable for FREE (no monthly costs)
- Should support custom domain
- Automatic SSL certificate
- Global CDN for fast loading
- Relational database (PostgreSQL)
- Must support free tier (at least 500MB)
- Automatic backups
- Migration support
- Page load time: < 2 seconds on 4G
- Mobile page load: < 3 seconds
- API response time: < 500ms
- Support at least 100 concurrent users
Client Pricing:
- Setup & customization: $500 - $2,000
- Monthly maintenance: $100 - $300
- Hosting cost: $0 (free tier)
- Domain cost: $10-15/year (optional)
Your Investment:
- Development time: 2-7 days
- No hosting costs
- Profit margin: 80-90%
Scalability:
- Clone for 5 clients = $2,500 - $10,000 revenue
- Clone for 10 clients = $5,000 - $20,000 revenue
- Freelance Developers - Build and sell quickly
- Development Agencies - Rapid client delivery
- Startups - Launch MVP fast
- Students - Portfolio project for interviews
- Entrepreneurs - Start SaaS business with low investment
- Clone the repository
- Choose your industry (from 15 options)
- Customize data fields (2-6 hours)
- Update branding (logo, colors) (1-2 hours)
- Add demo data (1 hour)
- Deploy for FREE (30 minutes)
- Deliver to client
Total Time: 2-7 days depending on complexity Total Cost: $0 in hosting Client Price: $500 - $2,000
Built with Next.js 14, PostgreSQL, and Flutter - Built for rapid deployment and maximum profit