mrmeaow presents
Why this exists: As a developer, I found myself in a common dilemmaβmy portfolio lacked a public, production-ready full-stack application to showcase. While I'm actively building a Cloud ERP system with multi-tenancy (a complex, long-term WIP), I needed something tangible and complete that demonstrates:
- β Full-stack proficiency with modern TypeScript
- β Real business logic beyond todo apps and CRUD demos
- β Production-ready patterns (RBAC, testing, deployment configs)
- β Monorepo architecture with shared packages
- β Outcome-driven development with proper documentation
Lite IMS is that projectβa lightweight but serious inventory management system that proves I can ship complete, type-safe, enterprise-grade applications. It's the portfolio piece I wished I had, built with the same principles I apply to large-scale systems.
β Built by @mrmeaow
Lite IMS is a production-ready, enterprise-grade Inventory Management System built with the PERN stack (PostgreSQL, Express, React, Node.js). Designed for real business needs, it provides comprehensive inventory tracking, role-based access control, and real-time stock management capabilities.
- π Advanced RBAC - Dynamic role & permission management with granular resource-level access control
- π¦ Inventory Management - Track items, categories, stock movements with full audit trail
- π Custom Authentication - JWT-based auth with HTTP-only cookies, refresh tokens, and session management
- π Real-time Updates - Server-Sent Events (SSE) for live stock updates and notifications
- π― Type-Safe - End-to-end TypeScript with strict type checking and Prisma ORM
- π§ͺ Tested - Comprehensive test coverage with Vitest and Supertest
- π Production Ready - Optimized for Render.com free-tier deployment
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Lite IMS β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β
β ββββββββββββββββ ββββββββββββββββ β
β β Web App βββββββββ HTTP ββββββββββββΊβ API Server β β
β β React 19 β (Port 3030) β Express 5 β β
β β Vite + TS β β + TypeScriptβ β
β β TailwindCSS β β β β
β ββββββββββββββββ ββββββββ¬ββββββββ β
β β β
β ββββββββββββββββββββββββββββββββΌβββββββββββ β
β β β β β
β ββββββββΌβββββββ βββββββββΌβββββ β β
β β PostgreSQL β β Redis β β β
β β (Prisma) β β (Cache) β β β
β β Database β β Sessions β β β
β βββββββββββββββ ββββββββββββββ β β
β β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
| Layer | Technology | Purpose |
|---|---|---|
| Frontend | React 19 + Vite | Modern SPA with fast HMR |
| Styling | TailwindCSS v4 | Utility-first CSS framework |
| State | Zustand | Lightweight state management |
| Backend | Express.js 5 | RESTful API server |
| Database | PostgreSQL 15 | Primary data store |
| ORM | Prisma 6 | Type-safe database access |
| Cache | Redis 7 | Session & cache layer |
| Auth | JWT + bcryptjs | Secure authentication |
| Validation | Zod | Runtime type validation |
| Testing | Vitest + Supertest | Unit & E2E testing |
lite-ims/
βββ apps/
β βββ api/ # Express.js API server
β β βββ src/
β β β βββ config/ # Configuration & database
β β β βββ middleware/ # Auth, RBAC, error handling
β β β βββ routes/ # API route handlers
β β β βββ services/ # Business logic layer
β β β βββ workers/ # Background job processors
β β β βββ utils/ # Shared utilities
β β βββ dist/
β β βββ *.js # Compiled API
β β βββ client/ # Built web app (SPA)
β β
β βββ web/ # React frontend
β βββ src/
β βββ components/ # Reusable UI components
β βββ pages/ # Page components
β βββ hooks/ # Custom React hooks
β βββ stores/ # Zustand stores
β βββ utils/ # Helpers & API client
β
βββ packages/ # Shared libraries
β βββ shared/ # Shared schemas & constants
β βββ types/ # TypeScript type definitions
β βββ database/ # Prisma client & migrations
β
βββ docker/ # Docker configurations
βββ .env.example # Environment template
βββ docker-compose.yml # Local development stack
βββ render.yaml # Production deployment config
- Node.js v22.18.0+ (use fnm for version management)
- pnpm v9.0+ (
npm i -g pnpm) - Docker & Docker Compose (for local database)
# Clone the repository
git clone https://github.com/yourusername/lite-ims.git
cd lite-ims
# Install dependencies
pnpm install
# Start database & Redis (Docker)
docker compose up postgres redis -d
# Push database schema
pnpm db:push
# Start development servers
pnpm dev| Service | URL | Description |
|---|---|---|
| Web App | http://localhost:5171 | React frontend |
| API | http://localhost:3030 | REST API |
| Health | http://localhost:3030/monitoring/health | Health check |
| Metrics | http://localhost:3030/monitoring/metrics | System metrics |
Email: admin@ims.local
Password: admin123
Important
Change default credentials in production!
# Development
pnpm dev # Start all dev servers (API + Web)
pnpm dev:api # Start API server only
pnpm dev:web # Start web server only
pnpm dev:all # Start both API and web
# Building
pnpm build # Build all packages
pnpm build:api # Build API only
pnpm build:web # Build web only
pnpm preview # Run production build locally
# Database
pnpm db:generate # Generate Prisma client
pnpm db:push # Push schema to database
pnpm db:migrate # Run migrations
pnpm db:reset # Reset database
# Maintenance
pnpm typecheck # Type check all packages
pnpm clean # Remove all build artifacts| Method | Endpoint | Description |
|---|---|---|
POST |
/api/auth/register |
Register new user |
POST |
/api/auth/login |
Login user |
POST |
/api/auth/logout |
Logout user |
POST |
/api/auth/refresh |
Refresh access token |
GET |
/api/auth/me |
Get current user |
| Method | Endpoint | Description |
|---|---|---|
GET |
/api/inventory/items |
List all items |
POST |
/api/inventory/items |
Create item |
GET |
/api/inventory/items/:id |
Get item details |
PUT |
/api/inventory/items/:id |
Update item |
DELETE |
/api/inventory/items/:id |
Delete item |
POST |
/api/inventory/stock |
Record stock movement |
GET |
/api/inventory/categories |
List categories |
| Method | Endpoint | Description |
|---|---|---|
GET |
/api/rbac/roles |
List all roles |
POST |
/api/rbac/roles |
Create role |
PUT |
/api/rbac/roles/:id/permissions |
Update permissions |
GET |
/api/rbac/permissions |
List all permissions |
POST |
/api/rbac/users/:id/roles |
Assign role to user |
| Method | Endpoint | Description |
|---|---|---|
GET |
/api/users |
List all users |
GET |
/api/users/:id |
Get user details |
PUT |
/api/users/:id |
Update user |
DELETE |
/api/users/:id |
Delete user |
PUT |
/api/users/:id/status |
Activate/deactivate user |
| Method | Endpoint | Description |
|---|---|---|
GET |
/api/settings |
Get system settings |
PUT |
/api/settings |
Update system settings |
| Method | Endpoint | Description |
|---|---|---|
GET |
/monitoring/health |
Health check (public) |
GET |
/monitoring/metrics |
System metrics (protected) |
Lite IMS features a sophisticated RBAC system with:
- Dynamic Roles: Create custom roles beyond default Admin, Manager, Viewer
- Granular Permissions: Resource + Action matrix (e.g.,
inventory:create,users:delete) - User Role Assignment: Assign multiple roles per user
- Real-time Enforcement: Middleware validates permissions on every request
| Role | Description | Permissions |
|---|---|---|
| Admin | Full system access | All permissions |
| Manager | Inventory & staff management | Most operations except user deletion |
| Staff | Daily operations | View & basic stock movements |
| Viewer | Read-only access | View only |
# Run all tests
pnpm --filter @ims/api test
pnpm --filter @ims/web test
# Watch mode
pnpm --filter @ims/api test:watch
pnpm --filter @ims/web test:watch
# Type checking
pnpm typecheck- β Unit tests for services & utilities
- β Integration tests for API endpoints
- β Component tests for React components
- β E2E test flows for critical paths
docker compose updocker compose up postgres redis -d# View logs
docker compose logs -f api
docker compose logs -f postgres
# Stop all services
docker compose down
# Stop and remove volumes (clears data)
docker compose down -v
# Access database
docker compose exec postgres psql -U postgres -d imsSee DOCKER_SETUP.md for complete Docker documentation.
Lite IMS is optimized for Render.com free-tier deployment.
| Service | Provider | Tier |
|---|---|---|
| Database | Neon | Free |
| Redis | Upstash | Free |
| Hosting | Render | Free |
-
Create Neon Database
- Sign up at neon.tech
- Create new project
- Copy connection string
-
Create Upstash Redis
- Sign up at upstash.com
- Create Redis database
- Copy REST API URL
-
Deploy to Render
- Connect GitHub repository
- Use provided
render.yamlconfiguration - Add environment variables from
.env.example
# Database
DATABASE_URL="postgresql://..."
# Redis
REDIS_URL="redis://..."
# JWT
JWT_SECRET="your-secret-key-min-32-chars"
JWT_ACCESS_EXPIRY="15m"
JWT_REFRESH_EXPIRY="7d"
# Server
NODE_ENV="production"
PORT=3030
CORS_ORIGIN="https://your-app.onrender.com"
# Cookies
COOKIE_NAME="ims_access_token"
COOKIE_MAX_AGE=900000See RENDER.md for detailed deployment guide.
- TypeScript: Strict mode enabled
- Formatting: Consistent indentation & naming
- Architecture: Follow SOLID principles
- Patterns: DRY, Clean Code practices
feat: Add stock movement tracking
fix: Resolve JWT expiry calculation
docs: Update API documentation
refactor: Improve RBAC middleware
test: Add user service tests
main # Production-ready code
develop # Integration branch
feature/* # New features
fix/* # Bug fixes
release/* # Release preparation
# Check what's using the port
lsof -i :3030
lsof -i :5171
# Kill the process
kill -9 <PID># Restart database
docker compose restart postgres
# Reset database
pnpm db:reset
# Check connection
docker compose exec postgres psql -U postgres -d ims# Clean and rebuild
pnpm clean
pnpm install
pnpm build# Regenerate Prisma client
pnpm db:generate
# Full typecheck
pnpm typecheckMIT License - see LICENSE for details.
Contributions are welcome! Please follow these steps:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
mrmeaow
Full-Stack (SWE) Developer | TypeScript Enthusiast
- π GitHub: @mrmeaow
- πΌ Portfolio: My Digital Space
- π§ Contact: iam.mahabub@proton.me
- π§ Cloud ERP - Multi-tenant ERP system (WIP)
- π¦ Lite IMS - This project
For issues, questions, or contributions:
- π Bug Reports: Open an issue on GitHub
- π¬ Questions: Use GitHub Discussions
- π© Contact: iam.mahabub@proton.me