Skip to content

Mohini1693/hash

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

29 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Hash 2K25 - National Hackathon Platform

A comprehensive full-stack web application for managing national hackathons with Google OAuth authentication, team management, project submissions, and administrative controls.

πŸš€ Features

For Team Leaders

  • Google OAuth Authentication - Secure login with Google accounts
  • Team Creation - Create teams with 2-4 members
  • Member Management - Add team member details (name, email, phone)
  • Project Submission - Submit project details with themes, ideology, and methodology
  • Submission Tracking - Real-time status updates for project submissions

For Team Members

  • Google OAuth Login - Must match email added by team leader
  • Team Dashboard - Collaborative workspace with team information
  • Submission Status - View project submission status and details

For Administrators

  • Team Management - View all teams and member details
  • Submission Management - Review and update project status (Selected/Rejected/Waiting)
  • CSV Export - Download all teams and submissions data
  • Bulk Email System - Send emails to selected groups (all teams, selected teams, etc.)
  • Statistics Dashboard - Overview of participation and submission metrics

πŸ›  Technology Stack

  • Frontend: Next.js 14 with App Router, React, TailwindCSS
  • Backend: Next.js API Routes
  • Database: NeonDB (PostgreSQL) with Prisma ORM
  • Authentication: NextAuth.js with Google OAuth
  • Email: Nodemailer for bulk email functionality
  • Styling: TailwindCSS with custom components
  • Icons: Lucide React

πŸ“¦ Installation & Setup

Prerequisites

  • Node.js 18+
  • npm or yarn
  • NeonDB account
  • Google OAuth credentials
  • SMTP email service (Gmail recommended)

1. Clone and Install

```bash git clone cd hash 2k25 npm install ```

2. Environment Variables

Create a `.env` file in the root directory:

```env

Database

DATABASE_URL="postgresql://username:[email protected]/neondb?sslmode=require"

NextAuth.js Configuration

NEXTAUTH_URL="http://localhost:3000" NEXTAUTH_SECRET="your-nextauth-secret-key-here"

Google OAuth

GOOGLE_CLIENT_ID="your-google-client-id" GOOGLE_CLIENT_SECRET="your-google-client-secret"

Email Configuration (Nodemailer)

SMTP_HOST="smtp.gmail.com" SMTP_PORT=587 SMTP_USER="[email protected]" SMTP_PASS="your-app-password" FROM_EMAIL="hash [email protected]"

Admin Configuration

ADMIN_EMAILS="[email protected],[email protected]"

Application Configuration

APP_NAME="Hash 2K25 Hackathon" APP_URL="http://localhost:3000" ```

3. Database Setup

Set up NeonDB:

  1. Create a NeonDB account at neon.tech
  2. Create a new database
  3. Copy the connection string to `DATABASE_URL`

Run database migrations:

```bash npx prisma generate npx prisma migrate dev --name init ```

4. Google OAuth Setup

  1. Go to Google Cloud Console
  2. Create a new project or select existing
  3. Enable Google+ API
  4. Create OAuth 2.0 credentials
  5. Add authorized redirect URIs:

5. Email Setup (Gmail)

  1. Enable 2-factor authentication on your Gmail account
  2. Generate an app password
  3. Use the app password in `SMTP_PASS`

6. Run the Application

```bash npm run dev ```

