Full-stack commodities management with role-based access control. Built with NestJS + GraphQL + Prisma (backend) and Next.js + Apollo Client (frontend).
Node.js v18+ or Bun
# Clone repository
git clone <repository-url> && cd slooze
# Setup Environment Variables
cp server/.env.example server/.env
cp client/.env.local.example client/.env.local
# Setup Backend
cd server
npm install && npx prisma generate && npx prisma db push && npm run seed
bun install && bunx prisma generate && bunx prisma db push && bun run seed # Alternative
# Setup Frontend
cd ../client
npm install
bun install # Alternative# Terminal 1 - Backend (port 4000)
cd server
npm run start:dev
bun run start:dev # Alternative
# Terminal 2 - Frontend (port 3000)
cd client
npm run dev
bun run dev # AlternativeGraphQL Playground: http://localhost:4000/graphql
The repository includes .env.example files with default development values:
server/.env.example→ Copy toserver/.envclient/.env.local.example→ Copy toclient/.env.local
Both files are pre-configured for local development. You only need to change JWT_SECRET in production.
| Password | Role | |
|---|---|---|
manager@slooze.com |
password |
Manager (Dashboard + Products) |
storekeeper@slooze.com |
password |
Store Keeper (Products only) |
- Auth: JWT authentication with role-based access (Manager, Store Keeper)
- Dashboard: Product stats, category distribution, stock alerts (Manager only)
- Products: CRUD operations, search/filter, real-time updates
- UI: Light/dark theme, modal forms, responsive design (shadcn/ui)
Frontend: Next.js 16, TypeScript, Apollo Client, Tailwind v4, shadcn/ui
Backend: NestJS 10, GraphQL (code-first), Prisma 5, SQLite, JWT
| Command | When | Purpose |
|---|---|---|
npm install or bun install |
First time / new deps | Install packages |
npx prisma generate or bunx prisma generate |
First time / schema changes | Generate Prisma types |
npx prisma db push or bunx prisma db push |
First time / schema changes | Update database |
npm run seed or bun run seed |
First time / reset data | Seed demo data |
npm run start:dev or bun run start:dev |
Daily | Start dev server |
# Open database GUI (localhost:5555)
npx prisma studio
bunx prisma studio # Alternative
# Reset database
rm prisma/dev.db && npx prisma db push && npm run seed
rm prisma/dev.db && bunx prisma db push && bun run seed # Alternative# Login
mutation {
login(input: { email: "manager@slooze.com", password: "password" }) {
token
user {
name
role
}
}
}
# Get Products
query {
products {
id
name
sku
category
price
quantity
status
}
}
# Dashboard Stats (Manager only)
query {
dashboardStats {
totalProducts
lowStockCount
totalInventoryValue
}
}
# Create Product
mutation {
createProduct(
input: {
name: "Rice"
sku: "RICE-001"
category: "Grains"
price: 45.99
quantity: 250
status: "ACTIVE"
}
) {
id
}
}Port in use: lsof -ti:4000 | xargs kill -9 (server) or lsof -ti:3000 | xargs kill -9 (client)
Database issues: Delete server/prisma/dev.db, run npx prisma db push && npm run seed (or bunx prisma db push && bun run seed)
Auth errors: Clear browser localStorage, verify server is running
© Slooze. All Rights Reserved. | careers@slooze.xyz
