Skip to content

Latest commit

 

History

History
172 lines (125 loc) · 3.44 KB

File metadata and controls

172 lines (125 loc) · 3.44 KB

🚀 Quick Start Guide - SMM Panel

Prerequisites Setup

Before running the project, you need to install and configure:

1. PostgreSQL Database

Option A: Install PostgreSQL Locally (Windows)

  1. Download from: https://www.postgresql.org/download/windows/
  2. Install PostgreSQL 15 or higher
  3. During installation, set a password for the postgres user
  4. 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:15

2. Redis Cache

Option A: Install Redis Locally (Windows)

  1. Download from: https://github.com/microsoftarchive/redis/releases
  2. Or use WSL: wsl -d Ubuntu sudo apt-get install redis-server
  3. Default port: 6379

Option B: Use Docker

docker run --name smm-redis -p 6379:6379 -d redis:7-alpine

3. Configure Environment Variables

Edit 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=100

🏃 Running the Project

Once PostgreSQL and Redis are running:

Step 1: Generate Prisma Client

npm run db:generate

✅ Already done!

Step 2: Run Database Migrations

npm run db:migrate

Step 3: Seed Database (Optional)

npm run db:seed

Step 4: Start Development Servers

Option A: Start Both (Frontend + Backend)

npm run dev

Option B: Start Separately

# Terminal 1 - Backend
npm run dev:api

# Terminal 2 - Frontend
npm run dev:web

🌐 Access Points

🐳 Easy Setup with Docker

If you have Docker installed, use this one-command setup:

# Start PostgreSQL + Redis + API + Web
docker-compose -f docker/docker-compose.yml up -d

Then run migrations:

docker-compose exec api npm run db:migrate

✅ Verify Installation

  1. Check PostgreSQL:

    psql -U postgres -l
  2. Check Redis:

    redis-cli ping
    # Should return: PONG
  3. Check API:

    curl http://localhost:5000/health

🇲🇦 Morocco-Specific Features

Your panel now includes:

  • ✅ Multi-currency (USD, DH, EUR)
  • ✅ Multi-language (EN, AR, FR)
  • ✅ Manual payment system
  • ✅ WhatsApp integration ready
  • ✅ Moroccan timezone (GMT+1)

📝 Default Credentials (After Seeding)

Admin:

  • Email: admin@smmpanel.com
  • Password: admin123

Test User:

  • Email: user@test.com
  • Password: admin123

⚠️ Change these in production!

❌ Troubleshooting

"Database connection error"

  • Check PostgreSQL is running
  • Verify DATABASE_URL in .env
  • Ensure database smm_panel exists

"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