System Requirements
Before installing Maxw AI, ensure your system meets these requirements:Hardware Requirements
- RAM: Minimum 4GB, recommended 8GB or more
- Storage: At least 2GB free space for dependencies and database
- CPU: Modern multi-core processor (development servers can be resource-intensive)
Software Requirements
Operating System
- macOS 11 or later
- Linux (Ubuntu 20.04+, Debian 11+)
- Windows 10/11 with WSL2
Runtime & Database
- Bun 1.2.21 or later
- PostgreSQL 14 or later
- Node.js 18+ (for React Native)
Installing Bun Package Manager
Maxw AI uses Bun as its package manager and runtime. Bun is significantly faster than npm or yarn and provides excellent TypeScript support.macOS and Linux
Install Bun using the official installer:Windows
Bun runs on Windows via WSL2 (Windows Subsystem for Linux):- Install WSL2 following Microsoft’s guide
- Open your WSL2 terminal (Ubuntu recommended)
- Install Bun using the Linux instructions above
Bun is required for this project. npm, yarn, and pnpm are not supported.
Setting Up PostgreSQL
Maxw AI requires a PostgreSQL database for storing user data, todos, study sets, and AI memory.Option 1: Local PostgreSQL
Option 2: Neon Serverless PostgreSQL (Recommended for Production)
Maxw AI is optimized for Neon, a serverless PostgreSQL provider:- Sign up at neon.tech
- Create a new project
- Copy the connection string
- Use it as your
DATABASE_URLenvironment variable
Neon offers a generous free tier and is recommended for production deployments on Vercel.
Verify PostgreSQL Connection
Test your database connection:Installing Project Dependencies
Clone the Repository
Clone the Maxw AI repository:Install Dependencies
Install all dependencies for the monorepo:- Web application (
apps/web) - Mobile application (
apps/native) - Shared packages (if any)
What gets installed?
What gets installed?
The project uses Bun workspaces to manage the monorepo. Key dependencies include:Web App:
- Next.js 16 with React 19
- AI SDK with Anthropic integration
- Drizzle ORM and database tools
- TailwindCSS 4 and shadcn/ui
- Better-Auth for authentication
- Upstash Search for Canvas indexing
- React Native with Expo
- Shared UI components
- Better-Auth Expo integration
- Biome for linting and formatting
- Turborepo for build orchestration
- TypeScript for type checking
Environment Configuration
Create Environment File
Create a.env file in the repository root (not in apps/web/):
Required Environment Variables
Add these variables to your.env file:
.env
Optional: Mobile App Environment
For mobile development, createapps/native/.env:
apps/native/.env
Optional: Web App Environment
For web-specific configuration, createapps/web/.env:
apps/web/.env
Environment Variable Reference
Here’s a complete reference of all environment variables:DATABASE_URL
DATABASE_URL
PostgreSQL connection string in the format:Example with Neon:
AUTH_SECRET
AUTH_SECRET
Secret key for Better-Auth session encryption. Generate with:Must be at least 32 characters long and kept secure.
UPSTASH_SEARCH_*
UPSTASH_SEARCH_*
Upstash Search credentials for indexing Canvas LMS content:
UPSTASH_SEARCH_URL: Your Upstash Search endpointUPSTASH_SEARCH_TOKEN: Server-side token (full access)NEXT_PUBLIC_UPSTASH_SEARCH_TOKEN: Client-side token (read-only)
ANTHROPIC_API_KEY
ANTHROPIC_API_KEY
Anthropic API key for Claude Sonnet 4.5. Required for the AI chat feature.Get your API key from console.anthropic.com.Format:
sk-ant-api03-...OPENAI_API_KEY
OPENAI_API_KEY
OpenAI API key used for generating embeddings when indexing Canvas content.Get your API key from platform.openai.com.Format:
sk-...GOOGLE_GENERATIVE_AI_API_KEY
GOOGLE_GENERATIVE_AI_API_KEY
Optional Google AI API key for additional AI features.Get from ai.google.dev.
Database Initialization
After configuring your environment variables, initialize the database:Push Schema to Database
Push the Drizzle schema to your PostgreSQL database:- Reads your
DATABASE_URLfrom the root.envfile - Connects to PostgreSQL
- Creates all tables defined in
apps/web/src/db/schema/:user- User accountssession- Authentication sessionsaccount- OAuth provider credentialsverification- Email verification tokenstodo- Task items with Canvas linkingstudySetandstudySetItem- Study materialsmemory- AI persistent memory
For development, use
bun db:push. For production, use migrations with bun db:migrate.Generate Migration Files (Optional)
If you need to create migration files for version control:apps/web/src/db/migrations/.
View Database with Drizzle Studio
Explore your database visually:http://localhost:4983 where you can:
- View all tables and relationships
- Browse and edit data
- Run SQL queries
- Inspect schema structure
Development Setup
Start Development Servers
Start all applications in development mode:Development Server Details
Web App (bun dev:web):
- Runs on
http://localhost:3000 - Uses Next.js 16 with Turbopack for fast refresh
- API routes available at
/api/* - Hot module replacement enabled
bun dev:native):
- Starts Expo development server
- Accessible via Expo Go app (scan QR code)
- iOS simulator: Press
i - Android emulator: Press
a
Code Quality Tools
Run Biome for formatting and linting:- Formats all code with Biome’s rules (double quotes, spaces)
- Sorts imports and Tailwind classes
- Fixes auto-fixable issues
- Reports remaining errors
This project uses Biome, not ESLint or Prettier. Biome is configured for double quotes and space indentation.
Production Setup
Build for Production
Build all applications:Production Environment Variables
For production deployments, add these additional variables:.env.production
Database Migrations for Production
For production, use migrations instead ofdb:push:
-
Generate migration files:
-
Review generated SQL in
apps/web/src/db/migrations/ -
Run migrations:
Deployment Recommendations
Vercel
Recommended for Web App
- Zero-config deployment
- Automatic preview URLs
- Built-in analytics
- Edge function support
Expo EAS
Recommended for Mobile App
- Build iOS and Android apps
- Over-the-air updates
- Submission to app stores
- Integrated with Expo ecosystem
Troubleshooting
Bun installation fails
Bun installation fails
If Bun installation fails:macOS/Linux:
- Ensure you have
curlinstalled:which curl - Try manual installation from bun.sh/install
- Check system requirements: 64-bit system required
- Ensure WSL2 is properly installed and updated
- Run
wsl --updateto get latest WSL version - Install Bun inside WSL, not in Windows directly
PostgreSQL connection refused
PostgreSQL connection refused
If you can’t connect to PostgreSQL:
-
Check if PostgreSQL is running:
-
Verify the port (usually 5432):
-
Check
pg_hba.conffor connection permissions -
For Docker, ensure container is running:
Database schema push fails
Database schema push fails
If
bun db:push fails:- Verify your
DATABASE_URLin root.env(notapps/web/.env) - Check PostgreSQL version:
psql --version(need 14+) - Ensure database exists:
createdb maxw_ai - Check database permissions
- Review error message for specific table/column issues
Module not found errors
Module not found errors
If you see module resolution errors:
-
Clear Bun cache:
-
Clear Next.js cache:
-
Ensure you’re using Bun, not npm:
TypeScript errors in IDE
TypeScript errors in IDE
If you see TypeScript errors in your IDE:
- Ensure TypeScript extension is installed
- Reload IDE window
- Check TypeScript version:
- Verify workspace is opened at repo root, not subdirectory
Anthropic API errors
Anthropic API errors
If AI chat fails with API errors:
- Verify your
ANTHROPIC_API_KEYis correct - Check API key has not expired
- Ensure you have API credits: console.anthropic.com
- Check browser console (F12) for detailed error messages
- Review server logs for API response details
Expo mobile app won't connect
Expo mobile app won't connect
If mobile app can’t connect to server:
- Ensure web server is running:
bun dev:web - Check
EXPO_PUBLIC_SERVER_URLinapps/native/.env - Use your computer’s local IP, not
localhost: - Ensure mobile device is on same WiFi network
- Check firewall isn’t blocking port 3000
Next Steps
Your installation is complete! Here’s what to do next:Quickstart Guide
Follow the quickstart to create your first account and chat
AI Features
Learn about the AI assistant capabilities
Canvas Integration
Connect your Canvas LMS account
Development Guide
Learn about the codebase architecture
For questions or issues, check the GitHub repository’s issues page or join the community discussions.