This guide will walk you through setting up the local development environment from scratch.
Before starting, ensure you have:
-
Docker Desktop installed and running
- Download: https://www.docker.com/products/docker-desktop
- Make sure Docker Desktop is started (green icon in system tray)
-
Node.js 18+ installed
- Download: https://nodejs.org/
- Verify:
node --version(should show v18 or higher)
-
npm (comes with Node.js)
- Verify:
npm --version
- Verify:
Open your terminal/command prompt and navigate to the project directory:
cd /Users/fashad/fashad/projects/SymposAI_backenddocker infoExpected output: Docker information (not an error)
If error: Start Docker Desktop application
Run the automated setup script:
./scripts/setup-local.shWhat this does:
- ✅ Checks if Docker, Node.js, and npm are installed
- ✅ Installs project dependencies (
npm install) - ✅ Installs Supabase CLI globally (if needed)
- ✅ Starts Supabase with Docker
- ✅ Updates your
.env.development.localwith Supabase credentials
Expected output:
╔════════════════════════════════════════╗
║ SymposAI Local Development Setup づ
╚════════════════════════════════════════╝
🔍 Checking prerequisites...
✓ Docker is running
✓ Node.js is installed (v18.x.x)
✓ npm is installed (9.x.x)
✓ Supabase CLI is installed
📦 Installing npm dependencies...
...
🐳 Starting Supabase with Docker...
...
📋 Supabase Status:
API URL: http://localhost:54321
Studio URL: http://localhost:54323
...
✓ .env.development.local found
✓ Updated SUPABASE_URL
✓ Updated SUPABASE_ANON_KEY
✓ Updated SUPABASE_SERVICE_ROLE_KEY
✓ Updated JWT_SECRET
✅ Setup complete!
supabase statusExpected output:
API URL: http://localhost:54321
DB URL: postgresql://postgres:postgres@localhost:54322/postgres
Studio URL: http://localhost:54323
Inbucket URL: http://localhost:54324
anon key: eyJhbGc... (long string)
service_role key: eyJhbGc... (long string)
Check that your .env.development.local has been updated:
# On Mac/Linux:
cat .env.development.local | grep SUPABASE
# Or open in your editor:
code .env.development.localYou should see:
SUPABASE_URL=http://localhost:54321SUPABASE_ANON_KEY=eyJhbG...(long key)SUPABASE_SERVICE_ROLE_KEY=eyJhbG...(long key)JWT_SECRET=...(secret key)
Edit .env.development.local and add your LLM API keys:
# Open in your favorite editor:
code .env.development.local
# or
nano .env.development.local
# or
vim .env.development.localRequired keys (minimum for testing):
OPENAI_API_KEY=sk-your-actual-openai-key-here
GROK_API_KEY=your-actual-grok-key-hereOptional keys (only if testing those models):
ANTHROPIC_API_KEY=sk-ant-your-key
DEEPSEEK_API_KEY=your-deepseek-key
GOOGLE_API_KEY=your-google-keySave the file after adding your keys.
npm run start:devExpected output:
> [email protected] start:dev
> cross-env NODE_ENV=development.local nest start --watch
[Nest] 12345 - 01/01/2024, 12:00:00 PM LOG [NestFactory] Starting Nest application...
[Nest] 12345 - 01/01/2024, 12:00:00 PM LOG [InstanceLoader] AppModule dependencies initialized
...
Application is running on: http://0.0.0.0:3000
The server is now running! 🎉
Open a new terminal window (keep the server running) and test:
# Test health endpoint
curl http://localhost:3000/api/v1/health
# Or use the test script
./scripts/test-api.shOpen your browser and go to:
http://localhost:54323
This gives you a visual interface to:
- View database tables
- Run SQL queries
- Manage data
- Test authentication
- Open Postman
- Go to Settings (gear icon in top right)
- Click General tab
- Enable:
- ✅ "Send cookies"
- ✅ "Follow redirects"
- Click Save
- Click New → Collection
- Name it "SymposAI Local"
Register/Login:
POST http://localhost:3000/api/v1/auth/register
POST http://localhost:3000/api/v1/auth/login
User:
GET http://localhost:3000/api/v1/user/me
Debate:
POST http://localhost:3000/api/v1/debate/start
GET http://localhost:3000/api/v1/debate/:id
-
Login:
- Select
POST /auth/login - Body (raw JSON):
{ "email": "[email protected]", "password": "TestPass123!" } - Click Send
- Cookies are automatically saved! ✅
- Select
-
Get User:
- Select
GET /user/me - Click Send
- Cookies are automatically included! ✅
- Select
Solution:
- Open Docker Desktop application
- Wait for it to start (whale icon should be stable)
- Try again:
docker info
Solution:
# Check what's using the port
lsof -i :3000
lsof -i :54321
# Kill the process (replace PID with actual process ID)
kill -9 PID
# Or restart Supabase
supabase stop
supabase startSolution:
# Check Supabase status
supabase status
# If not running, restart
supabase stop
supabase start
# Verify .env.development.local has correct URL
cat .env.development.local | grep SUPABASE_URLSolution:
- Check that all required fields in
.env.development.localare filled - Make sure there are no extra spaces or quotes around values
- Verify file is named exactly:
.env.development.local
Solution:
- Postman Settings → General → Ensure "Send cookies" is enabled
- Click Cookies link below address bar to view/manage cookies
- Clear cookies: Manage Cookies → Select domain → Clear
# Start everything
./scripts/setup-local.sh
# Start Supabase only
supabase start
# Start backend only
npm run start:dev
# Stop Supabase
supabase stop
# Stop backend
Ctrl+C (in terminal running server)
# View Supabase status
supabase status
# View Supabase logs
supabase logs
# Reset database
supabase db reset
# Test API
./scripts/test-api.shOnce everything is running:
- Backend API: http://localhost:3000
- API Base: http://localhost:3000/api/v1
- Supabase Studio: http://localhost:54323
- Email Testing: http://localhost:54324
- Database: localhost:54322
- ✅ Setup complete
- ✅ Backend running
- ✅ Supabase running
- 📝 Test endpoints in Postman
- 🧪 Try creating a debate
- 🎉 Start developing!
- Check
DOCKER_SETUP.mdfor detailed Docker setup - Check
LOCAL_SETUP.mdfor comprehensive local setup guide - Check
QUICK_START.mdfor quick reference