This repository contains a small monorepo for the Linqyard project: a .NET 9 API and a Next.js frontend. This README explains how to get the project running locally for development and production-style Docker runs.
backend_dotnet/- .NET 9 API (Linqyard.Api and related projects)frontend_nextjs/- Next.js frontend appdocker-compose.yml- Production-ish Compose file (build images and expose ports)docker-compose.override.yml/docker-compose.override.example.yml- Development overrides with bind mounts and hot reload
- Docker & Docker Compose (Desktop or Engine)
- Node.js 18+ and npm (for running frontend locally without Docker)
- .NET 9 SDK (if you want to run the .NET backend locally without Docker)
Notes for Windows: run Docker Desktop and ensure Docker can bind to the required ports. When running the frontend in Docker, host.docker.internal is used to reach the host services (e.g. the .NET API mapped on host port 5000).
- .NET API (inside container): 8080 -> Host: 5000
- Next.js frontend: 3000 -> Host: 3000
This uses the top-level docker-compose.yml. For development you can use the override which mounts local source and enables hot reload.
-
Copy or create a
.envfile at the repo root (Docker Compose references.env). The repository includes examples for env usage in compose; fill any required values. -
Start services (build images then run):
# Build and start all services in foreground
docker compose up --build
# Or run in detached mode
docker compose up --build -d- Visit the apps in your browser:
- Frontend: http://localhost:3000
- .NET API: http://localhost:5000
To stop and remove containers created by Compose:
docker compose downThe project includes docker-compose.override.yml which is intended for development. It bind-mounts local source into the containers and runs dotnet watch and the Next.js dev server.
To use it (Compose automatically picks up docker-compose.override.yml):
docker compose up --buildBehavior in the override:
.NETservice runsdotnet watch runand is reachable at http://localhost:5000Next.jsrunsnpm run devand is reachable at http://localhost:3000; it is configured to call the backend viaNEXT_PUBLIC_API_URL=http://host.docker.internal:5000by default in the override
If you prefer to run the .NET API locally (recommended to have .NET SDK installed):
cd backend_dotnet/Linqyard.Api
dotnet restore
dotnet watch run --urls "http://0.0.0.0:8080"Then open http://localhost:5000 (if you prefer the same host port mapping as Docker, run the process behind a reverse proxy or adjust your local call to port 8080).
From frontend_nextjs/:
cd frontend_nextjs
npm install
npm run devBy default the app runs on http://localhost:3000. If the frontend needs to talk to the backend running on your host, set NEXT_PUBLIC_API_URL accordingly (for example http://localhost:5000 or http://localhost:8080).
- Compose files reference a top-level
.envfile. Create one with any secrets or variables needed by services. - The Next.js app reads
NEXT_PUBLIC_API_URLto target the API.
- The
docker-compose.ymland override mount./logs/dotnetto persist .NET logs locally. Checklogs/dotnetin the repo for container logs if enabled.
# Build images only
docker compose build
# Recreate a single service
docker compose up -d --no-deps --build nextjs
# View container logs (tail)
docker compose logs -f
# Run a one-off shell in a service
docker compose run --rm nextjs shAdd migration
dotnet ef migrations add "Initial Rebase" --project Linqyard.Data --startup-project Linqyard.ApiUpdate Database
dotnet ef database update --project Linqyard.Data --startup-project Linqyard.Api- If ports are in use, confirm no other local service is bound to 3000 or 5000.
- On Windows, if Docker tooling has networking issues, restart Docker Desktop.
- If Next.js can't reach the API from inside Docker, check the
NEXT_PUBLIC_API_URL(usehost.docker.internalfor host access from Linux/Windows/Mac Docker Desktop).
- Add a
.env.examplewith the minimal environment variables your team expects. - Consider adding service health endpoints and docker-compose healthchecks for better orchestration.
Generated: initial setup guide (automatically created).
