Skip to content

Commit eb76fd1

Browse files
authored
docs: update project documentation (#7)
1 parent 4669ab1 commit eb76fd1

2 files changed

Lines changed: 136 additions & 15 deletions

File tree

CONTRIBUTING.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# Contributing
2+
3+
Thanks for contributing. Keep changes focused, small, and aligned with the
4+
existing project conventions.
5+
6+
## Before you start
7+
8+
- Read `AGENTS.md` for the full coding, documentation, testing, and workflow
9+
rules.
10+
- Use Node 24 and pnpm only.
11+
- Create branches with a conventional prefix, such as `fix/`, `feat/`,
12+
`docs/`, `chore/`, or `refactor/`.
13+
- Keep dependency changes separate unless they are required for the work.
14+
15+
## Development
16+
17+
```bash
18+
nvm use
19+
corepack enable
20+
pnpm install
21+
cp .env.example .env
22+
pnpm dev
23+
```
24+
25+
Use `pnpm compose up -d postgres redis` when you only need supporting local
26+
services. Use `pnpm compose up -d --build` when you want the app and services to
27+
run through Docker Compose.
28+
29+
## Checks
30+
31+
Run the relevant checks before opening a pull request:
32+
33+
```bash
34+
pnpm lint
35+
pnpm typecheck
36+
pnpm test
37+
pnpm build
38+
```
39+
40+
## Pull requests
41+
42+
- Use a conventional PR title.
43+
- Explain what changed and how it was tested.
44+
- Include both unit and integration coverage for behaviour changes.
45+
- Do not commit local env overrides or the root `.env`.

README.md

Lines changed: 91 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,44 @@
1-
# Template
1+
# NestJs Fastify React Full Stack Template
22

33
A reusable full-stack TypeScript application template with NestJS, Fastify,
44
React, PostgreSQL, Redis, Docker Compose, and observability built in. See
5-
`AGENTS.md` for conventions, `docs/adr/` for recorded architectural decisions,
6-
and `docs/runbooks/` for operational guides.
5+
`CONTRIBUTING.md` for contribution guidance, `AGENTS.md` for conventions,
6+
`docs/adr/` for recorded architectural decisions, and `docs/runbooks/` for
7+
operational guides.
78

8-
## Quick start
9+
## Project scope
910

10-
```bash
11-
nvm use # Node 24
12-
corepack enable # pnpm 11
13-
pnpm install
14-
cp .env.example .env # docker-compose values; not committed
15-
# Install once per Docker host. Use 3.7.0-arm64 on ARM64 hosts.
16-
docker plugin install grafana/loki-docker-driver:3.7.0 --alias loki --grant-all-permissions
17-
pnpm compose up -d # postgres, redis, prometheus, grafana, loki, tempo
18-
pnpm dev
19-
```
11+
This template is intentionally kept minimal. It provides the foundation for a
12+
full-stack service, but it does not try to include every capability a real
13+
product usually needs.
2014

21-
After cloning for a new project, run the one-time rename helper:
15+
There is no authentication, authorisation, user management, rate limiting,
16+
abuse prevention, billing, background job system, email delivery, object
17+
storage, feature flagging, admin area, or domain-specific workflow. Add those
18+
pieces deliberately based on the product you are building, rather than carrying
19+
generic defaults that may not fit.
20+
21+
## Tech stack
22+
23+
| Layer | Tech |
24+
| --- | --- |
25+
| Monorepo | pnpm workspaces, TypeScript |
26+
| Backend | NestJS, Fastify |
27+
| Frontend | Vite, React, Tailwind CSS, shadcn/ui |
28+
| Database | PostgreSQL, Kysely, kysely-codegen |
29+
| Cache | Redis |
30+
| Validation and config | Zod |
31+
| Testing | Vitest, Playwright browser mode, Testcontainers |
32+
| Linting and formatting | Biome |
33+
| Container runtime | Docker, Docker Compose |
34+
| Observability | Prometheus, Grafana, Loki, Tempo, OpenTelemetry Collector |
35+
| Git workflow | Lefthook, commitlint, conventional commits |
36+
37+
## Template cloning and project init
2238

2339
```bash
40+
git clone https://github.com/dearzubi/nestjs-fastify-react-template.git my-app
41+
cd my-app
2442
bash scripts/init-project.sh acme
2543
```
2644

@@ -30,10 +48,68 @@ database placeholders, compose identifiers, and observability queries. It also
3048
adds `docs/superpowers/` to `.git/info/exclude` for local AI-agent working
3149
files.
3250

51+
## Quick start
52+
53+
### 1. Set up local tooling
54+
55+
```bash
56+
nvm use
57+
corepack enable
58+
```
59+
60+
The Docker Compose stack uses the Loki Docker logging driver. Install it once
61+
per Docker host. Use `3.7.0-arm64` on ARM64 hosts.
62+
63+
```bash
64+
docker plugin install grafana/loki-docker-driver:3.7.0 --alias loki --grant-all-permissions
65+
```
66+
67+
### 2. Install dependencies
68+
69+
```bash
70+
pnpm install
71+
```
72+
73+
### 3. Build the project
74+
75+
```bash
76+
pnpm build
77+
```
78+
79+
### 4. Prepare the root environment file
80+
81+
```bash
82+
cp .env.example .env
83+
```
84+
85+
The root `.env` is used by Docker Compose and is not committed.
86+
3387
Per-app env files (`apps/*/.env`, `apps/*/.env.development`) are committed
3488
with safe defaults and are loaded automatically. Override locally with
3589
`apps/*/.env.local` or `apps/*/.env.development.local` (both gitignored).
3690

91+
If the default Postgres host port is already in use, change `POSTGRES_PORT` in
92+
the root `.env` and set `DATABASE_URL` in `apps/backend/.env.development.local`
93+
to the same host port.
94+
95+
### 5. Run with local Node processes
96+
97+
Use Docker Compose for the supporting services, then run the backend and web app
98+
through pnpm.
99+
100+
```bash
101+
pnpm compose up -d postgres redis
102+
pnpm dev
103+
```
104+
105+
### 6. Run fully through Docker Compose
106+
107+
Use this when you want the app and supporting services to run in containers.
108+
109+
```bash
110+
pnpm compose up -d --build
111+
```
112+
37113
## Single-VPS production
38114

39115
See [VPS production deployment](docs/runbooks/vps-production-deployment.md)

0 commit comments

Comments
 (0)