A scalable backend API for hackathon management, built with NestJS. Features user authentication, hackathon CRUD, project submissions, and asynchronous processing.
Hackathon Backend is a scalable API built with NestJS for managing hackathons. It offers user authentication, hackathon CRUD operations, project submissions with file uploads, asynchronous processing, and email notifications, all secured with modern technologies.
- NestJS - A progressive Node.js framework for building efficient, reliable and scalable server-side applications.
- Prisma - Next-generation ORM for TypeScript & Node.js.
- PostgreSQL - Advanced open source relational database.
- Better Auth - Complete open-source authentication solution.
- BullMQ - Premium message queue for Node.js based on Redis.
- Arcjet - Security layer for your applications.
- Nodemailer - Send emails from Node.js.
- 🔐 Authentication (
/api/auth): User registration, login, and role-based access control - 🏆 Hackathon Management (
/hackathon): CRUD operations for hackathons and participant registration - 📁 Project Submissions (
/submission): File upload support with asynchronous processing via BullMQ - 📧 Email Notifications: Automated emails for hackathon events and submissions
- 🛡️ Security: Arcjet integration for threat protection and rate limiting
- Node.js (v18 or higher)
- npm or yarn
- PostgreSQL database
- Redis instance
-
📥 Clone the repository:
git clone https://github.com/JavaScript-Mastery-Pro/Hackathon-backend.git cd hackathon-backend -
📦 Install dependencies:
npm install
-
🗄️ Set up the database:
npm run db:migrate
-
🔧 Generate Prisma client:
npm run db:generate
-
▶️ Start the development server:npm run start:dev
The API will be available at http://localhost:8080.
Create a .env file in the root directory and configure the following variables:
PORT=8080
BACKEND_URL="http://localhost:8080"
FRONTEND_URL="http://localhost:3000"
AUTH_SECRET="your-auth-secret-here"
DATABASE_URL="your-postgresql-database-url"
REDIS_URL="your-redis-url"
SMTP_HOST="smtp.gmail.com"
SMTP_PORT=587
SMTP_USERNAME="your-email@gmail.com"
SMTP_PASSWORD="your-app-password"
ARCJET_ENV=development
ARCJET_KEY=your-arcjet-keyAUTH_SECRET: Generate a secure random string for authentication.DATABASE_URL: Use your PostgreSQL connection string.REDIS_URL: Connection string for your Redis instance.SMTP_*: Configure your email service (e.g., Gmail SMTP).ARCJET_*: Obtain keys from Arcjet dashboard.