A modern full-stack application that uses multi-provider AI to generate personalized tests and study materials from any text content, with advanced analytics and learning insights.
For comprehensive project documentation, see:
- Project Documentation - Technical overview, architecture, and implementation details
- Context & Vision - Project vision, learning science foundation, and future roadmap
- Architecture Analysis - Frontend/backend architecture and component analysis
- AI Integration Plan - Multi-provider AI system design and implementation
- Deployment Guide - Production deployment instructions
- Database Schema - Complete PostgreSQL schema and views
studywise-ai/
├── client/ # React frontend application
│ ├── src/
│ │ ├── components/ # Reusable UI components
│ │ ├── pages/ # Page components
│ │ ├── stores/ # Zustand state management
│ │ ├── contexts/ # React contexts
│ │ ├── hooks/ # Custom React hooks
│ │ ├── lib/ # Utilities and configurations
│ │ ├── types/ # TypeScript type definitions
│ │ ├── utils/ # Helper functions
│ │ └── services/ # API service functions
│ ├── public/
│ └── index.html
├── server/ # Node.js/Express backend
│ ├── controllers/ # Route handlers
│ ├── services/ # Business logic (AI, database)
│ ├── lib/ # Database and utility functions
│ ├── routes.ts # API route definitions
│ ├── index.ts # Server entry point
│ ├── config.ts # Server configuration
│ └── storage.ts # Legacy storage (deprecated)
├── shared/ # Shared types and utilities
├── config/ # Configuration files
│ ├── vite.config.ts # Frontend build configuration
│ ├── tsconfig.json # TypeScript configuration
│ └── tailwind.config.ts # Styling configuration
├── scripts/ # Build and deployment scripts
├── docs/ # Documentation
├── supabase/ # Database migrations and config
└── src/ # Legacy source directory (deprecated)
- Node.js 18+
- npm or yarn
- Git
-
Clone the repository
git clone <repository-url> cd studywise-ai
-
Install dependencies
npm install
-
Set up environment variables
cp .env.example .env # Edit .env with your API keys -
Start development servers individually
# Terminal 1: Start the backend server npm run dev:server # Terminal 2: Start the frontend client npm run dev:client
-
Open your browser
- Frontend: http://localhost:8080 (or next available port)
- Backend API: http://localhost:5000
-
Configure API endpoint
- For local development:
VITE_API_URL=http://localhost:5000in.env - For production:
VITE_API_URL=https://your-backend-API.comin.env
- For local development:
npm run dev:client # Start only frontend (Vite dev server)
npm run dev:server # Start only backend (Express server)npm run build # Build both client and server
npm run build:client # Build only frontend
npm run build:server # Build only backendnpm run start:prod # Start production server
npm run preview # Preview built clientnpm run test:deployment # Test deployment readinessCreate a .env file in the project root:
# AI Configuration
GEMINI_API_KEY=your_gemini_api_key
DEEPSEEK_API_KEY=your_deepseek_api_key
OPENROUTER_API_KEY=your_openrouter_api_key
HUGGING_FACE_API_KEY=your_hugging_face_api_key
# Database & Auth
VITE_SUPABASE_URL=your_supabase_project_url
VITE_SUPABASE_ANON_KEY=your_supabase_anon_key
# API Configuration
VITE_API_URL=http://localhost:5000
# Server
NODE_ENV=development
PORT=5000POST /api/courses/generate- Generate a course from a topic or textPOST /api/courses/:courseId/modules/:moduleId/test/generate- Generate a module-specific testPOST /api/tests/:testId/submit- Submit test answers and calculate resultsGET /api/tests/:testId/result- Retrieve detailed test performancePOST /api/tests/:testId/insights/request- Generate AI-powered performance analysisGET /api/results/courses- Retrieve course-level performance metricsGET /api/results/courses/:courseId/modules- Retrieve module-level breakdownGET /health- Health check endpoint
- Framework: React 18 with TypeScript
- Build Tool: Vite
- Styling: Tailwind CSS + shadcn/ui
- State Management: Zustand
- Routing: Wouter
- API Client: Custom hooks with React Query
- Runtime: Node.js with TypeScript
- Framework: Express.js
- AI Integration: Multi-provider failover system (Gemini 2.0 Flash, DeepSeek, OpenRouter, Hugging Face)
- Authentication: Supabase Auth
- Database: Supabase (PostgreSQL) with Row-Level Security (RLS)
- Deployment: Render (Backend) & Netlify/Vercel (Frontend)
- Caching: In-memory caching for AI responses
- Rate Limiting: Intelligent throttling across AI providers
- Multi-Provider AI System: Intelligent failover between Gemini 2.0 Flash, DeepSeek V3, OpenRouter, and Hugging Face models
- Intelligent Failover: Automatic retry logic that switches providers if one fails or hits rate limits
- Source-Linked Context: Every question is generated with deep context from the provided source material
- AI-Powered Insights: Automated performance analysis identifying strengths, weaknesses, and custom study plans
- Progress Intelligence: Detailed course and module-level analytics with mastery tracking
- Premium Test Experience: Real-time duration tracking, case-insensitive grading, and documentation-style reviews
- Secure Architecture: Supabase Row-Level Security (RLS) protecting all user data
- Connect your GitHub repository to Render
- Create a Blueprint deployment using
render.yaml - Configure environment secrets
- Deploy automatically
- Build the client:
npm run build:client - Deploy
dist/public/directory - Configure environment variables:
VITE_API_URL- Backend API URLVITE_SUPABASE_URL- Supabase project URLVITE_SUPABASE_ANON_KEY- Supabase anonymous key
See docs/RENDER_DEPLOYMENT.md for detailed instructions.
npm run test:deploymentThis script validates:
- Environment variables configuration
- Project file structure integrity
- Server startup and health checks
- API endpoint connectivity
- Build process validation
src/components/- Reusable UI components and overlayssrc/pages/- Page components (dashboard, landing, settings, etc.)src/stores/- Zustand state management storessrc/contexts/- React context providers (auth, etc.)src/hooks/- Custom React hookssrc/lib/- Utilities, API clients, and configurationssrc/types/- TypeScript type definitionssrc/utils/- Helper functions and utilitiessrc/services/- API service functionssrc/auth/- Authentication components
controllers/- Route handlers and business logicservices/- AI services and external integrationslib/- Database services and utilitiesroutes.ts- API route definitionsindex.ts- Server entry pointconfig.ts- Server configuration and environment setup
schema.ts- Database schema definitions
vite.config.ts- Frontend build configurationtsconfig.json- TypeScript configurationtailwind.config.ts- Styling configuration
CONTEXT.md- Comprehensive project overview and contextPROJECT_DOCUMENTATION.md- Technical documentationARCHITECTURE_ANALYSIS.md- Architecture decisionsRENDER_DEPLOYMENT.md- Deployment guidebackend_documentation_2025-09-12.md- Complete backend API documentationai-plan.md- Multi-provider AI integration planzustant-state-management-setup.md- State management implementationdatabase_schema.sql- Database schemasupabase_and_OAuth_setup.md- Supabase and OAuth configuration
test-deployment.js- Pre-deployment testing and validation
migrations/- Database migration filesconfig.toml- Supabase project configuration
- Fork the repository
- Create a feature branch
- Make your changes
- Run tests:
npm run test:deployment - Submit a pull request
This project is licensed under the GNU GPL version 3 - see the LICENSE file for details.
- Issues: GitHub Issues
- Documentation: See the Documentation section above
- Deployment: Render Deployment Guide
Built with React, TypeScript, Express, and AI