A comprehensive consultancy management system built with Node.js and Express, featuring user authentication, booking management, payment processing, and real-time communication.
- User Management: Authentication and authorization with JWT
- Booking System: Complete booking lifecycle management
- Payment Integration: Stripe payment processing with webhooks
- Real-time Communication: Socket.io for live updates
- File Management: Secure file upload and storage
- Admin Panel: Administrative interface for system management
- Email Notifications: Automated email communications
- Database Integration: MongoDB with Mongoose ODM
- Scheduled Tasks: Cron jobs for automated processes
- Node.js - Runtime environment
- Express.js - Web framework
- MongoDB - Database
- Mongoose - ODM for MongoDB
- Socket.io - Real-time communication
- JWT - Authentication tokens
- bcryptjs - Password hashing
- Stripe - Payment processing
- Nodemailer - Email sending
- Firebase Admin - Push notifications
- Nodemon - Development auto-restart
- Morgan - HTTP request logger
- dotenv - Environment variable management
- Multer - File upload handling
- node-cron - Scheduled tasks
- moment-timezone - Date/time handling
- CORS - Cross-origin resource sharing
- Cookie-parser - Cookie handling
- EJS - Template engine
ConsultancySystem/
├── src/
│ ├── configs/ # Configuration files
│ ├── controllers/ # Route controllers
│ ├── cron/ # Scheduled tasks
│ ├── helpers/ # Utility functions
│ ├── middlewares/ # Custom middlewares
│ ├── models/ # Database models
│ ├── routes/ # API routes
│ ├── seeders/ # Database seeders
│ └── utils/ # General utilities
├── content/ # Static content
├── uploads/ # File uploads
├── views/ # EJS templates
├── app.js # Main application entry
├── package.json # Dependencies and scripts
└── .env # Environment variables
- Node.js (v14 or higher)
- MongoDB
- npm or yarn
- Clone the repository
git clone <repository-url>
cd ConsultancySystem- Install dependencies
npm install- Set up environment variables
Create a
.envfile with the following variables:
PORT=3000
APP_NAME=lynx-backend
DB_CONNECTION_STRING=mongodb://localhost:27017/lynx-consultancy
JWT_SECRET=your-jwt-secret
STRIPE_SECRET_KEY=your-stripe-secret
STRIPE_WEBHOOK_SECRET=your-webhook-secret
EMAIL_HOST=your-email-host
EMAIL_USER=your-email
EMAIL_PASS=your-email-password
FIREBASE_PROJECT_ID=your-firebase-project-id
- Start the server
# Development
npm run server:dev
# Production
npm run serverThe API follows RESTful conventions and is available at:
http://localhost:3000/lynx-backend/v1/api/
All protected routes require JWT authentication in the Authorization header:
Authorization: Bearer <your-jwt-token>
npm run server- Start production servernpm run server:dev- Start development server with auto-restart
- JWT-based authentication
- Password hashing with bcryptjs
- CORS protection
- Input validation and sanitization
- Secure file upload handling
- Environment variable protection
Integrated with Stripe for secure payment processing:
- One-time payments
- Subscription management
- Webhook handling for payment events
- Secure checkout process
- Automated email notifications
- Firebase push notifications
- Booking confirmations and reminders
- Payment receipts
Uses MongoDB with the following main collections:
- Users (authentication and profiles)
- Bookings (appointment management)
- Payments (transaction records)
- Services (consultancy services)
Socket.io integration for:
- Live booking updates
- Real-time notifications
- Admin dashboard updates
- Chat functionality
Automated processes using node-cron:
- Booking status updates
- Reminder notifications
- Data cleanup tasks
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request
This project is licensed under the MIT License.
For support and inquiries, please contact the development team.
Note: This is the backend API for the Lynx Consultancy System. Make sure to configure all environment variables before running the application.