Prerequisites
Before setting up BoxApp locally, ensure you have the following installed:- Node.js v18 or higher
- npm v9 or higher
- Supabase CLI v1.200.0 or higher
- Git for version control
BoxApp is built with React 18, TypeScript 5, and Vite 4. Make sure your development environment supports these technologies.
Installation
Install dependencies
Install all required npm packages:This installs core dependencies including:
- React 18.2 - UI framework
- TypeScript 5.0 - Type safety
- Vite 4.4 - Build tool and dev server
- Supabase JS 2.94 - Backend client
- Radix UI - Headless UI components
- Tailwind CSS 3.4 - Utility-first styling
- React Router 7.13 - Client-side routing
Configure environment variables
Create a Then update the values with your Supabase credentials. See Environment Variables for details.
.env file in the project root by copying the example file:Set up Supabase local development
Initialize and start the local Supabase instance:This command will:
- Start PostgreSQL database on port
54322 - Start API server on port
54321 - Run all pending migrations
- Seed the database with initial data
Run database migrations
Apply all database migrations to set up the schema:This runs
supabase db push to sync your local migrations with the database.Development Workflow
Available Scripts
BoxApp includes several npm scripts for common development tasks:Project Structure
The BoxApp codebase follows a standard React + TypeScript structure:Path Aliases
BoxApp uses TypeScript path aliases for cleaner imports:@/ alias maps to the src/ directory, configured in:
tsconfig.json:22-24- TypeScript path resolutionvite.config.ts:8-10- Vite bundler alias
TypeScript Configuration
BoxApp uses strict TypeScript settings for maximum type safety:tsconfig.json
Linting
BoxApp uses ESLint with TypeScript and React plugins:.eslintrc.cjs
Troubleshooting
Port conflicts
If ports 5173, 54321, or 54322 are already in use:- Stop conflicting services
- Or modify ports in
vite.config.tsandsupabase/config.toml
Supabase connection issues
If you see Supabase credential warnings:- Verify
.envfile exists with correct values - Restart the dev server after updating environment variables
- Check that Supabase local instance is running:
npx supabase status
Migration errors
If migrations fail:Next Steps
Once your development environment is set up:- Review Environment Variables configuration
- Learn about Database Migrations
- Explore the Component Library
- Start building features!