A robust, secure, JWT-protected RESTful API backend that powers the Next Event Pro platform, enabling comprehensive event management with integrated payment processing and advanced participant management features.
- Frontend Repository: Next-Event-Client
- Backend Repository: Next-Event-Server
The Next Event Pro Server is a comprehensive Node.js/Express.js backend that provides secure APIs for event creation, management, and participation. Built with TypeScript and Prisma ORM, it features sophisticated payment processing, role-based authentication, and scalable architecture patterns.
- RESTful Architecture - Clean, standardized API endpoints following REST principles
- JWT Authentication - Secure token-based authentication and authorization
- Payment Processing - Integrated SSLCommerz payment gateway with invoice generation
- File Management - Secure file upload and storage capabilities
- Email Services - Automated email notifications and invoice delivery
- Database Management - Type-safe operations with Prisma ORM
- Error Handling - Comprehensive error management and validation
- Monitor all events and user activity through
/api/meta/* - Manage users and content moderation via
/api/user/* - Access comprehensive analytics and reports
- Override user permissions for system maintenance
- Authentication:
/api/auth/*- Login, register, password management - Event Management:
/api/event/*- CRUD operations for personal events - Participation:
/api/participant/*- Join requests and approvals - Payments:
/api/payment/*- Secure payment processing - Invitations:
/api/invite/*- Send and manage event invitations - Reviews:
/api/review/*- Post-event feedback and ratings - Profile:
/api/profile/*- User profile management
- Secure Transactions - PCI DSS compliant payment processing
- Multiple Payment Methods - Cards, mobile banking, net banking
- Automatic Invoice Generation - PDF invoices with event details
- Payment Verification - Webhook-based payment confirmation
- Refund Management - Automated refund processing
- Immediate Processing - Real-time payment validation
- Status Tracking - Complete payment lifecycle monitoring
- Email Notifications - Automated payment confirmations
- Invoice Delivery - Professional PDF invoice generation
- Modular Design - Feature-based module organization
- Service Layer - Business logic separation from controllers
- Middleware Stack - Authentication, validation, and error handling
- Database Layer - Prisma ORM with PostgreSQL
- File Processing - Secure file upload and management
- JWT Authentication - Secure token-based sessions
- Input Validation - Zod schema validation for all endpoints
- Error Handling - Comprehensive error management system
- Rate Limiting - API abuse prevention
- CORS Configuration - Cross-origin request security
src/
βββ app/
β βββ builders/ # Query builders and utilities
β β βββ PrismaQueryBuilder.ts
β β
β βββ config/ # Application configuration
β β βββ index.ts
β β
β βββ errors/ # Error handling utilities
β β βββ AppError.ts
β β βββ handleZodError.ts
β β
β βββ globalTypes/ # Global TypeScript definitions
β β βββ error.type.ts
β β βββ response.type.ts
β β
β βββ helpers/ # Utility functions
β β βββ CalculatePagination.ts
β β βββ catchAsync.ts
β β βββ emailHelper.ts
β β βββ fileUploader.ts
β β βββ generatePaymentInvoicePDF.ts
β β βββ invoiceSender.ts
β β βββ jwtHelpers.ts
β β βββ RefineQuery.ts
β β βββ sendResponse.ts
β β βββ tokenDecoder.ts
β β
β βββ interfaces/ # TypeScript interfaces
β β βββ file.ts
β β βββ pagination.ts
β β
β βββ middlewares/ # Express middlewares
β β βββ Auth.ts
β β βββ globalErrorhandler.ts
β β βββ notFound.ts
β β βββ validateRequest.ts
β β
β βββ modules/ # Feature modules
β β βββ auth/ # Authentication module
β β β βββ auth.constant.ts
β β β βββ auth.controller.ts
β β β βββ auth.interface.ts
β β β βββ auth.route.ts
β β β βββ auth.service.ts
β β β βββ emailSender.ts
β β β
β β βββ event/ # Event management
β β β βββ event.constants.ts
β β β βββ event.controller.ts
β β β βββ event.interface.ts
β β β βββ event.routes.ts
β β β βββ event.service.ts
β β β βββ event.validation.ts
β β β
β β βββ invite/ # Invitation system
β β β βββ invite.controller.ts
β β β βββ invite.interface.ts
β β β βββ invite.route.ts
β β β βββ invite.service.ts
β β β
β β βββ meta/ # System metadata & analytics
β β β βββ meta.controller.ts
β β β βββ meta.route.ts
β β β βββ meta.service.ts
β β β βββ meta.utils.ts
β β β
β β βββ participant/ # Participant management
β β β βββ participant.constants.ts
β β β βββ participant.controller.ts
β β β βββ participant.inteface.ts
β β β βββ participant.route.ts
β β β βββ participant.service.ts
β β β
β β βββ payment/ # Payment processing
β β β βββ payment.constants.ts
β β β βββ payment.controller.ts
β β β βββ payment.interface.ts
β β β βββ payment.route.ts
β β β βββ payment.service.ts
β β β βββ payment.utils.ts
β β β
β β βββ profile/ # User profile management
β β β βββ profile.constraint.ts
β β β βββ profile.controller.ts
β β β βββ profile.interface.ts
β β β βββ profile.routes.ts
β β β βββ profile.services.ts
β β β βββ profile.validation.ts
β β β
β β βββ review/ # Review system
β β β βββ review.controller.ts
β β β βββ review.interface.ts
β β β βββ review.router.ts
β β β βββ review.service.ts
β β β
β β βββ sslcommerz/ # Payment gateway integration
β β β βββ sslcommerz.controller.ts
β β β βββ sslcommerz.route.ts
β β β βββ sslcommerz.service.ts
β β β
β β βββ user/ # User management
β β βββ user.constants.ts
β β βββ user.controller.ts
β β βββ user.interface.ts
β β βββ user.routes.ts
β β βββ user.service.ts
β β βββ user.validation.ts
β β
β βββ routes/ # Route definitions
β β βββ index.ts
β β
β βββ shared/ # Shared utilities
β β βββ prisma.ts
β β
β βββ templates/ # Email/PDF templates
β β βββ invoice.template.hbs
β β
β βββ types/ # Additional type definitions
β βββ profile.types.ts
β βββ sslcommerz-lts.d.ts
- Node.js - JavaScript runtime environment
- Express.js - Fast, unopinionated web framework
- TypeScript - Type safety and enhanced developer experience
- Prisma - Next-generation ORM with type safety
- PostgreSQL - Advanced relational database
- JWT - JSON Web Token for secure authentication
- bcrypt - Password hashing and security
- Zod - TypeScript-first schema validation
- Helmet - Security middleware for Express
- SSLCommerz - Secure payment gateway
- Nodemailer - Email sending capabilities
- Handlebars - Template engine for emails/invoices
- Puppeteer - PDF generation for invoices
- Railway/Render - Backend hosting
- Cloudinary - Image and file management
- Cors - Cross-origin resource sharing
- User Registration - Secure account creation with email verification
- Login/Logout - JWT-based session management
- Password Management - Secure password reset and change functionality
- Email Verification - Account activation via email confirmation
- Role-Based Access - Admin and user role management
- CRUD Operations - Complete event lifecycle management
- Event Types - Support for Public/Private and Free/Paid events
- File Upload - Event image and document management
- Search & Filter - Advanced event discovery capabilities
- Capacity Management - Event size limitations and waitlist handling
- Join Requests - Sophisticated approval workflow APIs
- Invitation System - Direct user invitation with payment integration
- Ban Management - Host controls for participant management
- Status Tracking - Real-time participant status updates
- SSLCommerz Integration - Secure payment gateway connection
- Transaction Management - Complete payment lifecycle tracking
- Invoice Generation - Automated PDF invoice creation
- Webhook Handling - Real-time payment status updates
- Refund Processing - Automated refund management
- System Metrics - Comprehensive application analytics
- User Statistics - User engagement and activity tracking
- Event Analytics - Event performance and participation data
- Payment Reports - Financial transaction reporting
- Email Services - Automated email notifications
- Payment Confirmations - Transaction success/failure notifications
- Event Updates - Participant communication system
- System Alerts - Administrative notification system
All API responses follow a consistent format:
{
success: boolean;
statusCode: number;
message: string;
meta?: {
page: number;
limit: number;
total: number;
};
data: any;
}- MVC Pattern - Model-View-Controller separation
- Service Layer - Business logic encapsulation
- Repository Pattern - Data access abstraction
- Middleware Pattern - Request/response processing pipeline
- TypeScript - Full type safety throughout the application
- ESLint & Prettier - Code formatting and linting
- Error Boundaries - Comprehensive error handling
- Input Validation - Zod schema validation for all inputs
- Email: sumonray146371@gmail.com
- Portfolio: https://sumon-ray.vercel.app/
- LinkedIn: https://www.linkedin.com/in/sumon60/
- Node.js 18+
- PostgreSQL database
- SSLCommerz merchant credentials
- Email service credentials (Gmail/SendGrid)
- Clone the repository
git clone https://github.com/sumon-ray/Next-Event-Server.git
cd Next-Event-Server- Install dependencies
npm install- Configure environment variables
cp .env.example .envAdd the following environment variables:
# Database
DATABASE_URL="postgresql://username:password@localhost:5432/nextevent"
# JWT
JWT_SECRET="your-jwt-secret"
JWT_EXPIRES_IN="7d"
# SSLCommerz
STORE_ID="your-store-id"
STORE_PASSWD="your-store-password"
SSL_PAYMENT_API="https://sandbox.sslcommerz.com/gwprocess/v4/api.php"
SSL_VALIDATION_API="https://sandbox.sslcommerz.com/validator/api/validationserverAPI.php"
# Email
EMAIL_USER="your-email@gmail.com"
EMAIL_PASS="your-app-password"
# File Upload
CLOUDINARY_CLOUD_NAME="your-cloudinary-name"
CLOUDINARY_API_KEY="your-cloudinary-key"
CLOUDINARY_API_SECRET="your-cloudinary-secret"
# Frontend URL
CLIENT_URL="http://localhost:3000"- Setup the database
npx prisma migrate dev
npx prisma generate
npx prisma db seed- Start the development server
npm run devThe server will start on http://localhost:5000
{
"admin": {
"email": "admin@nextevent.com",
"password": "admin123"
},
"user": {
"email": "user@nextevent.com",
"password": "user123"
}
}npm run dev # Start development server
npm run build # Build for production
npm run start # Start production server
npm run lint # Run ESLint
npm run format # Format code with Prettier
npm run migrate # Run database migrations
npm run generate # Generate Prisma client
npm run seed # Seed database with test data- Database Indexing - Optimized queries with proper indexing
- Connection Pooling - Efficient database connection management
- Caching Strategy - Redis caching for frequently accessed data
- Query Optimization - Prisma query optimization techniques
- Error Handling - Comprehensive error management system
- JWT Authentication - Secure token-based authentication
- Password Hashing - bcrypt for secure password storage
- Input Validation - Zod schema validation for all inputs
- SQL Injection Prevention - Prisma ORM protection
- XSS Protection - Helmet.js security middleware
- CORS Configuration - Proper cross-origin resource sharing
- Rate Limiting - API abuse prevention middleware
POST /api/auth/register- User registrationPOST /api/auth/login- User loginPOST /api/auth/forgot-password- Password reset requestPOST /api/auth/reset-password- Password reset confirmation
GET /api/event- Get all events (with filters)POST /api/event- Create new eventGET /api/event/:id- Get event detailsPUT /api/event/:id- Update eventDELETE /api/event/:id- Delete event
POST /api/payment/init- Initialize paymentPOST /api/payment/success- Payment success callbackPOST /api/payment/fail- Payment failure callbackGET /api/payment/history- Payment history
POST /api/participant/join- Join event requestPUT /api/participant/approve/:id- Approve participantDELETE /api/participant/remove/:id- Remove participant
This project demonstrates advanced backend development practices and is available for portfolio review and professional evaluation.
This project is created for portfolio purposes and professional demonstration.
- Express.js Team - For the robust web framework
- Prisma Team - For the excellent ORM and database toolkit
- SSLCommerz - For secure payment processing capabilities
- Railway/Render - For reliable backend hosting solutions
- TypeScript Team - For enhanced development experience
Created with β€οΈ by Sumon Ray
This backend demonstrates production-ready API development, secure payment integration, and scalable architecture patterns for modern web applications.