Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,16 +159,22 @@ npm run dev:frontend

Open `http://localhost:5173`, register a local account, add a repository, and start analysis.

### Optional: local Compose stack
### Optional: local Compose stack (recommended for local dev)

Compose runs the API with PostgreSQL and Redis for local development. It is not production deployment guidance.
Compose runs the full stack — API, PostgreSQL, Redis, and the frontend dev
server — in one command. It is not production deployment guidance.

```bash
npm run docker:config
npm run docker:up
npm run docker:config # validate the compose file
npm run docker:up # build and start api + postgres + redis + frontend
```

Run the frontend separately with `npm run dev:frontend`. See the [AI provider egress policy](docs/security/AI_PROVIDER_EGRESS.md) before configuring any custom or local provider endpoint.
The frontend dev server is available at `http://localhost:5173` and talks to
the API container over the internal network. Source is mounted, so edits hot
reload. See the [AI provider egress policy](docs/security/AI_PROVIDER_EGRESS.md)
before configuring any custom or local provider endpoint.

To run the frontend outside Compose instead, use `npm run dev:frontend`.

## Verification

Expand Down
19 changes: 19 additions & 0 deletions apps/frontend/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Development image for the PARTHA frontend.
# Runs the Vite dev server so `docker compose up` brings up the whole stack
# (api + postgres + redis + frontend) in one command. Hot reload works because
# the compose service mounts the source directory.
FROM node:20-alpine

WORKDIR /app

# Install dependencies first for better layer caching.
COPY package.json package-lock.json ./
RUN npm install

# Vite must bind to 0.0.0.0 inside the container so the published port is
# reachable from the host. The frontend reaches the backend by its compose
# service name (http://api:8000), not localhost.
ENV VITE_API_URL=http://api:8000
EXPOSE 5173

CMD ["npm", "run", "dev", "--", "--host", "0.0.0.0", "--port", "5173"]
19 changes: 19 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,25 @@ services:
- data
- egress

frontend:
build:
context: ./apps/frontend
dockerfile: Dockerfile
ports:
- "5173:5173"
environment:
# Reach the backend by its compose service name, not localhost.
VITE_API_URL: http://api:8000
# Mount source for hot reload; keep the container's node_modules.
volumes:
- ./apps/frontend:/app
- /app/node_modules
depends_on:
api:
condition: service_started
networks:
- data

postgres:
image: postgres:16-alpine
environment:
Expand Down
Loading