Mint is a modern, full-featured platform for conducting programming contests, managing coding problems, and building developer communities.
- ๐ Host and manage programming contests
- ๐ Organize and share coding problems
- ๐ฅ Multi-organization support
- ๐ Real-time monitoring and analytics (Prometheus)
- ๐ Secure authentication and user management
- ๐ Interactive API documentation (Swagger)
- โก Fast, modern stack (Next.js, Bun, Drizzle, Tailwind CSS)
- Node.js 22.2.0+
- Docker
- Bun (recommended)
# 1. Clone the repository bun install # 2. Copy environment variables cp .env.example .env # 3. Start the database bun pg # 4. Run migrations and seed data bun db:migrate bun db:superuser # Create an admin user bun db:seed # (Optional) Add test data # 5. Start the development server bun dev
Visit http://localhost:3000 to see the app.
mint/
โโโ app/ # Next.js app router pages
โ โโโ api-doc/ # Swagger API documentation
โ โโโ api/ # API routes
โโโ components/ # React components
โโโ db/ # Database schema and migrations
โโโ lib/ # Utility functions and shared logic
โโโ middleware/ # Request middleware (logging, metrics, error handling)
โโโ public/ # Static assets
โโโ scripts/ # CLI scripts for development
bun dev # Start development server bun build # Build for production bun start # Start production server bun lint # Run ESLint bun format # Format code with Prettier bun format:check # Check code formatting # Database bun pg # Start PostgreSQL container bun pg:stop # Stop and remove PostgreSQL container bun pg-admin # Start pgAdmin web interface bun pg-admin:stop # Stop and remove pgAdmin container bun db:migrate # Generate and apply database migrations bun db:seed # Add test data to database bun db:clear # Clear all data from database bun db:superuser # Create an admin user interactively
Seeding creates:
- 2 Admin users
- 3 Organizer users
- 5 Regular users
- 3 Organizations
- 2 Problems, 2 Contests, 2 Groups per organization
All test users: password123
- Built-in Prometheus metrics: HTTP requests, user counts, DB query durations
- Metrics endpoint: http://localhost:3000/api/metrics
Prometheus config:
scrape_configs: - job_name: 'mint' static_configs: - targets: ['localhost:3000'] metrics_path: '/api/metrics'
- Reset containers:
docker stop mint-postgres mint-pgadmin docker rm mint-postgres mint-pgadmin
- Check ports:
sudo lsof -i :5432 # PostgreSQL sudo lsof -i :5050 # pgAdmin
- Full reset:
bun pg:stop && bun pg-admin:stop && bun pg && bun pg-admin && bun db:clear && bun db:migrate && bun db:seed
Note: You can use
npm runinstead ofbunif preferred.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Interactive docs at
/api-doc(dev server) - Request/response examples
- API endpoint testing interface
Add docs to API routes:
/** * @swagger * /api/your-endpoint: * get: * summary: Endpoint description * responses: * 200: * description: Success response */
Copy .env.example to .env and fill in:
DATABASE_URL=postgres://postgres:postgres@localhost:5432/mint # Email Configuration SMTP_HOST=smtp.example.com SMTP_PORT=587 SMTP_SECURE=false SMTP_USER=[email protected] SMTP_PASSWORD=your-smtp-password SMTP_FROM_NAME=Mint Platform SMTP_FROM_EMAIL=[email protected]
Gmail setup:
- Enable 2FA
- Generate an app password
- Use as
SMTP_PASSWORD
SMTP_HOST=smtp.gmail.com SMTP_PORT=587 SMTP_SECURE=false SMTP_USER=[email protected] SMTP_PASSWORD=your-app-specific-password