A modern, feature-rich application management system for hackathon organizers and participants. This system handles the entire application lifecycle from initial draft to final acceptance and confirmation.
- Real-time Form Saving: Applications are automatically saved as users type
- Status Tracking: View application status (not started, in progress, submitted, accepted, rejected, confirmed)
- Detailed Logging: Comprehensive debug logs for easy troubleshooting
- User Authentication: Secure user authentication via Clerk
- Responsive Design: Works on all device sizes and types
- Node.js (v16+)
- PostgreSQL database
- Clerk.dev account for authentication
-
Clone the repository:
git clone https://github.com/enkhbold470/hackathon-dashboard.git cd hackathon-dashboard
-
Install dependencies:
pnpm install
-
Set up environment variables in
.env.local
:# Database connection DATABASE_URL=postgres://username:password@localhost:5432/hackathon_db # Clerk Auth NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=your_clerk_publishable_key CLERK_SECRET_KEY=your_clerk_secret_key
-
Run database migrations:
pnpm db:migrate
-
Start the development server:
pnpm dev
This application has built-in comprehensive debug logging to help troubleshoot issues:
All logs follow a consistent format with context prefixes:
[Middleware]
- Request tracking and auth checks[API GET/POST]
- API endpoint operations[ApplicationDashboard]
- Main dashboard component[ApplicationForm]
- Form component operations
Authentication-related logs:
[Middleware] Request: GET /api/db/get-application
[Middleware] Authenticated user: user_2x...
[API GET] Authorized user: user_2x...
Look for these logs when troubleshooting application saving:
[ApplicationDashboard] Form data changed: {"legalName":"John Doe"}
[ApplicationDashboard] Saving application draft to database
[API POST] Saving application for user user_2x...
[API POST] Application saved successfully for user user_2x, id: 123
When applications aren't submitting properly:
[ApplicationDashboard] Starting application submission process
[API POST] Submitting application for user user_2x...
[API POST] Application submitted successfully for user user_2x, id: 123
application-dashboard.tsx
: Main dashboard with tabs for application and statusapplication-form.tsx
: Form handling with validation and autosaveapplication-status.tsx
: Status display with animations and progress trackingapp/db/[action]/route.ts
: API routes for database operationsmiddleware.ts
: Authentication and request logging
The application uses a PostgreSQL database with a primary applications
table:
Column | Type | Description |
---|---|---|
id | SERIAL | Primary key |
user_id | TEXT | Clerk Auth user ID (unique) |
legal_name | VARCHAR(255) | Applicant's name |
VARCHAR(255) | Email address | |
university | VARCHAR(255) | University/school |
... other fields ... | ||
status | VARCHAR(50) | Application status |
created_at | TIMESTAMPTZ | Creation timestamp |
updated_at | TIMESTAMPTZ | Last update timestamp |
etc |
MIT