A comprehensive backend system for managing events, vendors, registrations, and sales. The system supports multiple user roles and portal-specific access control.
- Multi-portal authentication system (Admin, Vendor, Organizer, Attendee)
- Role-based access control
- Session management with Redis
- Secure token-based authentication
- Admin-controlled user management
- Comprehensive event creation and management
- Multi-day event support with sessions
- Registration system with waitlist functionality
- QR code generation for tickets
- Event feedback and ratings
- Booth application and approval system
- Product management
- Real-time sales tracking
- Sales analytics and reporting
- Vendor ratings and reviews
- System-wide analytics
- User management and role control
- Vendor application processing
- Event monitoring
- System health tracking
Key Tables:
- users (role-based access control)
- events (event management)
- event_sessions (multi-day events)
- registrations (with waitlist)
- vendor_booths
- vendor_products
- sales_transactions
- feedback and ratings
Portal | Allowed Roles |
---|---|
Admin | admin |
Vendor | vendor |
Organizer | organizer |
Attendee | attendee, organizer, admin |
- Node.js >= 14
- Redis server
- SQLite3
- Clone the repository:
git clone https://github.com/yourusername/event-management-system.git
cd event-management-system
- Install dependencies:
cd backend
npm install
- Set up environment variables:
cp .env.example .env
# Edit .env with your configuration
- Initialize the database:
sqlite3 database.db < src/db/schema.sql
- Start Redis server:
brew services start redis
- Start the server:
npm run dev
POST /api/auth/register
Content-Type: application/json
{
"name": "John Doe",
"email": "john@example.com",
"password": "securepass"
}
POST /api/auth/login
Content-Type: application/json
{
"email": "user@example.com",
"password": "password",
"portal": "vendor" // admin, vendor, organizer, or attendee
}
POST /api/auth/users
Authorization: Bearer <token>
Content-Type: application/json
{
"name": "Vendor Name",
"email": "vendor@company.com",
"role": "vendor",
"company": "Company Name"
}
PUT /api/auth/users/:id
Authorization: Bearer <token>
Content-Type: application/json
{
"role": "vendor",
"status": "active"
}
POST /api/events
Authorization: Bearer <token>
Content-Type: application/json
{
"title": "Tech Conference 2024",
"description": "Annual tech conference",
"date": "2024-06-15",
"location": "Convention Center",
"capacity": 500
}
POST /api/vendors/booths
Authorization: Bearer <token>
Content-Type: application/json
{
"eventId": "event-uuid",
"boothNumber": "A1",
"description": "Tech gadgets booth"
}
- JWT token authentication
- Redis session management
- Role-based access control
- Input validation with Zod
- Request rate limiting
- Secure password hashing
- XSS protection
- SQL injection prevention
backend/
βββ src/
β βββ db/
β β βββ schema.sql
β βββ middleware/
β β βββ auth.js
β βββ routes/
β β βββ admin.js
β β βββ auth.js
β β βββ events.js
β β βββ users.js
β β βββ vendors.js
β βββ index.js
βββ package.json
βββ README.md
npm test
PORT=3000
JWT_SECRET=your-secret-key
REDIS_URL=redis://localhost:6379
NODE_ENV=development
The system includes built-in monitoring endpoints:
/health
- System health check/api/admin/system-health
- Detailed system status (Admin only)/api/admin/analytics
- System-wide analytics (Admin only)
The system implements comprehensive error handling:
- Validation errors
- Authentication errors
- Authorization errors
- Business logic errors
- System errors
- Email notification system
- Payment gateway integration
- OAuth support
- Advanced analytics
- Mobile app integration
- Real-time event updates
- Automated waitlist management
This project is licensed under the MIT License - see the LICENSE file for details.
- Fork the repository
- Create your feature branch
- Commit your changes
- Push to the branch
- Create a new Pull Request