Application for DUMP futsal tournament
Backend (API):
- NestJS - Backend framework
- Prisma - ORM for database
- PostgreSQL - Relational database
Frontend (Web):
Monorepo Management:
Before running the project, make sure you have the following installed:
- Node.js (v20 recommended)
- Yarn (v3.6.4 or higher)
- Docker and Docker Compose
futsal-app/
├── apps/
│ ├── api/ # NestJS backend
│ ├── admin/ # Admin React frontend (served at /admin)
│ └── app/ # Public React frontend (served at /)
├── packages/
│ └── types/ # Shared TypeScript types
├── infrastructure/ # Project infrastructure
├── compose.yml # Docker compose file
├── turbo.json # Turborepo configuration
-
Clone the repository:
git clone https://github.com/dump-hr/futsal-app.git cd futsal-app -
Install dependencies:
yarn install
-
Set up environment variables:
Create a
.envfile in theapps/apidirectory with the following content:DATABASE_URL="postgresql://dumpovac:dump1234@localhost:3001/futsal-db?schema=public"
Start the PostgreSQL database using Docker Compose in the root directory:
docker compose up -dThis will start a PostgreSQL 15 container with:
- Database: futsal-db
- User: dumpovac
- Password: dump1234
- Port: 3001 (mapped to 5432 inside the container)
Generate the Prisma client and apply migrations:
# Generate Prisma client
yarn db:generate
# Apply database migrations
yarn db:migrateRun the API and both frontend applications in development mode:
yarn devThis will start:
- API at
http://localhost:3000(default NestJS port) - Web at
http://localhost:5173(default Vite port) - App at
http://localhost:5174
To run only the API:
yarn workspace api run devTo run only the Admin app:
yarn workspace admin run devTo run only the App:
yarn workspace app run dev| Command | Description |
|---|---|
yarn db:generate |
Generate Prisma client from schema |
yarn db:migrate |
Create and apply new migrations |
yarn db:studio |
Open Prisma Studio (database GUI) |
yarn db:seed |
Seed the database with initial data |
yarn prisma |
Run Prisma CLI commands |
- Modify the Prisma schema in
apps/api/prisma/schema.prisma - Run the migration command:
yarn db:migrate
- Enter a name for your migration when prompted
The project uses a shared types package (@futsal-app/types) located in packages/types/ that contains DTOs and enums used by the API, Admin, and App applications.
-
Create or modify type files in
packages/types/src/:packages/types/src/ ├── index.ts # Main export file ├── enum.ts # Shared enums └── dto/ └── tournament.ts # DTO definitions -
Export the new type from
packages/types/src/index.ts:export * from './dto/tournament'; export * from './dto/your-new-dto'; // Add your new export export * from './enum';
-
Build the types package:
yarn workspace @futsal-app/types run build
-
Use the types in your API or Web app:
import { TournamentDto, Group } from '@futsal-app/types';