Before running the project, you need to install and configure:
Option A: Install PostgreSQL Locally (Windows)
- Download from: https://www.postgresql.org/download/windows/
- Install PostgreSQL 15 or higher
- During installation, set a password for the
postgresuser - Default port: 5432
Option B: Use Docker
docker run --name smm-postgres -e POSTGRES_PASSWORD=yourpassword -e POSTGRES_DB=smm_panel -p 5432:5432 -d postgres:15Option A: Install Redis Locally (Windows)
- Download from: https://github.com/microsoftarchive/redis/releases
- Or use WSL:
wsl -d Ubuntu sudo apt-get install redis-server - Default port: 6379
Option B: Use Docker
docker run --name smm-redis -p 6379:6379 -d redis:7-alpineEdit apps/api/.env with your actual database credentials:
# Database
DATABASE_URL="postgresql://postgres:yourpassword@localhost:5432/smm_panel?schema=public"
# Redis
REDIS_HOST=localhost
REDIS_PORT=6379
# JWT
JWT_SECRET=your_super_secret_jwt_key_change_this_in_production
JWT_EXPIRE=30d
# Stripe (optional for now)
STRIPE_SECRET_KEY=your_stripe_secret_key
STRIPE_WEBHOOK_SECRET=your_stripe_webhook_secret
# Admin
ADMIN_EMAIL=admin@example.com
ADMIN_PASSWORD=changethisinproduction123
# Rate Limiting
API_RATE_LIMIT=100Once PostgreSQL and Redis are running:
npm run db:generate✅ Already done!
npm run db:migratenpm run db:seedOption A: Start Both (Frontend + Backend)
npm run devOption B: Start Separately
# Terminal 1 - Backend
npm run dev:api
# Terminal 2 - Frontend
npm run dev:web- Frontend: http://localhost:3000
- Backend API: http://localhost:5000
- API Health: http://localhost:5000/health
If you have Docker installed, use this one-command setup:
# Start PostgreSQL + Redis + API + Web
docker-compose -f docker/docker-compose.yml up -dThen run migrations:
docker-compose exec api npm run db:migrate-
Check PostgreSQL:
psql -U postgres -l
-
Check Redis:
redis-cli ping # Should return: PONG -
Check API:
curl http://localhost:5000/health
Your panel now includes:
- ✅ Multi-currency (USD, DH, EUR)
- ✅ Multi-language (EN, AR, FR)
- ✅ Manual payment system
- ✅ WhatsApp integration ready
- ✅ Moroccan timezone (GMT+1)
Admin:
- Email:
admin@smmpanel.com - Password:
admin123
Test User:
- Email:
user@test.com - Password:
admin123
"Database connection error"
- Check PostgreSQL is running
- Verify DATABASE_URL in
.env - Ensure database
smm_panelexists
"Redis connection error"
- Check Redis is running
- Verify REDIS_HOST and REDIS_PORT
"Port already in use"
- Frontend: Change port in
apps/web/package.json - Backend: Change PORT in
apps/api/.env
Need help? Check the detailed SETUP.md or MOROCCO-LAUNCH-PLAN.md