This guide will help you set up and run the complete SMM Panel application.
Before you begin, make sure you have the following installed:
- Node.js (v18 or higher)
- PostgreSQL (v12 or higher)
- Redis (v6 or higher)
- npm or yarn
- Git
First, clone and set up the backend:
cd smm-panel
# Install backend dependencies
npm install
# Set up environment variables
cp .env.example .envEdit the .env file with your configuration:
NODE_ENV=development
PORT=5000
# Database
DATABASE_URL="postgresql://username:password@localhost:5432/smm_panel?schema=public"
# JWT
JWT_SECRET=your_super_secret_jwt_key_change_this_in_production
JWT_EXPIRE=30d
# Redis
REDIS_HOST=localhost
REDIS_PORT=6379
# Stripe (optional for payments)
STRIPE_SECRET_KEY=your_stripe_secret_key
STRIPE_WEBHOOK_SECRET=your_stripe_webhook_secret
# Admin credentials
ADMIN_EMAIL=admin@example.com
ADMIN_PASSWORD=changethisinproduction123
API_RATE_LIMIT=100# Generate Prisma client
npm run prisma:generate
# Run database migrations
npm run prisma:migrate
# Seed the database with sample data
npm run prisma:seed# Development mode
npm run dev
# Production mode
npm run build
npm startThe backend will be available at http://localhost:5000
In a new terminal, set up the frontend:
cd frontend
# Install frontend dependencies
npm install
# Start development server
npm run devThe frontend will be available at http://localhost:3000
After running the seed script, you can use these credentials:
Admin Account:
- Email:
admin@smmpanel.com - Password:
admin123
Test User Account:
- Email:
user@test.com - Password:
admin123
The backend provides the following main endpoints:
POST /api/auth/register- User registrationPOST /api/auth/login- User loginPOST /api/auth/forgot-password- Password reset request
GET /api/services- List all servicesGET /api/services/:id- Get service detailsPOST /api/services- Create service (Admin only)
GET /api/orders- Get user ordersPOST /api/orders- Place new orderGET /api/orders/:id- Get order details
GET /api/admin/dashboard- Admin dashboard statsGET /api/admin/users- List usersGET /api/admin/orders- List all orders
POST /api/payments/stripe/create-payment-intent- Create payment
The application uses PostgreSQL with the following main tables:
- users - User accounts and authentication
- services - SMM services with pricing
- orders - User orders and status
- transactions - Payment and balance history
- api_providers - External service providers
✅ User registration and authentication ✅ Service browsing and filtering ✅ Order placement and tracking ✅ Balance management ✅ Payment integration (Stripe ready) ✅ Order refill requests
✅ User management ✅ Service management ✅ Order monitoring ✅ Balance adjustments ✅ Dashboard analytics
✅ JWT authentication ✅ Role-based access control ✅ Rate limiting ✅ Input validation ✅ Error handling ✅ Responsive design ✅ TypeScript support
Key configuration files:
.env- Environment variablesprisma/schema.prisma- Database schemasrc/app.ts- Main application file
Key configuration files:
.env.local- Frontend environment variablestailwind.config.js- Tailwind CSS configurationnext.config.ts- Next.js configuration
- Use the admin panel to add services through the UI
- Or use the API directly:
curl -X POST http://localhost:5000/api/services \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_ADMIN_TOKEN" \
-d '{
"name": "Instagram Followers",
"category": "Followers",
"platform": "INSTAGRAM",
"price": 2.5,
"minQuantity": 100,
"maxQuantity": 10000
}'# View data in Prisma Studio
npm run prisma:studio
# Reset database (careful!)
npx prisma migrate reset
# Generate new migration
npx prisma migrate dev --name your_migration_name# Test API endpoints
curl http://localhost:5000/health
# Test authentication
curl -X POST http://localhost:5000/api/auth/login \
-H "Content-Type: application/json" \
-d '{"emailOrUsername": "admin@smmpanel.com", "password": "admin123"}'Make sure to set these in production:
NODE_ENV=production
DATABASE_URL="postgresql://prod_user:prod_pass@localhost:5432/smm_panel_prod"
JWT_SECRET="your_production_jwt_secret_very_long_and_secure"
REDIS_HOST="your_redis_host"
STRIPE_SECRET_KEY="sk_live_your_live_stripe_key"# Backend
npm run build
# Frontend
cd frontend && npm run buildUse PM2 or similar for process management:
npm install -g pm2
pm2 start npm --name "smm-backend" -- startDatabase Connection Error:
- Check PostgreSQL is running
- Verify DATABASE_URL is correct
- Ensure database exists
Redis Connection Error:
- Check Redis is running
- Verify REDIS_HOST and REDIS_PORT
Port Already in Use:
- Change PORT in .env file
- Kill process using the port
Frontend API Connection:
- Verify NEXT_PUBLIC_API_URL in frontend/.env.local
- Check backend is running on correct port
Backend logs are output to console. In production, consider using a logging service.
For issues and questions:
- Check this documentation
- Review the code comments
- Check the GitHub issues (if applicable)
- Change default passwords immediately
- Use strong JWT secrets in production
- Enable HTTPS in production
- Regularly update dependencies
- Monitor for security vulnerabilities