Architecture
inspir is a full-stack application with three main components:Prerequisites
Before deploying inspir, ensure you have:Required
- Node.js 18+ - Runtime for both frontend and backend
- npm - Package manager (comes with Node.js)
- Supabase project with:
- Project URL
- Anon (public) key
- Service role key (for backend)
- Anthropic API key - For Claude AI models (Get one here)
For Production Deployment
- Ubuntu 20.04+ server (or similar Linux distribution)
- Domain name with DNS configured
- nginx - Web server and reverse proxy
- PM2 or systemd - Process management for Node.js
- SSL certificate - Recommended: Let’s Encrypt (free)
- Git - For code deployment
Deployment Options
Option 1: Local Development
Run both frontend and backend in development mode on your local machine.Perfect for development, testing, and trying out inspir before deploying to production.
- Development and testing
- Feature experimentation
- Learning the codebase
Option 2: Production Server
Deploy to a production Ubuntu server with nginx, SSL, and PM2/systemd. Best for:- Production use
- Public-facing instances
- Team deployments
Environment Variables Overview
Both frontend and backend require environment variables for configuration.Backend Environment Variables
Frontend Environment Variables
All environment variables prefixed with
VITE_ are embedded into the frontend build and are publicly visible.Database Setup
The Supabase PostgreSQL database requires schema setup before the application can function. Key tables:quizzes- Generated quizzesquiz_results- Quiz scores and answersquiz_attempts- Shared quiz attemptsflashcard_decks- Flashcard collectionscornell_notes- Cornell-style notesstudy_activity- Daily activity trackinguser_streaks- Streak gamificationdoubt_questions- AI homework helpcitations- Citation generator dataforum_posts- Student forum- And 30+ more feature tables
Security Considerations
Essential Security Steps
- Never commit
.envfiles to version control - Use strong JWT secrets (32+ random characters)
- Enable SSL/TLS for production (HTTPS only)
- Configure CORS properly in backend
- Enable Supabase RLS policies (Row Level Security)
- Keep dependencies updated (
npm audit) - Use firewall rules to restrict access
- Secure API keys (never expose in frontend)
Next Steps
Choose your deployment path:Set up database
Create your Supabase project and run the SQL schema scripts.Database Setup →
Configure environment
Set up environment variables for your deployment type.Local Setup → or Production →