Hackathon project for an educational platform with age-appropriate content.
✅ Setup & Foundation
- Next.js 15 with TypeScript
- Tailwind CSS + Shadcn UI components
- MongoDB Atlas integration
- Clerk Authentication
- Environment variables configuration
✅ Core Backend
- MongoDB schemas (User, Content)
- Auth middleware with Clerk
- RESTful API endpoints for CRUD operations
- Database connection utility
✅ Frontend
- Authentication pages (Sign In/Sign Up)
- Age selection onboarding flow
- Dashboard with user stats
- Content browsing and filtering
- Responsive navigation system
- Node.js 18+ and npm
- MongoDB Atlas account
- Clerk account
- Clone the repository:
git clone https://github.com/heyy-kartik/ecosia-pccoe.git
cd ecosia-pccoe- Install dependencies:
npm install-
Set up environment variables:
- Copy
.env.exampleto.env.local - Fill in your credentials:
- Get Clerk keys from Clerk Dashboard
- Get MongoDB URI from MongoDB Atlas
- Copy
-
Run the development server:
npm run dev- Open http://localhost:3000 in your browser
src/
├── app/
│ ├── api/
│ │ ├── content/ # Content CRUD endpoints
│ │ ├── users/ # User management endpoints
│ │ └── webhook/ # Clerk webhooks
│ ├── sign-in/ # Sign in page
│ ├── sign-up/ # Sign up page
│ ├── onboarding/ # Age selection onboarding
│ ├── dashboard/ # User dashboard
│ ├── content/ # Content browsing
│ └── layout.tsx # Root layout with Clerk
├── components/
│ ├── ui/ # Shadcn UI components
│ └── Navigation.tsx # Main navigation
├── lib/
│ ├── mongodb.ts # Database connection
│ └── utils.ts # Utility functions
└── models/
├── User.ts # User schema
└── Content.ts # Content schema
GET /api/content- Get all content (with filters)POST /api/content- Create new content (authenticated)GET /api/content/[id]- Get single contentPUT /api/content/[id]- Update content (author only)DELETE /api/content/[id]- Delete content (author only)
GET /api/users- Get current user profilePUT /api/users- Update user profile
POST /api/webhook- Clerk user sync webhook
- Framework: Next.js 15 with App Router
- Language: TypeScript
- Styling: Tailwind CSS
- UI Components: Shadcn UI
- Authentication: Clerk
- Database: MongoDB with Mongoose
- Deployment: Vercel-ready
See .env.example for required environment variables.
=======
Hackathon Repo for Ecosia