Skip to content

Latest commit

 

History

History
105 lines (77 loc) · 3.38 KB

File metadata and controls

105 lines (77 loc) · 3.38 KB

🚀 Hackathon Backend

A scalable backend API for hackathon management, built with NestJS. Features user authentication, hackathon CRUD, project submissions, and asynchronous processing.

Table of Contents

📖 Introduction

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.

🛠️ Tech Stack

  • 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.

✨ Features

  • 🔐 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

🚀 Quick Start

Prerequisites

  • Node.js (v18 or higher)
  • npm or yarn
  • PostgreSQL database
  • Redis instance

Installation

  1. 📥 Clone the repository:

    git clone https://github.com/JavaScript-Mastery-Pro/Hackathon-backend.git
    cd hackathon-backend
  2. 📦 Install dependencies:

    npm install
  3. 🗄️ Set up the database:

    npm run db:migrate
  4. 🔧 Generate Prisma client:

    npm run db:generate
  5. ▶️ Start the development server:

    npm run start:dev

The API will be available at http://localhost:8080.

🔧 Environment Variables

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-key

Notes

  • AUTH_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.