A robust Node.js/Express backend service for managing social media account sales with comprehensive features including user management, secure payments, escrow service, and detailed analytics.
The frontend application is deployed and accessible at: https://scottech.vercel.app
- The repository is accessible at: https://github.com/freshpex/accountSalesFrontend
- JWT-based authentication system
- Google OAuth integration
- Two-factor authentication
- Rate limiting and CORS protection
- Helmet security headers
- Password hashing and validation
- Social media account listings
- Multi-platform support (Instagram, Facebook, Twitter, WhatsApp)
- Image upload with Supabase storage
- Account credentials management
- Availability tracking
- Flutterwave integration
- Multiple payment methods (Card, Bank Transfer, USSD)
- Escrow system for secure transactions
- Transaction history and tracking
- Payment verification system
- Real-time analytics
- Transaction monitoring
- Security settings
- Notification center
- Profile management
- Sales reporting and analytics
- Customer management
- Product moderation
- Help ticket system
- User segment management
- Runtime: Node.js
- Framework: Express.js
- Database: MongoDB with Mongoose
- Authentication: JWT, Passport.js
- Storage: Supabase
- Payment: Flutterwave
- Email Service: Mailjet
- Security:
- Helmet
- Express Rate Limit
- CORS
- Input validation
- XSS protection
- Node.js (v18 or higher)
- MongoDB
- Supabase account
- Flutterwave account
- Mailjet account
- Google OAuth credentials (for social login)
- Clone the repository
git clone https://github.com/freshpex/accountSalesBackend.git
cd accountSalesBackend- Install dependencies
npm install- Environment Setup
Create a
.envfile with the following variables:
PORT=5000
NODE_ENV=development
MONGODB_URI=your_mongodb_uri
JWT_SECRET=your_jwt_secret
MJ_APIKEY=your_mailjet_api_key
MJ_SECRETKEY=your_mailjet_secret
FLUTTERWAVE_SECRET_KEY=your_flutterwave_secret
FRONTEND_URL=http://localhost:5173- Start the server
# Development
npm run start-dev
# Production
npm start-
User Management
- Authentication & Authorization
- Profile Management
- Security Settings
- Role-based Access Control
-
Product System
- Social Media Accounts
- Multi-platform Support
- Image Management
- Inventory Control
-
Transaction System
- Payment Processing
- Escrow Service
- Purchase Verification
- Credential Transfer
-
Analytics & Reporting
- Sales Analytics
- Customer Insights
- Regional Performance
- Revenue Tracking
POST /api/v1/user/signup- Register new userPOST /api/v1/user/signin- User loginPOST /api/v1/user/forgot-password- Password reset requestGET /api/v1/user/auth/google- Google OAuth login
GET /api/v1/products- List all productsPOST /api/v1/products- Create productGET /api/v1/products/:id- Get product detailsPUT /api/v1/products/:id- Update productDELETE /api/v1/products/:id- Delete productGET /api/v1/products/available- List available productsGET /api/v1/products/stats- Get product statistics
POST /api/v1/transactions/initiate- Start transactionGET /api/v1/transactions- List transactionsGET /api/v1/transactions/:id- Transaction detailsPUT /api/v1/transactions/:id- Update transactionDELETE /api/v1/transactions/:id- Delete transactionGET /api/v1/transactions/:id/credentials- Get purchased credentials
POST /api/v1/transactions/callback- Payment callbackGET /api/v1/transactions/verify/:id- Verify paymentPOST /api/v1/transactions/webhook- Payment webhook
GET /api/v1/dashboard/overview- Get dashboard overviewGET /api/v1/dashboard/metrics- Get performance metricsGET /api/v1/dashboard/regional- Get regional analyticsGET /api/v1/dashboard/popular- Get popular products
GET /api/v1/user/dashboard/overview- Personal dashboardGET /api/v1/user/dashboard/spending- Spending analyticsGET /api/v1/user/dashboard/activity- Recent activitiesGET /api/v1/user/dashboard/purchases- Purchase history
GET /api/v1/customers- List customersPOST /api/v1/customers- Add customerGET /api/v1/customers/:id- Customer detailsPUT /api/v1/customers/:id- Update customerDELETE /api/v1/customers/:id- Delete customerPATCH /api/v1/customers/:id/segment- Update segmentGET /api/v1/customers/:id/activity- Customer activity
GET /api/v1/help-tickets- List ticketsPOST /api/v1/help-tickets- Create ticketGET /api/v1/help-tickets/:id- Ticket detailsPUT /api/v1/help-tickets/:id- Update ticketPOST /api/v1/help-tickets/:id/responses- Add responsePATCH /api/v1/help-tickets/:id/status- Update status
GET /api/v1/notifications- Get notificationsPATCH /api/v1/notifications/:id/read- Mark as readGET /api/v1/notifications/settings- Get settingsPUT /api/v1/notifications/settings- Update settings
GET /api/v1/sales/report- Get sales reportGET /api/v1/sales/analytics- Get analyticsGET /api/v1/sales/regional- Regional dataGET /api/v1/sales/performance- Performance metrics
POST /api/v1/escrow- Create escrowGET /api/v1/escrow/:id- Get escrow detailsPATCH /api/v1/escrow/:id/status- Update statusGET /api/v1/escrow/:id/credentials- Get credentials
- Multi-image upload (up to 4 images)
- Account credentials management
- Social media metrics tracking
- Region-based categorization
- Sales performance tracking
- JWT-based authentication
- Rate limiting
- CORS protection
- Helmet security headers
- Password hashing with bcrypt
- Input validation
- XSS protection
- OAuth 2.0 integration
- Password hashing with bcrypt
- Two-factor authentication
- Session management
- Rate limiting per endpoint
- CORS configuration
- Request validation
- Input sanitization
- XSS protection
- SQL injection prevention
- Encrypted credentials storage
- Secure file uploads
- Access control
- Role-based permissions
- Sales report generation
- Customer segmentation updates
- Analytics calculation
- Email notifications
- Activity logging
- Payment notifications
- Transaction updates
- System alerts
- Integration events
-
User
- Authentication details
- Profile information
- Security settings
- Notification preferences
-
Product
- Account details
- Media content
- Sales metrics
- Security features
-
Transaction
- Payment details
- Product information
- Customer data
- Status tracking
-
Customer
- Profile details
- Purchase history
- Segment information
- Activity tracking
-
UserProfile
-
Notification
-
HelpTicket
-
SalesReport
-
Escrow
const limiter = rateLimit({
windowMs: 15 * 60 * 1000,
max: 1000
});- User initiates purchase
- Payment processing
- Escrow creation
- Credential transfer
- Transaction completion
npm test- WebSocket integration for real-time updates
- Enhanced analytics dashboard
- Additional payment gateways
- Automated testing suite
- Docker containerization
- Blockchain integration for escrow
- AI-powered fraud detection
- Multi-language support
Please read CONTRIBUTING.md for details on our code of conduct and the process for submitting pull requests.
This project is licensed under the MIT License - see the LICENSE file for details.
For support, email epekipoluenoch@gmail.com or create an issue in the repository.
- Express.js team
- MongoDB team
- Flutterwave
- Supabase
- Mailjet