Visit `http://localhost:3000\` to see the application.

πŸ“ Project Structure

``` src/ β”œβ”€β”€ app/ β”‚ β”œβ”€β”€ api/ # API routes β”‚ β”‚ β”œβ”€β”€ auth/ # NextAuth.js β”‚ β”‚ β”œβ”€β”€ teams/ # Team management β”‚ β”‚ β”œβ”€β”€ submissions/ # Project submissions β”‚ β”‚ └── admin/ # Admin functions β”‚ β”œβ”€β”€ dashboard/ # Team dashboard β”‚ β”œβ”€β”€ admin/ # Admin panel β”‚ └── globals.css # Global styles β”œβ”€β”€ components/ β”‚ β”œβ”€β”€ ui/ # Reusable UI components β”‚ β”œβ”€β”€ dashboard/ # Dashboard components β”‚ β”œβ”€β”€ admin/ # Admin components β”‚ └── ... # Landing page components β”œβ”€β”€ lib/ β”‚ β”œβ”€β”€ auth.ts # NextAuth configuration β”‚ β”œβ”€β”€ db.ts # Database connection β”‚ β”œβ”€β”€ email.ts # Email service β”‚ └── utils.ts # Utility functions β”œβ”€β”€ types/ β”‚ └── next-auth.d.ts # TypeScript definitions └── prisma/ └── schema.prisma # Database schema ```

🎯 Key Features Implemented

Authentication & Authorization

  • βœ… Google OAuth integration with NextAuth.js
  • βœ… Role-based access control (Admin, Leader, Member)
  • βœ… Protected routes and API endpoints
  • βœ… Session management

Team Management

  • βœ… Team creation with validation
  • βœ… Member email verification system
  • βœ… Team information display
  • βœ… Member status tracking

Project Submissions

  • βœ… Comprehensive submission form
  • βœ… 16 different project themes
  • βœ… Project type selection (Software/Hardware/Both)
  • βœ… Guide information collection
  • βœ… Status tracking (Waiting/Selected/Rejected)

Admin Panel

  • βœ… Statistics dashboard
  • βœ… Team and submission management
  • βœ… Status update functionality
  • βœ… CSV export for teams and submissions
  • βœ… Bulk email system with group targeting

Email System

  • βœ… Automated welcome emails
  • βœ… Submission confirmation emails
  • βœ… Status update notifications
  • βœ… Bulk email with group filtering
  • βœ… Email templates

🎨 UI/UX Features

  • Responsive Design - Works on all devices
  • Modern Interface - Clean, professional design
  • Interactive Components - Smooth animations and transitions
  • Accessible - WCAG compliant design patterns
  • Real-time Updates - Live status updates and notifications

πŸ”’ Security Features

  • OAuth Authentication - Secure Google login
  • Protected API Routes - Server-side authentication checks
  • Role-based Access - Granular permission system
  • Input Validation - Client and server-side validation
  • SQL Injection Protection - Prisma ORM with parameterized queries

πŸ“Š Database Schema

The application uses a comprehensive PostgreSQL schema with:

  • Users - Authentication and role management
  • Teams - Team information and relationships
  • TeamMembers - Member details and contact info
  • ProjectSubmissions - Complete project details
  • AdminEmails - Admin user management

πŸš€ Deployment

Production Environment Variables

Update your `.env` file for production:

  • Change `NEXTAUTH_URL` to your domain
  • Use production database URL
  • Update OAuth redirect URIs
  • Configure production SMTP settings

Deploy to Vercel

```bash npm run build npx vercel --prod ```

πŸ“ Usage Guide

For Organizers

  1. Setup Admin Accounts: Add admin emails to `ADMIN_EMAILS`
  2. Configure Email Templates: Customize email content in `src/lib/email.ts`
  3. Set Registration Dates: Update timeline in landing page
  4. Monitor Submissions: Use admin panel for real-time tracking

For Participants

  1. Registration: Sign in with Google account
  2. Team Creation: Leaders create teams and add members
  3. Project Submission: Submit detailed project information
  4. Status Tracking: Monitor submission status in dashboard

🀝 Contributing

  1. Fork the repository
  2. Create your feature branch (`git checkout -b feature/AmazingFeature`)
  3. Commit your changes (`git commit -m 'Add some AmazingFeature'`)
  4. Push to the branch (`git push origin feature/AmazingFeature`)
  5. Open a Pull Request

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ†˜ Support

For support and questions:

  • Create an issue in the repository
  • Contact the development team
  • Check the documentation

Built with ❀️ for Hash 2K25 National Hackathon

About

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •