Schedula Server is a high-performance backend service designed to power modern event management systems. Built with TypeScript and Node.js, it excels at generating and managing secure QR codes for event access control, while providing robust health monitoring and comprehensive logging capabilities.
- Security First: Built with industry-standard security practices using Helmet and CORS protection
- Modern Stack: Leverages TypeScript for type safety and modern ES6+ features
- Cloud Ready: Seamless integration with Supabase for secure and scalable storage
- Developer Friendly: Comprehensive test coverage and detailed documentation
- Production Grade: Built-in health monitoring, error handling, and logging
- Enterprise Ready: Follows best practices for scalability and maintenance
This server is an integral part of the Schedula ecosystem, designed to handle event management needs at scale, from small meetups to large conferences.
- QR Code Generation & Management: Create and store QR codes for event access
- Automated Health Checks: Scheduled cron jobs for system health monitoring
- Secure Storage: Integration with Supabase for secure file storage
- Type Safety: Built with TypeScript for increased reliability
- Test Coverage: Comprehensive test suite with 80%+ coverage
- API Validation: Request/response validation
- Error Handling: Comprehensive error handling and logging
- Node.js (v14 or higher)
- npm
- A Supabase account and project
- Clone the repository
- Install dependencies:
npm install
- Create a
.env
file in the root directory (see Configuration section) - Start the server:
npm run dev # for development npm start # for production
Create a .env
file with the following variables:
NODE_ENV=development
PORT=3000
# Supabase Configuration
SUPABASE_URL=your_supabase_url
SUPABASE_ANON_KEY=your_supabase_anon_key
SUPABASE_STORAGE_BUCKET_QR=your_qr_bucket
# Health Check
API_URL=http://localhost:3000/health
HEALTH_CHECK_SCHEDULE="*/14 * * * *"
The server can be configured through environment variables:
Variable | Description | Default |
---|---|---|
PORT |
Port for the server | 3000 |
NODE_ENV |
Environment mode | development |
SUPABASE_URL |
Supabase instance URL | (required) |
SUPABASE_ANON_KEY |
Supabase anonymous key | (required) |
SUPABASE_STORAGE_BUCKET_QR |
Bucket name for QR codes | (required) |
API_URL |
URL for API health checks | http://localhost:3000/health |
HEALTH_CHECK_SCHEDULE |
Cron schedule for health checks | */14 * * * * |
POST /api/qr/generate
Request Body:
{
"qrId": "string",
"qrCode": "string",
"userId": "string"
}
Response:
{
"status": "success",
"data": {
"url": "string"
}
}
- Runs only in development mode
- Configured through HEALTH_CHECK_SCHEDULE in cron format
- Monitors API health at configured intervals
- Colored console output in development
- File-based logging with daily rotation
- Separate error logs
- JSON formatting for production
npm start
- Start the server in production modenpm run dev
- Start the server in development mode with hot reloadnpm run build
- Build the TypeScript codenpm run lint
- Run ESLintnpm run format
- Format code with Prettier
- Express - Web framework
- Supabase - Backend storage
- QRCode - QR code generation
- Cron - Task scheduling
- Joi - Request validation
- TypeScript - Type safety
- ESLint - Code linting
- Prettier - Code formatting
- Jest - Testing framework
- Husky - Manage Git hooks
- Docker - Containerization
- Code Standards: Coding standards and practices
- Contributing Guide: How to contribute to the project
- File Structure: Detailed project structure documentation
This project is licensed under the MIT License - see the LICENSE file for details.