1 line
47 KiB
JSON
1 line
47 KiB
JSON
{"repo": "ahmed900wael/gpspark-fcai", "files": {"PROJECT_PLAN.md": {"839b24a0db9891c4a977d56a3e96df83d6a0c287": {"t": 1785747233.7810276, "n": 16743, "h": "662466ab21c0cbda", "c": "# GPSpark Project Plan\n\n## Project Overview\nGPSpark is a comprehensive graduation project management platform that bridges the gap between academic theory and market reality. It provides AI-driven insights, team formation tools, and project management features for FCAI-CU students.\n\n**Repository:** https://github.com/Ahmed900Wael/gpspark-fcai \n**Production:** https://gpspark-fcai.vercel.app \n**Status:** ✅ Production Ready \n**Last Updated:** 2026-05-14 (Database Consolidation & AI Integration Complete)\n\n---\n\n## Technology Stack\n\n### Frontend\n- **Framework:** Next.js 16.2.6 (App Router)\n- **Language:** TypeScript\n- **Styling:** Tailwind CSS v4\n- **UI Components:** shadcn/ui + Radix UI\n- **Icons:** Lucide React\n- **State Management:** React Context API\n\n### Backend\n- **Database:** Supabase (PostgreSQL)\n- **Authentication:** Supabase Auth (Email/Password with confirmation)\n- **Storage:** Supabase Storage (avatars, milestones)\n- **Real-time:** Supabase Realtime subscriptions\n- **Row Level Security:** Full RLS implementation\n\n### AI Integration\n- **Provider:** OpenCode AI API\n- **Model:** deepseek-v4-flash\n- **Endpoint:** https://opencode.ai/zen/go/v1/chat/completions\n- **Response Type:** Non-streaming JSON\n\n### Deployment\n- **Hosting:** Vercel\n- **Database:** Supabase Cloud\n- **Environment:** Production ready\n\n---\n\n## Project Structure\n\n```\ngpspark/\n├── app/\n│ ├── layout.tsx # Root layout with Providers\n│ ├── page.tsx # Landing page (public)\n│ ├── globals.css # Global styles\n│ ├── api/\n│ │ ├── ai/\n│ │ │ ├── chat/ # AI service endpoint\n│ │ │ └── tools/ # Structured tool execution\n│ │ └── brainstorm/\n│ │ ├── route.ts # Main AI chat\n│ │ ├── analysis/ # Market/tech analysis\n│ │ └── feasibility/ # Feasibility scoring\n│ ├── auth/\n│ │ └── callback/ # Email confirmation handler\n│ ├── brainstorm/ # AI brainstorming page\n│ ├── dashboard/ # User dashboard\n│ ├── library/ # GP Library\n│ ├── milestones/ # Milestone tracking\n│ ├── projects/ # Project management\n│ ├── profile/ # User profiles\n│ ├── signin/ # Sign in page\n│ ├── signup/ # Sign up page\n│ └── team/ # Team formation\n├── components/\n│ ├── ui/ # shadcn/ui components\n│ ├── navbar.tsx # Navigation with notifications\n│ ├── sidebar.tsx # Side navigation\n│ ├── footer.tsx # Footer\n│ ├── protected-route.tsx # Auth guard\n│ └── command-palette.tsx # Ctrl+K search\n├── contexts/\n│ ├── auth-context.tsx # Auth state management\n│ └── notification-context.tsx # Notifications\n├── database/\n│ └── schema.sql # Consolidated schema (single file)\n├── lib/\n│ ├── supabase.ts # Supabase client\n│ ├── qwen-service.ts # AI service class\n│ ├── gpspark-ai.ts # High-level AI wrapper\n│ └── upload.ts # File upload utilities\n└── vercel.json # Deployment config\n```\n\n---\n\n## ✅ Completed Features\n\n### 1. Authentication & User Management ✅\n- [x] Email signup with confirmation flow\n- [x] Email verification via Supabase\n- [x] Custom `/auth/callback` route for redirects\n- [x] Resend confirmation email functionality\n- [x] Session persistence via localStorage\n- [x] Profile auto-creation on signup (database trigger)\n- [x] Full profile management (GPA, department, interests, career goals)\n- [x] Protected routes with auto-redirect\n- [x] Logout functionality\n\n### 2. Dashboard ✅\n- [x] Real-time project progress tracking\n- [x] Team status overview\n- [x] Upcoming milestones display\n- [x] Quick action buttons\n- [x] Responsive design (mobile/tablet)\n- [x] Dynamic data from Supabase\n\n### 3. Project Management ✅\n- [x] Create projects with auto-generated phases\n- [x] Cascade delete (phases, tasks, submissions)\n- [x] Team linking for collaboration\n- [x] Granular access control via `project_access` table\n- [x] View-only access for team members\n- [x] Project status tracking (active, completed, archived)\n- [x] Progress calculation from tasks\n\n### 4. Milestone & Task Tracking ✅\n- [x] Phase-based project structure (5 default phases)\n- [x] Task CRUD operations\n- [x] Task status tracking (pending, in_progress, completed)\n- [x] Due date management\n- [x] File attachments\n- [x] Milestone submissions\n- [x] Phase advancement workflow\n- [x] Progress calculation\n\n### 5. Team Formation ✅\n- [x] Discover students with filters\n- [x] Create teams with domain and max members\n- [x] Join requests (accept/reject)\n- [x] Owner can revoke members\n- [x] Members can leave teams\n- [x] Student status badges (RECRUITING, IN-TEAM, NOT-IN-TEAM)\n- [x] Connect modal with academic/contact info\n- [x] Automatic project access on team join\n\n### 6. GP Library ✅\n- [x] Browse 30 seed graduation projects\n- [x] Search and filter by domain\n- [x] Uniqueness scores\n- [x] Tech stack information\n- [x] Project details view\n- [x] Favorites system\n\n### 7. AI Brainstorm ✅\n- [x] OpenCode AI integration (deepseek-v4-flash)\n- [x] Main chat with AI tutor\n- [x] Market gaps analysis\n- [x] Technical challenges assessment\n- [x] Feasibility scoring (0-100 across 5 dimensions)\n- [x] Non-streaming JSON responses\n- [x] Multi-turn conversation support\n- [x] Chat history persistence\n\n### 8. Notifications ✅\n- [x] Real-time via Supabase subscriptions\n- [x] 10-second polling fallback\n- [x] Bell dropdown in navbar\n- [x] Notification types:\n - team_request\n - team_accepted\n - team_rejected\n - project_assigned\n - milestone_submitted\n - milestone_approved\n - milestone_rejected\n - info\n- [x] Manual refresh button\n- [x] Mark as read functionality\n\n### 9. Project Access Control ✅\n- [x] `project_access` junction table\n- [x] Explicit access grants\n- [x] RLS disabled on `project_access` (app-controlled)\n- [x] Team members get automatic access on join\n- [x] Owner can revoke individual access\n- [x] View-only permissions for non-owners\n\n### 10. Navigation & Layout ✅\n- [x] Responsive sidebar with mobile hamburger menu\n- [x] Fixed sidebar on desktop, slide-in on mobile\n- [x] SimpleHeader component with user avatar\n- [x] ProtectedRoute wrapper for auth-gated pages\n- [x] Consistent navigation across all pages\n- [x] Mobile-responsive grids and layouts\n\n### 11. UI/UX Polish ✅\n- [x] GPSpark logo in sidebar and footer\n- [x] Dynamic year in footer copyright\n- [x] Cursor pointer on all buttons\n- [x] Navigation links on all buttons\n- [x] FCAI-CU 2026 branding in footer\n- [x] Loading states and error handling\n- [x] Toast notifications\n\n### 12. Database Architecture ✅\n- [x] 13 core tables implemented\n- [x] Row Level Security policies\n- [x] Database triggers and functions\n- [x] Cascade deletes\n- [x] Indexes for performance\n- [x] Consolidated schema file\n\n### 13. Deployment ✅\n- [x] Vercel configuration\n- [x] Environment variables setup\n- [x] Supabase configuration\n- [x] Production deployment ready\n\n---\n\n## 🔄 Known Limitations\n\n- Mentors page disabled (backend not ready)\n- File upload limited to 50MB\n- No real-time collaboration on tasks\n- No mentor feedback system yet\n- No OAuth integration (Google, GitHub)\n- No password reset functionality\n\n---\n\n## 📋 Future Enhancements\n\n### High Priority\n- [ ] Mentor portal and feedback system\n- [ ] Real-time task collaboration\n- [ ] File versioning\n- [ ] Progress analytics dashboard\n- [ ] Export reports (PDF)\n\n### Medium Priority\n- [ ] OAuth integration (Google, GitHub)\n- [ ] Password reset functionality\n- [ ] Email notifications\n- [ ] Mobile app (React Native)\n- [ ] Dark mode toggle\n\n### Low Priority\n- [ ] Admin panel\n- [ ] Advanced analytics\n- [ ] API for third-party integrations\n- [ ] Custom email templates\n\n---\n\n## Database Schema\n\n### Consolidated Schema\nAll database tables, RLS policies, triggers, and seed data are in a single file:\n**`database/schema.sql`**\n\n### Core Tables (13 total)\n\n1. **profiles** - User profiles extending auth.users\n2. **teams** - Team information\n3. **team_members** - Team membership with roles\n4. **team_requests** - Join requests\n5. **projects** - Graduation projects\n6. **project_phases** - Project phases (5 default)\n7. **milestone_tasks** - Tasks within phases\n8. **milestone_submissions** - Task submissions\n9. **project_access** - Granular project permissions\n10. **notifications** - User notifications\n11. **library_projects** - GP Library projects\n12. **brainstorm_sessions** - AI chat sessions\n13. **chat_messages** - AI chat messages\n\n### Row Level Security Policies\n\n| Table | SELECT | INSERT | UPDATE | DELETE |\n|-------|--------|--------|--------|--------|\n| profiles | All users | Own profile | Own profile | - |\n| teams | All users | Authenticated | Owner | Owner |\n| team_members | All users | Owner/Self | - | Owner/Self |\n| team_requests | Owner/Sender | Authenticated | Owner | - |\n| projects | All users | Authenticated | Owner | Owner |\n| project_phases | All users | Project owner | Project owner | Project owner |\n| milestone_tasks | All users | Project owner | Project owner | Project owner |\n| milestone_submissions | Owner | Authenticated | Owner | Owner |\n| project_access | RLS disabled | RLS disabled | RLS disabled | RLS disabled |\n| notifications | Owner | System | Owner | Owner |\n\n---\n\n## Environment Variables\n\n```env\n# Supabase Configuration\nNEXT_PUBLIC_SUPABASE_URL=https://tlocxrrjiuflhxvzayyy.supabase.co\nNEXT_PUBLIC_SUPABASE_ANON_KEY=sb_publishable__56AJJsqggYySnFyWLrgKg_kC-o7aRY\nSUPABASE_SERVICE_ROLE_KEY=your_service_role_key\n\n# OpenCode AI Configuration\nOPENCODE_API_KEY=your_opencode_api_key\n\n# Application\nNEXT_PUBLIC_APP_URL=http://localhost:3000\n```\n\n---\n\n## Key Technical Decisions\n\n### 1. Database Consolidation\n**Decision:** Single `database/schema.sql` file instead of multiple files \n**Reason:** Easier to manage, run, and maintain. All tables, policies, and seed data in one place.\n\n### 2. Project Access Control\n**Decision:** `project_access` junction table with RLS disabled \n**Reason:** Prevents infinite recursion in RLS policies. App-level control is simpler and more flexible.\n\n### 3. AI Integration\n**Decision:** OpenCode AI (deepseek-v4-flash) with non-streaming responses \n**Reason:** More reliable than streaming, simpler error handling, complete responses.\n\n### 4. Email Confirmation\n**Decision:** Custom `/auth/callback` route \n**Reason:** Handles Vercel deployment redirects properly. Supports forwarded hosts.\n\n### 5. Session Persistence\n**Decision:** localStorage caching with Supabase verification \n**Reason:** Faster page loads, prevents data loss on reload, maintains user experience.\n\n### 6. Notifications\n**Decision:** Real-time subscriptions + polling fallback \n**Reason:** Ensures notifications are delivered even if WebSocket disconnects.\n\n---\n\n## Development Phases Status\n\n### Phase 1: Foundation ✅ COMPLETE\n- [x] Project setup (Next.js, TypeScript, Tailwind)\n- [x] Supabase integration & authentication\n- [x] Base UI components (shadcn/ui)\n- [x] Navigation & layout structure\n- [x] Landing page implementation\n- [x] Responsive design\n- [x] Logo integration\n\n### Phase 2: Core Features ✅ COMPLETE\n- [x] User onboarding flow\n- [x] Sign up / Sign in pages with email confirmation\n- [x] Profile management\n- [x] Authentication context\n- [x] Protected routes\n- [x] Logout functionality\n- [x] Dashboard with real data\n\n### Phase 3: Library & Teams ✅ COMPLETE\n- [x] GP Library UI with 30 seed projects\n- [x] Project card components\n- [x] Search and filter functionality\n- [x] Team Formation UI\n- [x] Student profile cards\n- [x] Team creation & management\n- [x] Join requests (accept/reject)\n- [x] Member revocation\n\n### Phase 4: Project Management ✅ COMPLETE\n- [x] Projects page with CRUD\n- [x] Milestones UI with roadmap\n- [x] Task management system\n- [x] Progress tracking\n- [x] Phase advancement\n- [x] File uploads\n- [x] Submissions workflow\n- [x] Project access control\n\n### Phase 5: AI Integration ✅ COMPLETE\n- [x] OpenCode AI API integration\n- [x] Brainstorming chat interface\n- [x] Market gaps analysis\n- [x] Technical challenges assessment\n- [x] Feasibility scoring\n- [x] Chat history persistence\n- [x] Multi-turn conversations\n\n### Phase 6: Notifications & Polish ✅ COMPLETE\n- [x] Real-time notifications\n- [x] Polling fallback\n- [x] Notification bell dropdown\n- [x] UI/UX polish\n- [x] Loading states\n- [x] Error handling\n- [x] Toast notifications\n\n### Phase 7: Deployment ✅ COMPLETE\n- [x] Vercel configuration\n- [x] Environment variables\n- [x] Database schema consolidation\n- [x] Production deployment ready\n- [x] Documentation complete\n\n---\n\n## API Endpoints\n\n### Brainstorm AI\n| Endpoint | Method | Purpose |\n|----------|--------|---------|\n| `/api/brainstorm` | POST | Main AI chat (non-streaming) |\n| `/api/brainstorm/analysis` | POST | Market gaps + technical challenges |\n| `/api/brainstorm/feasibility` | POST | Feasibility scoring (0-100) |\n\n### AI Service\n| Endpoint | Method | Purpose |\n|----------|--------|---------|\n| `/api/ai/chat` | POST/GET | AI service with tools |\n| `/api/ai/tools` | POST/GET | Structured tool execution |\n\n### Auth\n| Endpoint | Method | Purpose |\n|----------|--------|---------|\n| `/auth/callback` | GET | Email confirmation redirect |\n\n---\n\n## Testing Strategy\n\n### Manual Testing Checklist ✅\n- [x] Sign up flow (new user)\n- [x] Email confirmation\n- [x] Sign in flow (existing user)\n- [x] Logout functionality\n- [x] Protected route redirection\n- [x] Profile edit and save\n- [x] View other user profiles\n- [x] Mobile responsiveness\n- [x] Sidebar navigation\n- [x] Form validation\n- [x] Project creation and deletion\n- [x] Team formation and management\n- [x] Task CRUD operations\n- [x] AI brainstorming chat\n- [x] Notifications system\n\n### Automated Testing (Pending)\n- [ ] Unit tests for auth context\n- [ ] Integration tests for sign up/in\n- [ ] E2E tests with Playwright\n- [ ] Component tests with React Testing Library\n\n---\n\n## Deployment Checklist ✅\n\n### Pre-Deployment ✅\n- [x] Environment variables configured\n- [x] Database schema applied\n- [x] RLS policies verified\n- [x] Email confirmation enabled\n- [x] Custom email templates configured\n- [x] CORS configured for production domain\n- [x] Error handling implemented\n- [x] Loading states implemented\n\n### Vercel Deployment ✅\n- [x] Connect GitHub repository\n- [x] Configure environment variables\n- [x] Set build command: `npm run build`\n- [x] Set output directory: `.next`\n- [x] Configure custom domain\n- [x] Enable HTTPS\n- [x] Set up monitoring\n\n### Post-Deployment\n- [ ] Test full auth flow on production\n- [ ] Verify database connections\n- [ ] Test mobile responsiveness\n- [ ] Monitor error logs\n- [ ] Set up analytics\n\n---\n\n## Resources & References\n\n- **Supabase Docs:** https://supabase.com/docs\n- **Next.js Docs:** https://nextjs.org/docs\n- **Tailwind CSS:** https://tailwindcss.com/docs\n- **shadcn/ui:** https://ui.shadcn.com\n- **Lucide Icons:** https://lucide.dev\n- **OpenCode AI:** https://opencode.ai\n\n---\n\n## Current Status\n\n### ✅ Production Ready\n- All core features implemented and tested\n- Database schema consolidated into single file\n- Authentication fully functional with email confirmation\n- AI integration working with OpenCode AI\n- Project access control implemented\n- Team management complete\n- Milestone tracking operational\n- Notifications system active\n- Deployment configured and ready\n\n### 📊 Metrics\n- **Database Tables:** 13\n- **Context Providers:** 2 (Auth, Notifications)\n- **Pages:** 10+\n- **API Routes:** 5\n- **Seed Projects:** 30\n- **Lines of Code:** ~15,000+\n\n### 🎯 Completion\n- **Overall Progress:** 95%\n- **UI/UX:** 100%\n- **Backend:** 100%\n- **AI Integration:** 100%\n- **Database:** 100%\n- **Deployment:** 100%\n- **Documentation:** 100%\n\n---\n\n## Notes for Future Sessions\n\n### Important Context\n- Supabase project URL: https://tlocxrrjiuflhxvzayyy.supabase.co\n- Database trigger auto-creates profiles on signup\n- Use `.update()` not `.insert()` for profile creation in signUp\n- All protected pages use `<ProtectedRoute>` wrapper\n- Auth state is synced with localStorage for persistence\n- Console uses `[CLIENT]` and `[SERVER]` prefixes for logging\n- AI API: OpenCode AI with deepseek-v4-flash model\n- Database schema: Single file at `database/schema.sql`\n- Project access: Controlled via `project_access` table (RLS disabled)\n\n### Next Steps\n1. Deploy to production on Vercel\n2. Test with real users\n3. Gather feedback\n4. Implement mentor system\n5. Add OAuth integration\n6. Build mobile app\n\n---\n\n## Estimated Timeline\n- **Total Duration:** 12 weeks\n- **Current Progress:** 95% complete\n- **MVP Status:** ✅ Ready\n- **Production Status:** ✅ Ready\n\n---\n\n*Last Updated: 2026-05-14*\n"}, "0d2e78b91dc9ef0ec567e5b69cfe7cd5780ad140": {"t": 1785771582.597458, "n": 18420, "h": "82ba09a839d26e56", "c": "# GPSpark Project Plan\n\n## Project Overview\nGPSpark is a graduation project management platform that bridges the gap between academic theory and market reality. It provides AI-driven insights, team formation tools, and project management features for FCAI students.\n\n**Repository:** https://github.com/Ahmed900Wael/gpspark-fcai\n**Status:** Active Development\n**Last Updated:** 2026-05-10 (OpenAI Integration Added)\n\n---\n\n## Technology Stack\n\n- **Frontend:** Next.js 16.2.6 (App Router), TypeScript, Tailwind CSS v4, shadcn/ui components\n- **Backend:** Next.js API Routes + Server Actions\n- **Database:** Supabase (PostgreSQL + Auth + Real-time)\n- **Authentication:** Supabase Auth (Email/Password)\n- **State Management:** React Context API (Auth Context)\n- **Storage:** localStorage for session persistence + Supabase for data\n- **UI Components:** shadcn/ui + Lucide React icons\n- **Deployment:** Vercel (frontend) + Supabase Cloud\n\n---\n\n## Project Structure\n\n```\ngpspark/\n├── app/\n│ ├── layout.tsx # Root layout with Providers\n│ ├── page.tsx # Landing page (public)\n│ ├── globals.css # Global styles\n│ ├── api/\n│ │ └── brainstorm/route.ts # OpenAI API route (streaming)\n│ ├── dashboard/page.tsx # Dashboard (protected)\n│ ├── brainstorm/page.tsx # Brainstorming AI (protected)\n│ ├── library/page.tsx # GP Library (protected)\n│ ├── team/page.tsx # Team Formation (protected)\n│ ├── milestones/page.tsx # Milestones (protected)\n│ ├── mentors/page.tsx # Mentors (protected)\n│ ├── onboarding/page.tsx # Onboarding info (public)\n│ ├── signin/page.tsx # Sign In (public)\n│ ├── signup/page.tsx # Sign Up (public)\n│ ├── profile/page.tsx # User's own profile (protected)\n│ └── profile/[userId]/page.tsx # Other user profiles (protected)\n├── components/\n│ ├── ui/ # shadcn/ui components\n│ │ └── button.tsx\n│ ├── navbar.tsx # SimpleHeader component\n│ ├── sidebar.tsx # Responsive sidebar with mobile menu\n│ ├── providers.tsx # Auth provider wrapper\n│ └── protected-route.tsx # Route protection wrapper\n```\n\n---\n\n## Completed Features\n\n### ✅ 1. Landing Page (Public)\n- [x] Hero section with CTA buttons\n- [x] Feature showcase (AI Brainstorming, Market Analysis, Team Building)\n- [x] Project library preview section\n- [x] CTA section with \"Create Free Account\" and \"Talk to an Advisor\"\n- [x] Footer with dynamic year and links\n- [x] Responsive design (mobile-first)\n- [x] Dynamic year in \"Industry Trends\" section\n- [x] Navigation links removed (clean design)\n- [x] Sign In button links to /signin\n\n### ✅ 2. Authentication System\n- [x] Supabase integration with email/password auth\n- [x] Sign Up page (/signup) with form validation\n- [x] Sign In page (/signin) with password visibility toggle\n- [x] Auth Context with full state management\n- [x] Session persistence via localStorage\n- [x] Auto-redirect to onboarding for unauthenticated users\n- [x] Protected routes wrapper component\n- [x] Logout functionality in sidebar\n- [x] Profile auto-creation on signup via database trigger\n- [x] Console logging for all auth events ([CLIENT]/[SERVER])\n\n### ✅ 3. Onboarding Flow\n- [x] Onboarding info page (/onboarding) with 3-step overview\n- [x] Sign Up redirects to dashboard after completion\n- [x] Profile data synced with Supabase database\n- [x] Form validation on each step\n\n### ✅ 4. Dashboard (Protected)\n- [x] Stats cards (Project Progress, Tasks, Deadline, Uniqueness Score)\n- [x] Current project card with progress bar\n- [x] Quick actions panel\n- [x] Recent activity feed\n- [x] Upcoming milestones list\n- [x] Responsive grid layouts\n\n### ✅ 5. Brainstorming AI (Protected)\n- [x] Chat interface with AI tutor messages\n- [x] Project feasibility score (circular progress)\n- [x] Market gaps identification cards\n- [x] Technical challenges with severity indicators\n- [x] Suggestion chips for next topics\n- [x] Export Research Summary button\n- [x] Message input with attachment option\n- [x] OpenAI API integration with streaming responses\n- [x] Real-time chat with GPT-4o-mini\n- [x] Loading states and error handling\n- [x] Auto-scroll to latest message\n- [x] Enter key to send messages\n\n### ✅ 6. GP Library (Protected)\n- [x] Search and filter functionality\n- [x] Featured project card with uniqueness score\n- [x] Project grid with tech stack tags\n- [x] \"Analyze Architecture\" buttons\n- [x] Empty state with uniqueness audit CTA\n- [x] Tabs for All Projects / My Favorites\n\n### ✅ 7. Team Formation (Protected)\n- [x] Student profile cards with skills\n- [x] Skill-based search with active filters\n- [x] Teams seeking members sidebar\n- [x] Apply to team functionality\n- [x] Tips for teams section\n- [x] Create Team button\n\n### ✅ 8. Milestones (Protected)\n- [x] Roadmap overview with phase progression\n- [x] Current phase task list with status indicators\n- [x] Next phase preview\n- [x] Mentor feedback card\n- [x] Need Help discussion section\n- [x] Review archive section\n- [x] Submit Milestone button\n\n### ✅ 9. Mentors (Protected)\n- [x] Mentor cards with expertise tags\n- [x] Availability status indicators\n- [x] Search and filter by expertise\n- [x] Stats section (Available Mentors, Sessions, Avg Rating)\n- [x] Feedback requests list\n- [x] Message and Book Session buttons\n\n### ✅ 10. User Profiles\n- [x] Own profile page (/profile) with full edit access\n- [x] Other user profiles (/profile/[userId]) with limited access\n- [x] Edit mode with save/cancel functionality\n- [x] Interest toggle buttons\n- [x] Email privacy (partial masking for other users)\n- [x] Avatar with initials\n- [x] Member since date display\n\n### ✅ 11. Navigation & Layout\n- [x] Responsive sidebar with mobile hamburger menu\n- [x] Fixed sidebar on desktop, slide-in on mobile\n- [x] SimpleHeader component with user avatar\n- [x] ProtectedRoute wrapper for auth-gated pages\n- [x] Consistent navigation across all pages\n- [x] Mobile-responsive grids and layouts\n- [x] Safe area support for notched devices\n\n### ✅ 12. UI/UX Polish\n- [x] GPSpark logo in sidebar and footer\n- [x] Dynamic year in footer copyright\n- [x] Cursor pointer on all buttons\n- [x] Navigation links on all buttons\n- [x] \"Talk to an Advisor\" button with transparent hover\n- [x] Footer links: About, Privacy Policy, Terms, Contact Support\n- [x] FCAI-CU 2026 branding in footer\n\n---\n\n## Pending Features\n\n### 🔄 Authentication & Profiles\n- [ ] Email verification flow\n- [ ] Password reset functionality\n- [ ] OAuth integration (Google, GitHub)\n- [ ] Profile picture upload\n- [ ] Email notifications\n\n### 🔄 Brainstorming AI\n- [x] OpenAI API integration\n- [x] Real-time chat with streaming responses\n- [ ] Chat history persistence to database\n- [ ] PDF export functionality\n- [ ] Context window management\n- [ ] Save brainstorm sessions\n\n### 🔄 GP Library\n- [ ] Real project data from database\n- [ ] Advanced search with full-text search\n- [ ] Project detail pages\n- [ ] Favorites system\n- [ ] Uniqueness scoring algorithm\n\n### 🔄 Team Formation\n- [ ] Real team data from database\n- [ ] Team creation workflow\n- [ ] Team member management\n- [ ] Real-time messaging between users\n- [ ] Skill matching algorithm\n\n### 🔄 Milestones\n- [ ] Real project data from database\n- [ ] Task CRUD operations\n- [ ] File upload for submissions\n- [ ] Real mentor feedback system\n- [ ] Calendar integration\n\n### 🔄 Mentors\n- [ ] Real mentor data from database\n- [ ] Booking system with calendar\n- [ ] Video call integration\n- [ ] Rating and review system\n- [ ] Mentor availability management\n\n### 🔄 Additional Features\n- [ ] Dark mode toggle\n- [ ] Notifications system\n- [ ] Analytics dashboard\n- [ ] Export functionality (PDF, CSV)\n- [ ] Mobile app (React Native)\n- [ ] Email notifications\n- [ ] Admin panel\n\n---\n\n## Database Schema (Supabase)\n\n### Current Tables\n\n#### `profiles`\n```sql\nCREATE TABLE profiles (\n id UUID PRIMARY KEY REFERENCES auth.users(id) ON DELETE CASCADE,\n full_name TEXT NOT NULL DEFAULT '',\n university_email TEXT NOT NULL DEFAULT '',\n gpa TEXT DEFAULT '',\n academic_year TEXT DEFAULT '',\n interests TEXT[] DEFAULT '{}',\n career_goals TEXT DEFAULT '',\n avatar_url TEXT,\n created_at TIMESTAMPTZ DEFAULT NOW(),\n updated_at TIMESTAMPTZ DEFAULT NOW()\n);\n```\n\n#### Row Level Security Policies\n- Users can view own profile (full access)\n- Users can view all profiles (limited access in app)\n- Users can insert own profile\n- Users can update own profile\n\n#### Triggers\n- `on_auth_user_created`: Auto-creates profile on signup\n- `set_updated_at`: Updates timestamp on profile changes\n\n### Planned Tables\n\n#### `projects`\n```sql\nCREATE TABLE projects (\n id UUID PRIMARY KEY DEFAULT uuid_generate_v4(),\n title TEXT NOT NULL,\n description TEXT,\n domain TEXT,\n tech_stack TEXT[] DEFAULT '{}',\n uniqueness_score DECIMAL(3,1),\n release_year INTEGER,\n case_study_url TEXT,\n created_by UUID REFERENCES profiles(id),\n created_at TIMESTAMPTZ DEFAULT NOW()\n);\n```\n\n#### `teams`\n```sql\nCREATE TABLE teams (\n id UUID PRIMARY KEY DEFAULT uuid_generate_v4(),\n name TEXT NOT NULL,\n description TEXT,\n created_by UUID REFERENCES profiles(id),\n status TEXT DEFAULT 'seeking',\n max_members INTEGER DEFAULT 4,\n created_at TIMESTAMPTZ DEFAULT NOW()\n);\n```\n\n#### `team_members`\n```sql\nCREATE TABLE team_members (\n id UUID PRIMARY KEY DEFAULT uuid_generate_v4(),\n team_id UUID REFERENCES teams(id) ON DELETE CASCADE,\n user_id UUID REFERENCES profiles(id) ON DELETE CASCADE,\n role TEXT DEFAULT 'member',\n joined_at TIMESTAMPTZ DEFAULT NOW(),\n UNIQUE(team_id, user_id)\n);\n```\n\n#### `milestones`\n```sql\nCREATE TABLE milestones (\n id UUID PRIMARY KEY DEFAULT uuid_generate_v4(),\n project_id UUID REFERENCES projects(id) ON DELETE CASCADE,\n phase_name TEXT NOT NULL,\n phase_number INTEGER NOT NULL,\n status TEXT DEFAULT 'pending',\n progress_percentage INTEGER DEFAULT 0,\n start_date DATE,\n end_date DATE,\n created_at TIMESTAMPTZ DEFAULT NOW()\n);\n```\n\n#### `tasks`\n```sql\nCREATE TABLE tasks (\n id UUID PRIMARY KEY DEFAULT uuid_generate_v4(),\n milestone_id UUID REFERENCES milestones(id) ON DELETE CASCADE,\n title TEXT NOT NULL,\n description TEXT,\n status TEXT DEFAULT 'pending',\n due_date DATE,\n assigned_to UUID REFERENCES profiles(id),\n created_at TIMESTAMPTZ DEFAULT NOW()\n);\n```\n\n#### `brainstorm_sessions`\n```sql\nCREATE TABLE brainstorm_sessions (\n id UUID PRIMARY KEY DEFAULT uuid_generate_v4(),\n user_id UUID REFERENCES profiles(id) ON DELETE CASCADE,\n project_focus TEXT,\n feasibility_score DECIMAL(5,2),\n market_gaps JSONB,\n technical_challenges JSONB,\n created_at TIMESTAMPTZ DEFAULT NOW(),\n updated_at TIMESTAMPTZ DEFAULT NOW()\n);\n```\n\n#### `chat_messages`\n```sql\nCREATE TABLE chat_messages (\n id UUID PRIMARY KEY DEFAULT uuid_generate_v4(),\n session_id UUID REFERENCES brainstorm_sessions(id) ON DELETE CASCADE,\n role TEXT NOT NULL CHECK (role IN ('user', 'assistant')),\n content TEXT NOT NULL,\n timestamp TIMESTAMPTZ DEFAULT NOW()\n);\n```\n\n#### `mentor_feedback`\n```sql\nCREATE TABLE mentor_feedback (\n id UUID PRIMARY KEY DEFAULT uuid_generate_v4(),\n milestone_id UUID REFERENCES milestones(id) ON DELETE CASCADE,\n mentor_id UUID REFERENCES profiles(id),\n feedback_text TEXT NOT NULL,\n rating INTEGER CHECK (rating >= 1 AND rating <= 5),\n created_at TIMESTAMPTZ DEFAULT NOW()\n);\n```\n\n---\n\n## Environment Variables\n\n```env\n# Supabase Configuration\nNEXT_PUBLIC_SUPABASE_URL=https://tlocxrrjiuflhxvzayyy.supabase.co\nNEXT_PUBLIC_SUPABASE_ANON_KEY=sb_publishable__56AJJsqggYySnFyWLrgKg_kC-o7aRY\n\n# OpenAI Configuration\nOPENAI_API_KEY=your_openai_api_key_here\n\n# Other (Pending)\nNEXT_PUBLIC_APP_URL=http://localhost:3000\n```\n\n---\n\n## Key Technical Decisions\n\n### 1. Authentication Flow\n- Supabase Auth handles user authentication\n- Profiles table extends auth.users with additional fields\n- Auto-profile creation via database trigger on signup\n- Session synced with localStorage for client-side authorization\n- Protected routes redirect unauthenticated users to /onboarding\n\n### 2. Profile Privacy\n- Own profile: Full edit access to all fields\n- Other profiles: Limited view (email partially masked, GPA hidden if empty, career goals truncated)\n- Row Level Security ensures users can only edit their own data\n\n### 3. Responsive Design\n- Mobile-first approach with Tailwind CSS\n- Sidebar: Fixed on desktop (lg:), slide-in overlay on mobile\n- Hamburger menu with touch-optimized button\n- Safe area support for notched devices\n- Grid layouts adapt from 1 column (mobile) to multi-column (desktop)\n\n### 4. State Management\n- React Context API for auth state\n- localStorage for session persistence\n- Supabase for data persistence\n- Client-side logging with [CLIENT]/[SERVER] prefixes\n\n### 5. Component Architecture\n- Reusable Sidebar component with active page highlighting\n- SimpleHeader component with user avatar\n- ProtectedRoute wrapper for auth-gated pages\n- shadcn/ui for consistent UI components\n\n---\n\n## Known Issues & Fixes\n\n### Fixed Issues\n1. **Duplicate key error on signup** - Changed `.insert()` to `.update()` since trigger auto-creates profile\n2. **Missing icon imports** - Added all required Lucide icons to each page\n3. **Unterminated regexp literal** - Removed extra closing div tag in team page\n4. **Brain not defined** - Added missing Brain icon import to dashboard\n5. **Mobile hamburger not working** - Fixed z-index layering (button: z-[70], sidebar: z-[60])\n6. **Navbar spacing** - Added `pl-16 lg:pl-6` to prevent overlap with hamburger button\n\n### Current Issues\n- None reported\n\n---\n\n## Development Phases Status\n\n### Phase 1: Foundation ✅ COMPLETE\n- [x] Project setup (Next.js, TypeScript, Tailwind)\n- [x] Supabase integration & authentication\n- [x] Base UI components (shadcn/ui)\n- [x] Navigation & layout structure\n- [x] Landing page implementation\n- [x] Responsive design\n- [x] Logo integration\n\n### Phase 2: Core Features 🔄 IN PROGRESS\n- [x] User onboarding flow (info page)\n- [x] Sign up / Sign in pages\n- [x] Profile management (own & others)\n- [x] Authentication context\n- [x] Protected routes\n- [x] Logout functionality\n- [x] Brainstorming AI chat interface (UI + API)\n- [x] OpenAI API integration with streaming\n- [ ] Chat message persistence to database\n\n### Phase 3: Library & Teams 🔄 IN PROGRESS\n- [x] GP Library UI\n- [x] Project card components\n- [ ] Real project data from database\n- [ ] Uniqueness scoring algorithm\n- [x] Team Formation UI\n- [x] Student profile cards\n- [ ] Team creation & management\n- [ ] Real-time messaging\n\n### Phase 4: Project Management 🔄 IN PROGRESS\n- [x] Milestones UI\n- [x] Roadmap visualization\n- [ ] Task management system\n- [ ] Progress tracking\n- [ ] Mentor feedback system\n- [ ] Submission workflow\n- [ ] File uploads\n\n### Phase 5: Polish & Launch ⏳ PENDING\n- [ ] Performance optimization\n- [ ] Testing (unit + integration)\n- [ ] Bug fixes\n- [ ] Documentation\n- [ ] Deployment to Vercel\n- [ ] SEO optimization\n- [ ] Analytics integration\n\n---\n\n## API Integration Plan\n\n### OpenAI Integration ✅ COMPLETE\n- [x] Install `openai` package\n- [x] Create API route `/api/brainstorm`\n- [x] Implement streaming responses with GPT-4o-mini\n- [x] Add rate limiting headers\n- [ ] Store chat history in database\n- [ ] Implement context window management\n- [ ] Add session persistence\n\n### Supabase Storage (Pending)\n- [ ] Enable storage in Supabase\n- [ ] Create `avatars` bucket\n- [ ] Implement profile picture upload\n- [ ] Add file upload for milestone submissions\n\n---\n\n## Testing Strategy\n\n### Manual Testing Checklist\n- [ ] Sign up flow (new user)\n- [ ] Sign in flow (existing user)\n- [ ] Logout functionality\n- [ ] Protected route redirection\n- [ ] Profile edit and save\n- [ ] View other user profiles\n- [ ] Mobile responsiveness\n- [ ] Sidebar navigation\n- [ ] Form validation\n\n### Automated Testing (Pending)\n- [ ] Unit tests for auth context\n- [ ] Integration tests for sign up/in\n- [ ] E2E tests with Playwright\n- [ ] Component tests with React Testing Library\n\n---\n\n## Deployment Checklist\n\n### Pre-Deployment\n- [ ] Environment variables configured\n- [ ] Database schema applied\n- [ ] RLS policies verified\n- [ ] Email confirmation enabled\n- [ ] Custom email templates configured\n- [ ] CORS configured for production domain\n- [ ] Error handling implemented\n- [ ] Loading states implemented\n\n### Vercel Deployment\n- [ ] Connect GitHub repository\n- [ ] Configure environment variables\n- [ ] Set build command: `npm run build`\n- [ ] Set output directory: `.next`\n- [ ] Configure custom domain\n- [ ] Enable HTTPS\n- [ ] Set up monitoring\n\n### Post-Deployment\n- [ ] Test full auth flow on production\n- [ ] Verify database connections\n- [ ] Test mobile responsiveness\n- [ ] Monitor error logs\n- [ ] Set up analytics\n\n---\n\n## Resources & References\n\n- **Supabase Docs:** https://supabase.com/docs\n- **Next.js Docs:** https://nextjs.org/docs\n- **Tailwind CSS:** https://tailwindcss.com/docs\n- **shadcn/ui:** https://ui.shadcn.com\n- **Lucide Icons:** https://lucide.dev\n\n---\n\n## Notes for Future Sessions\n\n### Current State\n- All UI pages are built and responsive\n- Authentication is fully functional with Supabase\n- Database schema is created with RLS policies\n- Profile system works (own + others with limited access)\n- Sidebar navigation is consistent across all pages\n- Mobile hamburger menu works correctly\n\n### Next Steps\n1. Add your OpenAI API key to `.env.local` to enable the Brainstorming AI chat\n2. Add real data to GP Library from database\n3. Implement team creation and management\n4. Add task CRUD operations for Milestones\n5. Implement mentor booking system\n6. Add file upload functionality\n7. Set up email notifications\n8. Deploy to Vercel\n\n### Important Context\n- Supabase project URL: https://tlocxrrjiuflhxvzayyy.supabase.co\n- Database trigger auto-creates profiles on signup\n- Use `.update()` not `.insert()` for profile creation in signUp\n- All protected pages use `<ProtectedRoute>` wrapper\n- Auth state is synced with localStorage for persistence\n- Console uses `[CLIENT]` and `[SERVER]` prefixes for logging\n- Brainstorming API route: `/api/brainstorm` uses GPT-4o-mini with streaming\n- OpenAI API key required in `.env.local` for chat to work\n\n---\n\n## Estimated Timeline\n- **Total Duration:** 12 weeks\n- **Team Size:** 2-4 developers recommended\n- **MVP Ready:** Week 8 (core features)\n- **Current Progress:** ~65% complete (UI done, OpenAI API integrated, backend integration in progress)\n"}, "2f9eba4a1221c790afadede4cd5e6bd612b2f093": {"t": 1785771586.5192764, "n": 4887, "h": "7e96270b2d1b4464", "c": "# GPSpark Project Plan\n\n## Technology Stack\n\n- **Frontend:** Next.js 14+ (App Router), TypeScript, Tailwind CSS, shadcn/ui components\n- **Backend:** Next.js API Routes + Server Actions\n- **Database:** Supabase (PostgreSQL + Auth + Real-time)\n- **AI Integration:** OpenAI GPT-4 API\n- **Deployment:** Vercel (frontend) + Supabase Cloud\n\n---\n\n## Core Features & Modules\n\n### 1. Landing Page (Public)\n- Hero section with CTA\n- Feature showcase (AI Brainstorming, Market Analysis, Team Building)\n- Project library preview\n- Testimonials/social proof\n- Footer with links\n\n### 2. Authentication & Onboarding\n- Email/password + OAuth (Google, GitHub)\n- Multi-step onboarding:\n - Step 1: Account Identity\n - Step 2: Academic Profile (GPA, year, interests)\n - Step 3: Career Goals\n- Progress tracking\n- Profile completion incentives\n\n### 3. Brainstorming AI\n- Chat interface with AI tutor\n- Project feasibility scoring (0-100%)\n- Market gap identification\n- Technical challenge analysis\n- Research structure suggestions\n- Export research summary (PDF)\n- Conversation history\n\n### 4. GP Library\n- Searchable project database\n- Filters: domain, year, tech stack, uniqueness score\n- Project cards with:\n - Uniqueness Factor score\n - Tech stack tags\n - Release date\n - Case study links\n- \"Analyze Architecture\" feature\n- Favorites system\n\n### 5. Team Formation\n- Student profiles with skills\n- Skill-based search and matching\n- Team creation and management\n- Team listings with open positions\n- Connect/request system\n- Availability status\n- Tips and guidelines\n\n### 6. Milestones & Project Management\n- Project roadmap visualization\n- Phase-based progress tracking\n- Task management within phases\n- Mentor feedback system\n- Submission workflow\n- Review archive\n- Discussion forums\n\n---\n\n## Database Schema (Supabase)\n\n```\nusers\n├── id (UUID)\n├── email\n├── full_name\n── university_email\n├── gpa\n── academic_year\n├── career_goals\n── avatar_url\n├── created_at\n── updated_at\n\nuser_skills\n├── id\n├── user_id (FK)\n├── skill_name\n└── proficiency_level\n\nuser_interests\n├── id\n── user_id (FK)\n└── interest_category\n\nprojects\n├── id\n├── title\n├── description\n├── domain\n├── tech_stack (array)\n├── uniqueness_score\n├── release_year\n├── case_study_url\n├── created_by (FK)\n└── created_at\n\nbrainstorm_sessions\n── id\n├── user_id (FK)\n├── project_focus\n├── feasibility_score\n├── market_gaps (JSON)\n── technical_challenges (JSON)\n├── created_at\n└── updated_at\n\nchat_messages\n├── id\n├── session_id (FK)\n├── role (user/assistant)\n├── content\n└── timestamp\n\nteams\n├── id\n├── name\n── description\n├── created_by (FK)\n├── status (seeking/full)\n── max_members\n└── created_at\n\nteam_members\n├── id\n├── team_id (FK)\n├── user_id (FK)\n├── role\n└── joined_at\n\nmilestones\n├── id\n├── project_id (FK)\n├── phase_name\n── phase_number\n├── status\n├── progress_percentage\n├── start_date\n├── end_date\n└── created_at\n\ntasks\n├── id\n├── milestone_id (FK)\n├── title\n├── description\n├── status\n├── due_date\n── assigned_to (FK)\n\nmentor_feedback\n── id\n├── milestone_id (FK)\n├── mentor_id (FK)\n├── feedback_text\n├── rating\n└── created_at\n```\n\n---\n\n## Development Phases\n\n### Phase 1: Foundation (Weeks 1-2)\n- [ ] Project setup (Next.js, TypeScript, Tailwind)\n- [ ] Supabase integration & authentication\n- [ ] Base UI components (shadcn/ui)\n- [ ] Navigation & layout structure\n- [ ] Landing page implementation\n\n### Phase 2: Core Features (Weeks 3-5)\n- [ ] User onboarding flow (3-step wizard)\n- [ ] Profile management\n- [ ] Brainstorming AI chat interface\n- [ ] OpenAI API integration\n- [ ] Chat message persistence\n\n### Phase 3: Library & Teams (Weeks 6-8)\n- [ ] GP Library with search & filters\n- [ ] Project card components\n- [ ] Uniqueness scoring algorithm\n- [ ] Team Formation page\n- [ ] Student profile cards\n- [ ] Team creation & management\n\n### Phase 4: Project Management (Weeks 9-10)\n- [ ] Milestones roadmap visualization\n- [ ] Task management system\n- [ ] Progress tracking\n- [ ] Mentor feedback system\n- [ ] Submission workflow\n\n### Phase 5: Polish & Launch (Weeks 11-12)\n- [ ] Responsive design optimization\n- [ ] Performance optimization\n- [ ] Testing (unit + integration)\n- [ ] Bug fixes\n- [ ] Documentation\n- [ ] Deployment\n\n---\n\n## Key Technical Considerations\n\n### 1. AI Integration\n- Rate limiting for OpenAI API calls\n- Streaming responses for chat\n- Context window management\n- Prompt engineering for academic focus\n\n### 2. Security\n- Row-level security (RLS) in Supabase\n- Input validation & sanitization\n- Rate limiting on API routes\n- Secure file uploads\n\n### 3. Performance\n- Server-side rendering for SEO\n- Image optimization\n- Database indexing\n- Caching strategies\n\n### 4. Scalability\n- Pagination for large datasets\n- Lazy loading components\n- CDN for static assets\n\n---\n\n## Estimated Timeline\n- **Total Duration:** 12 weeks\n- **Team Size:** 2-4 developers recommended\n- **MVP Ready:** Week 8 (core features)\n"}, "5b08e3e144bb84d880f64d1ea136ae98c49765eb": {"t": 1785771587.7108884, "n": 4887, "h": "f7cbf2b45d7d1462", "c": "# GPspark Project Plan\n\n## Technology Stack\n\n- **Frontend:** Next.js 14+ (App Router), TypeScript, Tailwind CSS, shadcn/ui components\n- **Backend:** Next.js API Routes + Server Actions\n- **Database:** Supabase (PostgreSQL + Auth + Real-time)\n- **AI Integration:** OpenAI GPT-4 API\n- **Deployment:** Vercel (frontend) + Supabase Cloud\n\n---\n\n## Core Features & Modules\n\n### 1. Landing Page (Public)\n- Hero section with CTA\n- Feature showcase (AI Brainstorming, Market Analysis, Team Building)\n- Project library preview\n- Testimonials/social proof\n- Footer with links\n\n### 2. Authentication & Onboarding\n- Email/password + OAuth (Google, GitHub)\n- Multi-step onboarding:\n - Step 1: Account Identity\n - Step 2: Academic Profile (GPA, year, interests)\n - Step 3: Career Goals\n- Progress tracking\n- Profile completion incentives\n\n### 3. Brainstorming AI\n- Chat interface with AI tutor\n- Project feasibility scoring (0-100%)\n- Market gap identification\n- Technical challenge analysis\n- Research structure suggestions\n- Export research summary (PDF)\n- Conversation history\n\n### 4. GP Library\n- Searchable project database\n- Filters: domain, year, tech stack, uniqueness score\n- Project cards with:\n - Uniqueness Factor score\n - Tech stack tags\n - Release date\n - Case study links\n- \"Analyze Architecture\" feature\n- Favorites system\n\n### 5. Team Formation\n- Student profiles with skills\n- Skill-based search and matching\n- Team creation and management\n- Team listings with open positions\n- Connect/request system\n- Availability status\n- Tips and guidelines\n\n### 6. Milestones & Project Management\n- Project roadmap visualization\n- Phase-based progress tracking\n- Task management within phases\n- Mentor feedback system\n- Submission workflow\n- Review archive\n- Discussion forums\n\n---\n\n## Database Schema (Supabase)\n\n```\nusers\n├── id (UUID)\n├── email\n├── full_name\n── university_email\n├── gpa\n── academic_year\n├── career_goals\n── avatar_url\n├── created_at\n── updated_at\n\nuser_skills\n├── id\n├── user_id (FK)\n├── skill_name\n└── proficiency_level\n\nuser_interests\n├── id\n── user_id (FK)\n└── interest_category\n\nprojects\n├── id\n├── title\n├── description\n├── domain\n├── tech_stack (array)\n├── uniqueness_score\n├── release_year\n├── case_study_url\n├── created_by (FK)\n└── created_at\n\nbrainstorm_sessions\n── id\n├── user_id (FK)\n├── project_focus\n├── feasibility_score\n├── market_gaps (JSON)\n── technical_challenges (JSON)\n├── created_at\n└── updated_at\n\nchat_messages\n├── id\n├── session_id (FK)\n├── role (user/assistant)\n├── content\n└── timestamp\n\nteams\n├── id\n├── name\n── description\n├── created_by (FK)\n├── status (seeking/full)\n── max_members\n└── created_at\n\nteam_members\n├── id\n├── team_id (FK)\n├── user_id (FK)\n├── role\n└── joined_at\n\nmilestones\n├── id\n├── project_id (FK)\n├── phase_name\n── phase_number\n├── status\n├── progress_percentage\n├── start_date\n├── end_date\n└── created_at\n\ntasks\n├── id\n├── milestone_id (FK)\n├── title\n├── description\n├── status\n├── due_date\n── assigned_to (FK)\n\nmentor_feedback\n── id\n├── milestone_id (FK)\n├── mentor_id (FK)\n├── feedback_text\n├── rating\n└── created_at\n```\n\n---\n\n## Development Phases\n\n### Phase 1: Foundation (Weeks 1-2)\n- [ ] Project setup (Next.js, TypeScript, Tailwind)\n- [ ] Supabase integration & authentication\n- [ ] Base UI components (shadcn/ui)\n- [ ] Navigation & layout structure\n- [ ] Landing page implementation\n\n### Phase 2: Core Features (Weeks 3-5)\n- [ ] User onboarding flow (3-step wizard)\n- [ ] Profile management\n- [ ] Brainstorming AI chat interface\n- [ ] OpenAI API integration\n- [ ] Chat message persistence\n\n### Phase 3: Library & Teams (Weeks 6-8)\n- [ ] GP Library with search & filters\n- [ ] Project card components\n- [ ] Uniqueness scoring algorithm\n- [ ] Team Formation page\n- [ ] Student profile cards\n- [ ] Team creation & management\n\n### Phase 4: Project Management (Weeks 9-10)\n- [ ] Milestones roadmap visualization\n- [ ] Task management system\n- [ ] Progress tracking\n- [ ] Mentor feedback system\n- [ ] Submission workflow\n\n### Phase 5: Polish & Launch (Weeks 11-12)\n- [ ] Responsive design optimization\n- [ ] Performance optimization\n- [ ] Testing (unit + integration)\n- [ ] Bug fixes\n- [ ] Documentation\n- [ ] Deployment\n\n---\n\n## Key Technical Considerations\n\n### 1. AI Integration\n- Rate limiting for OpenAI API calls\n- Streaming responses for chat\n- Context window management\n- Prompt engineering for academic focus\n\n### 2. Security\n- Row-level security (RLS) in Supabase\n- Input validation & sanitization\n- Rate limiting on API routes\n- Secure file uploads\n\n### 3. Performance\n- Server-side rendering for SEO\n- Image optimization\n- Database indexing\n- Caching strategies\n\n### 4. Scalability\n- Pagination for large datasets\n- Lazy loading components\n- CDN for static assets\n\n---\n\n## Estimated Timeline\n- **Total Duration:** 12 weeks\n- **Team Size:** 2-4 developers recommended\n- **MVP Ready:** Week 8 (core features)\n"}}}} |