- TypeScript
- React
- Next.js App Router
- TanStack Router (React Router)
- Tailwind CSS
- Radix UI for accessible components
- SWR for data fetching
- Node.js
- Express
- Supabase (for database, authentication, and real-time features)
The project is structured as a monorepo using Yarn workspaces and Turborepo:
/apps
/client - Frontend React application
/api - Backend Express API service
/supabase-rest - Supabase REST API configuration
/shared - Shared types and utilities
- Node.js (v18+ recommended)
- Yarn package manager
- Docker and Docker Compose
-
Clone the repository
git clone https://github.com/yourusername/deforum.git cd deforum
-
Copy environment variables
cp .env.example .env
The .env file contains all necessary configuration for both the main application and Supabase services, including API, client, database, and authentication settings.
-
Install dependencies
yarn install
-
Start the development environment using Docker
docker compose up
This command sets up all required services:
- PostgreSQL
- PostgREST API
- Backend API service
- Frontend client application
Note: Initial Docker build can take several minutes (2-3 minutes). For faster development, consider running only specific services or using local development.
Alternatively, you can use the Yarn script which wraps Docker Compose:
yarn dev
-
Your application should now be running at:
- Frontend: http://localhost:3000
- API: http://localhost:8000/api
- PostgREST API: http://localhost:3001
If you want to work only on the frontend without starting all services:
cd apps/client
yarn dev
To work only on the backend API:
cd apps/api
yarn dev
yarn build
docker compose up
- Start all servicesdocker compose down
- Stop all servicesyarn generate
- Generate TanStack Router filesyarn clean
- Clean build artifactsyarn build
- Build all applications
- Change the prisma schema
- Make migrations
npx prisma migrate dev --name descriptive_name
- (if the db is up)
npx prisma migrate deploy
- Generate prisma ORM client
npx prisma generate
- Update the
shared/src/schemas
- Update the seed.ts file
- Update routers on the backend
- Update the front end