You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# 1. Install dependencies
npm install
# 2. Copy env file and fill in values
cp .env.example .env
# 3. Seed the database (roles, users, products, customers, sales)
npm run seed
# 4. Start dev server
npm run dev
Environment Variables
Variable
Description
Example
NODE_ENV
Environment
development
PORT
Server port
5000
API_PREFIX
Route prefix
/api/v1
MONGODB_URI
MongoDB connection string
mongodb+srv://...
JWT_SECRET
JWT signing secret
a-long-random-string
JWT_EXPIRES_IN
JWT expiry
1d
BCRYPT_SALT_ROUNDS
bcrypt cost factor
10
CLIENT_URL
Allowed CORS origin
http://localhost:5173
MAX_FILE_SIZE_MB
Max upload size
2
CLOUDINARY_CLOUD_NAME
Cloudinary cloud name
your_cloud
CLOUDINARY_API_KEY
Cloudinary API key
123456789
CLOUDINARY_API_SECRET
Cloudinary API secret
abc123...
RATE_LIMIT_WINDOW_MS
Rate limit window (ms)
900000
RATE_LIMIT_MAX_REQUESTS
Max requests per window
100
SEED_ADMIN_EMAIL
Admin seed email
admin@example.com
SEED_ADMIN_PASSWORD
Admin seed password
Admin@1234
SEED_MANAGER_EMAIL
Manager seed email
manager@example.com
SEED_MANAGER_PASSWORD
Manager seed password
Manager@1234
SEED_EMPLOYEE_EMAIL
Employee seed email
employee@example.com
SEED_EMPLOYEE_PASSWORD
Employee seed password
Employee@1234
Scripts
Command
Description
npm run dev
Start dev server with hot reload
npm run build
Compile TypeScript to dist/
npm start
Run compiled production build
npm run seed
Seed roles, users, products, customers, and sales
npm run lint
Run ESLint
npm run lint:fix
Run ESLint with auto-fix
Seed Credentials
After running npm run seed, the following accounts are available:
Role
Email
Password
Admin
value of SEED_ADMIN_EMAIL
value of SEED_ADMIN_PASSWORD
Manager
value of SEED_MANAGER_EMAIL
value of SEED_MANAGER_PASSWORD
Employee
value of SEED_EMPLOYEE_EMAIL
value of SEED_EMPLOYEE_PASSWORD
API Overview
Base URL: http://localhost:5000/api/v1
Interactive docs available at http://localhost:5000/api-docs (dev only).