Welcome to GUNotes! This is a modern, full-stack web application designed to help students and educators share and discover high-quality study materials. The platform is built with a focus on scalability, security, and a rich user experience.
- Note Management: Users can upload, view, and manage their study notes.
- Dynamic Content: The system supports user-generated courses, professors, and semesters, allowing the academic data to grow organically.
- Review System: A complete 5-star rating and review system allows users to provide feedback on notes.
- Role-Based Access Control: A robust security model ensures that only authorized users can access sensitive areas.
- Students: Can upload and manage their own notes.
- Tutors, Professors, Admins: Can explore all notes on the platform.
- Admins: Have access to a full administrative dashboard.
- Admin Dashboard: A dedicated section for administrators to manage user roles and the raffle system.
- Raffle System: A complete, end-to-end raffle system where admins can create raffles, upload prize images, and automatically draw winners.
- Framework: Next.js (with Turbopack)
- Styling: Tailwind CSS + Shadcn UI
- Database: PostgreSQL managed with Prisma ORM
- Authentication: Auth0
- File Storage: Supabase Storage
git clone <your-repo-url> gunotes
cd gunotesnpm installCreate a .env file in the root of the project and add the following variables.
# Auth0 Credentials
AUTH0_SECRET='...'
AUTH0_BASE_URL='http://localhost:3000'
AUTH0_ISSUER_BASE_URL='...'
AUTH0_CLIENT_ID='...'
AUTH0_CLIENT_SECRET='...'
# Database Connection (Your Supabase Postgres URL)
DATABASE_URL="postgresql://..."
# Supabase Storage Credentials
SUPABASE_PROJECT_URL="https://<your-project-ref>.supabase.co"
NEXT_PUBLIC_SUPABASE_ANON_KEY="..."
SUPABASE_SERVICE_ROLE_KEY="..." # IMPORTANT: Use the secret service_role key
# Optional for Admin User Search (if implemented)
# AUTH0_MANAGEMENT_DOMAIN="..."
# AUTH0_MANAGEMENT_CLIENT_ID="..."
# AUTH0_MANAGEMENT_CLIENT_SECRET="..."This command will apply all existing migrations to your database, creating the necessary tables.
npx prisma migrate devTo populate your database with realistic sample data (users, notes, an active raffle, etc.), run the following command:
npx prisma db seednpm run devThe application will be available at http://localhost:3000.
gunotes
├─ /prisma/ # Prisma schema, migrations, and seed script
├─ /public/ # Static assets (images, logos)
├─ /src/
│ ├─ /app/ # Next.js App Router
│ │ ├─ /api/ # All backend API routes
│ │ ├─ /admin/ # Admin dashboard pages
│ │ └─ ... # Other application pages
│ ├─ /components/ # Shared React components
│ └─ /lib/ # Helper libraries (Prisma client, Supabase client)
├─ .env # Environment variables (ignored by Git)
├─ package.json # Project dependencies and scripts
└─ README.md # This file