- Create ingest-api with Koa framework for handling device telemetry. - Implement telemetry ingestion with MongoDB, Redis, and PostgreSQL. - Add API endpoints for telemetry and health checks. - Set up testing with Vitest for unit and end-to-end tests. - Configure Prettier and ESLint for code formatting and linting. - Create Docker Compose setup for PostgreSQL, MongoDB, and Redis services. - Establish contracts package for shared Zod schemas and TypeScript types. - Implement React frontend with device status and greeting functionalities. - Add VS Code setup documentation for onboarding developers.
36 lines
832 B
Markdown
36 lines
832 B
Markdown
# marco-trest-test
|
|
|
|
Onboarding template: device ingest (Koa) vs user CRUD (Express), shared Zod contracts, Compose for Postgres / Mongo / Redis.
|
|
|
|
## Layout
|
|
|
|
```text
|
|
packages/contracts Zod only
|
|
apps/ingest-api Koa POST /telemetry
|
|
apps/crud-api Express GET /greeting GET /devices/:id/status
|
|
apps/web React + Redux + axios + Tailwind
|
|
```
|
|
|
|
Read [docs/architecture.md](docs/architecture.md) for the mermaid diagrams and the dual-write warning.
|
|
|
|
## Start
|
|
|
|
```bash
|
|
docker compose up -d
|
|
yarn install
|
|
yarn dev:crud
|
|
yarn dev:ingest
|
|
yarn dev:web
|
|
```
|
|
|
|
- UI: http://127.0.0.1:5173/devices
|
|
- Greeting: http://127.0.0.1:5173/greeting
|
|
- Express: http://127.0.0.1:3000/greeting?name=Marco
|
|
- Ingest: `POST http://127.0.0.1:3001/telemetry`
|
|
|
|
Frontend-only install (no Mongo/Koa):
|
|
|
|
```bash
|
|
yarn workspaces focus web
|
|
```
|