Complete guide to setting up and running the EcoTrack monorepo locally.
- Node.js >= 18.0.0
- npm >= 9.0.0
- Python >= 3.11
- Docker and Docker Compose
- Git
EcoTrack/
├── apps/
│ ├── web/ # Next.js 15 frontend (React 19)
│ ├── api/ # NestJS backend API
│ └── ml-api/ # FastAPI ML service
├── packages/ # Shared packages (optional)
├── supabase/
│ └── migrations/ # Database migrations
├── .github/
│ └── workflows/ # CI/CD pipelines
├── docker-compose.yml # Docker orchestration
├── turbo.json # Turborepo configuration
└── package.json # Root package configuration
git clone https://github.com/ecotrack/ecotrack.git
cd EcoTracknpm installCopy environment files and configure:
# Frontend
cp apps/web/.env.example apps/web/.env.local
# Backend API
cp apps/api/.env.example apps/api/.env
# ML API
cp apps/ml-api/.env.example apps/ml-api/.envOption A: Use Supabase Cloud
- Create account at supabase.com
- Create new project
- Copy URL and keys to environment files
Option B: Self-hosted Supabase
# Run Supabase locally with Docker
docker-compose up postgres -d# Apply migrations to your Supabase database
# Using Supabase CLI (install: npm install -g supabase)
supabase db pushOption A: Run all services with Turborepo
npm run devOption B: Run services individually
# Terminal 1 - Frontend
cd apps/web
npm run dev
# Terminal 2 - Backend API
cd apps/api
npm run dev
# Terminal 3 - ML API
cd apps/ml-api
python main.pyOption C: Run with Docker Compose
docker-compose up- Frontend: http://localhost:3000
- Backend API: http://localhost:3001
- ML API: http://localhost:8000
- API Documentation: http://localhost:3001/api/docs
- ML API Documentation: http://localhost:8000/docs
# Run all tests
npm run test
# Run tests for specific workspace
npm run test --filter=@ecotrack/web# Lint all workspaces
npm run lint
# Format code
npm run format
# Type check
npm run type-check# Build all applications
npm run build
# Build specific workspace
npm run build --filter=@ecotrack/api- Framework: Next.js 15 with App Router
- React: Version 19
- Styling: Tailwind CSS + shadcn/ui
- Forms: React Hook Form + Zod
- Maps: React Leaflet
- State: React Server Components
- Framework: NestJS 10
- Language: TypeScript (strict mode)
- Validation: class-validator + class-transformer
- Documentation: Swagger/OpenAPI
- Database: Supabase (PostgreSQL + Auth + Storage)
- Cache: Redis
- Framework: FastAPI
- Object Detection: YOLOv8 (Ultralytics)
- Classification: PyTorch + Transformers
- Image Processing: OpenCV, Pillow
- Deployment: Uvicorn
- id: UUID (primary key)
- species: VARCHAR(255)
- latitude: DECIMAL(10,8)
- longitude: DECIMAL(11,8)
- estimated_age: INTEGER
- root_spread: DECIMAL(10,2)
- soil_type: VARCHAR(100)
- height: DECIMAL(10,2)
- canopy_diameter: DECIMAL(10,2)
- metadata: JSONB
- user_id: UUID (foreign key)
- created_at: TIMESTAMP
- updated_at: TIMESTAMP# Build all services
docker-compose build
# Build specific service
docker-compose build web# Start all services
docker-compose up
# Start in detached mode
docker-compose up -d
# View logs
docker-compose logs -f
# Stop services
docker-compose down- Connect repository to Vercel
- Configure environment variables
- Deploy automatically on push to main
# Railway
railway up
# Fly.io
fly deploycd apps/ml-api
fly deploy# Windows
netstat -ano | findstr :3000
taskkill /PID <PID> /F
# Linux/Mac
lsof -ti:3000 | xargs kill -9# Clean up Docker
docker-compose down -v
docker system prune -a
# Rebuild without cache
docker-compose build --no-cache# Clear node_modules and reinstall
rm -rf node_modules apps/*/node_modules
npm install- Create feature branch:
git checkout -b feature/your-feature - Commit changes:
git commit -m "feat: add your feature" - Push to branch:
git push origin feature/your-feature - Create Pull Request
Follow Angular commit convention:
feat: New featurefix: Bug fixdocs: Documentation changesstyle: Code style changesrefactor: Code refactoringtest: Test changeschore: Build/tooling changes
- Next.js Documentation
- NestJS Documentation
- FastAPI Documentation
- Supabase Documentation
- Turborepo Documentation
For issues and questions:
- Create an issue on GitHub
- Check existing documentation
- Review closed issues for solutions
MIT License - see LICENSE file for details