Full Project Blueprint for Developers
Build One Day Notes with AI
Complete step-by-step master roadmap to build this college exam preparation notes platform using Next.js 16, React 19, TailwindCSS 4, and Multi-AI fallback chain. Copy tested prompts for each step or download the entire blueprint.
Next.js 16 (App Router)React 19TailwindCSS 4Gemini + Groq + OpenAI Fallback
Foundation⏱️ 15-20 Mins
Phase 1: Project Setup & Architecture
Initialize Next.js 16 App Router codebase with TypeScript, TailwindCSS 4, and notebook design tokens.
Key Deliverables & Action Items:
- Create Next.js 16 project using `npx create-next-app@latest ./ --typescript --tailwind --app`
- Configure `@import "tailwindcss";` in `src/app/globals.css`
- Add notebook grid pattern and ruled margin CSS utility rules in `globals.css`
- Define environment variables template `.env.example` for AI API Keys
🤖 Master AI Prompt for Step 1
Create a Next.js 16 App Router project named "One Day Notes" using TypeScript and TailwindCSS 4. Setup src/app/globals.css with a custom notebook grid pattern (background-size: 40px 40px) and a left red margin line (notebook-margin). Create a .env.example file containing GEMINI_API_KEY, GROQ_API_KEY, and OPENAI_API_KEY.
Frontend UI⏱️ 30-40 Mins
Phase 2: UI Components & Learning Levels
Build responsive, high-aesthetic components tailored for college exam preparation.
Key Deliverables & Action Items:
- Create Header component with full uncropped `logolight.png` branding
- Build Hero section with animated headings, badges, and tagline
- Build AiSearchBox with input question box, submit gradient button, and suggested topic chips
- Build LevelSelector with Easy (analogies), Moderate (textbook), and Hard (detailed university exam) tabs
- Build AiAnswerCard with notebook paper styling, copy text button, exam tip card, and practical example terminal box
🤖 Master AI Prompt for Step 2
Build React 19 / Next.js 16 components for an exam notes app: 1. Header.tsx: Logo image + navigation links. 2. Hero.tsx: High-impact hero section with syllabus preparation tagline. 3. LevelSelector.tsx: 3 difficulty levels (Easy, Moderate, Hard) with color indicators and notebook preview box. 4. AiSearchBox.tsx: Input form with prompt chips and indigo submit button. 5. AiAnswerCard.tsx: Ruled paper styled card displaying short answer, key points, exam tips, and practical code block.
AI Service⏱️ 25-35 Mins
Phase 3: Multi-AI Routing & Priority Fallback Chain
Implement a resilient 3-tier AI failover chain to guarantee 99.9% uptime for AI notes generation.
Key Deliverables & Action Items:
- Priority 1: Gemini API (`gemini-flash-latest` with JSON mode)
- Priority 2: Groq API (`llama-3.3-70b-versatile` via chat completions JSON mode)
- Priority 3: OpenAI API (`gpt-4o-mini` with structured JSON format)
- Static Frontend Fallback: Local keyword matching if all API providers fail
🤖 Master AI Prompt for Step 3
Implement a robust multi-AI service in src/lib/ai/aiService.ts with a 3-stage fallback priority chain: 1. Try Gemini API (gemini-flash-latest) using GEMINI_API_KEY. 2. If Gemini fails, fallback to Groq API (llama-3.3-70b-versatile) using GROQ_API_KEY. 3. If Groq fails, fallback to OpenAI API (gpt-4o-mini) using OPENAI_API_KEY. Enforce a JSON schema returning shortAnswer, definition, keyPoints array, example, examTip, and quickRevisionPoints for Easy, Moderate, and Hard levels.
Security & API Protection⏱️ 20-30 Mins
Phase 4: Security, Rate Limiting & Zero-Cost Greeting Interceptor
Protect backend API routes from abuse, high cost, and inappropriate content.
Key Deliverables & Action Items:
- IP Rate Limiter: Restrict requests to maximum 5 requests per minute per IP address (HTTP 429)
- Safety Filter: Block queries containing vulgarity, profanity, hacking, or exam cheating
- Greeting Interceptor (Zero-Cost API): Catch conversational queries ('hi', 'hello') offline without consuming API credits
- Length Validator: Require queries to be at least 3 characters long
🤖 Master AI Prompt for Step 4
Create a secure Next.js API route at src/app/api/ask/route.ts:
1. IP Rate Limiting: Limit requests to 10 per minute per IP address using in-memory or Redis map. Return 429 when exceeded.
2. Greeting Interceptor: If query matches conversational greetings ('hi', 'hello', 'who are you'), return an instant welcome card with 0 API call cost.
3. Safety Keyword Filter: Block queries containing vulgarity, profanity, or exam cheating instructions with a 400 alert response.
4. Call askAiService to generate structured notes and return JSON response.Production Launch⏱️ 15-20 Mins
Phase 5: SEO, Analytics, Favicon & Deployment
Configure Favicons, Google Analytics, OpenGraph tags, and deploy to Vercel.
Key Deliverables & Action Items:
- Copy `logofavicon.png` to `public/logofavicon.png`, `src/app/favicon.ico`, and `src/app/icon.png`
- Set up OpenGraph metadata, title tags, and canonical URLs in `src/app/layout.tsx`
- Integrate Google Analytics (GA4) script component reading `NEXT_PUBLIC_GOOGLE_ANALYTICS_ID`
- Deploy to Vercel and connect custom domain
🤖 Master AI Prompt for Step 5
Configure production setup for Next.js 16 app: 1. src/app/layout.tsx: Add metadata icons referencing /logofavicon.png, OpenGraph tags, and Google Analytics component. 2. Create Google Analytics script component reading NEXT_PUBLIC_GOOGLE_ANALYTICS_ID. 3. Provide deployment commands and environment variable setup for Vercel deployment.
