Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SMM Panel - Social Media Marketing Platform

A comprehensive, production-ready Social Media Marketing panel built with a modern monorepo architecture.

🏗️ Architecture

This project uses a monorepo structure with the following organization:

smm-panel/
├── apps/
│   ├── api/          # Backend API (Node.js + Express + TypeScript)
│   └── web/          # Frontend (Next.js 15 + React 19 + TypeScript)
├── packages/
│   ├── types/        # Shared TypeScript types
│   └── config/       # Shared configuration
├── docker/           # Docker configurations
└── scripts/          # Build & deployment scripts

✨ Features

Core Features

  • 🔐 JWT Authentication - Secure user authentication
  • 👥 Role-Based Access Control - USER, RESELLER, ADMIN, SUPER_ADMIN
  • 💳 Service Management - 12+ social media platforms
  • 📦 Order Processing - Automated order handling with drip-feed
  • 💰 Payment Integration - Stripe-ready payment system
  • 🎯 Admin Dashboard - Comprehensive management interface

Advanced Features

  • 📊 Mass Ordering - Bulk order processing (up to 100 orders)
  • 🤝 Affiliate Program - 5% commission with auto-tracking
  • 🎫 Support Tickets - Customer support system
  • 📈 Analytics - User behavior and order tracking
  • 🔄 API Documentation - Interactive endpoint documentation
  • Rate Limiting - Redis-based request throttling

🚀 Quick Start

Prerequisites

  • Node.js 18+
  • PostgreSQL 12+
  • Redis 6+
  • npm or yarn

Installation

  1. Clone and install dependencies:
cd smm-panel
npm install
  1. Set up environment variables:
cp .env.example apps/api/.env
cp .env.example apps/web/.env.local

Edit the .env files with your configuration.

  1. Set up the database:
npm run db:generate
npm run db:migrate
npm run db:seed
  1. Start development servers:
npm run dev

This starts both frontend (http://localhost:3000) and backend (http://localhost:5000).

📦 Monorepo Commands

Development

npm run dev              # Start both apps in development
npm run dev:api          # Start only backend API
npm run dev:web          # Start only frontend

Build

npm run build            # Build all apps
npm run build:api        # Build backend only
npm run build:web        # Build frontend only

Database

npm run db:generate      # Generate Prisma client
npm run db:migrate       # Run migrations
npm run db:seed          # Seed database
npm run db:studio        # Open Prisma Studio

Testing & Linting

npm run lint             # Lint all workspaces
npm run test             # Run all tests

🐳 Docker Deployment

Using Docker Compose (Recommended)

  1. Create .env file in root:
cp .env.example .env
# Edit .env with your production values
  1. Start all services:
docker-compose -f docker/docker-compose.yml up -d

This starts:

  • PostgreSQL database (port 5432)
  • Redis cache (port 6379)
  • Backend API (port 5000)
  • Frontend web (port 3000)
  1. Run migrations:
docker-compose exec api npm run prisma:migrate:prod

Individual Docker Builds

# Build API
docker build -f docker/Dockerfile.api -t smm-panel-api .

# Build Web
docker build -f docker/Dockerfile.web -t smm-panel-web .

📁 Project Structure

Backend (apps/api/)

apps/api/src/
├── modules/          # Feature modules
│   ├── auth/        # Authentication
│   ├── users/       # User management
│   ├── services/    # Service catalog
│   ├── orders/      # Order processing
│   └── ...
├── common/          # Shared code
│   └── middleware/  # Express middleware
├── config/          # Configuration
├── database/        # Prisma schema & migrations
├── utils/           # Utility functions
└── types/           # TypeScript types

Frontend (apps/web/)

apps/web/src/
├── app/             # Next.js app router
│   ├── (auth)/     # Auth pages
│   ├── (dashboard)/# Dashboard pages
│   └── (admin)/    # Admin pages
├── components/      # React components
├── lib/            # Libraries & utilities
│   ├── api/        # API client
│   └── hooks/      # Custom hooks
└── types/          # TypeScript types

🔑 Default Credentials

After seeding the database:

Admin Account:

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

Test User:

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

⚠️ Change these in production!

🌐 API Endpoints

Authentication

  • POST /api/auth/register - User registration
  • POST /api/auth/login - User login
  • POST /api/auth/forgot-password - Password reset

Services

  • GET /api/services - List services
  • POST /api/services - Create service (Admin)
  • PUT /api/services/:id - Update service (Admin)

Orders

  • GET /api/orders - Get user orders
  • POST /api/orders - Place new order
  • POST /api/orders/:id/refill - Request refill

Admin

  • GET /api/admin/dashboard - Dashboard stats
  • GET /api/admin/users - List users
  • GET /api/admin/orders - All orders

[Full API documentation available at /api/docs]

🚢 Deployment Options

1. Railway (Recommended - Easiest)

  • Push to GitHub
  • Connect Railway to your repo
  • Add PostgreSQL & Redis add-ons
  • Deploy automatically

2. Vercel + Database Provider

  • Frontend: Deploy to Vercel
  • Backend: Deploy to Render/Railway
  • Database: Supabase or Railway Postgres
  • Redis: Upstash Redis

3. AWS/GCP/Azure

  • Use Elastic Beanstalk, Cloud Run, or App Service
  • RDS/Cloud SQL for PostgreSQL
  • ElastiCache/MemoryStore for Redis

4. VPS (DigitalOcean, Hetzner)

  • Use Docker Compose
  • Set up Nginx reverse proxy
  • Configure SSL with Let's Encrypt

🔒 Security

  • ✅ Password hashing with bcryptjs
  • ✅ JWT token authentication
  • ✅ Rate limiting per IP
  • ✅ Input validation
  • ✅ CORS protection
  • ✅ SQL injection protection (Prisma)
  • ✅ XSS protection

🤝 Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests if applicable
  5. Submit a pull request

📝 License

MIT License - see LICENSE file for details

📚 Documentation

For detailed documentation, guides, and API references, visit the docs folder:

📧 Support

For issues and questions:

  • Check the documentation
  • Review existing GitHub issues
  • Create a new issue with detailed information

Status: ✅ Production Ready (Last Security Audit: October 29, 2025)

Built with ❤️ using Node.js, TypeScript, Next.js, and Prisma

About

SMM Panel - Social Media Marketing Platform

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages