Skip to content

Latest commit

 

History

History
77 lines (53 loc) · 1.53 KB

README.md

File metadata and controls

77 lines (53 loc) · 1.53 KB

next-fastapi-sse

A development stack using:

supporting:

graph LR
    A[Browser] -->|HTML/API| B[Next.js Backend<br/>Node.js]
    B -->|SSE| A
    B --> |proxy<br/>/api/v1| C[FastAPI<br/>Backend]
    C --> D[Request topic<br/>Kafka]
    D --> E[Worker]
    E --> F[Response topic<br/>Kafka]
    F --> B
Loading

Prerequisites

Setup

Install NPM packages:

pnpm i

Install Python packages:

cd backend
poetry install

Create Kafka topics:

pnpm run topics:create

Start worker:

pnpm run worker:dev

Start back-end:

pnpm run backend:dev

Start front-end:

pnpm run dev

Environment Variables

Both front-end and back-end load environment variables from .env.development, .env.local and .env. The variables required for development are defined in .env.development. Create .env.local or .env to overwrite them.

See startup scripts scripts/dev.sh, scripts/backend/dev.sh and the following Nex.js document for more details.