Skip to content

Commit c460e7e

Browse files
committed
Update documentation and CI configuration:
upgrade to Node.js 22 refine Docker setup enhance benchmarking improve contribution guidelines
1 parent cedeb38 commit c460e7e

23 files changed

+2108
-4224
lines changed

.dockerignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,18 @@ dist
44
.gitignore
55
.env
66
.env.local
7+
.env.example
78
*.log
89
.DS_Store
910
coverage
1011
.idea
1112
.vscode
13+
.windsurf
1214
README.md
15+
CONTRIBUTING.md
16+
LICENSE
1317
docker-compose.yml
1418
eslint.config.js
19+
vitest.config.ts
20+
src/bench.ts
21+
src/__tests__

.env.example

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Server
2+
PORT=3000
3+
HOST=0.0.0.0
4+
NODE_ENV=development
5+
6+
# CORS
7+
CORS_ORIGIN=*
8+
9+
# Rate Limiting
10+
RATE_LIMIT_MAX=100
11+
RATE_LIMIT_WINDOW=1 minute
12+
13+
# NATS
14+
NATS_SERVERS=nats://localhost:4222
15+
NATS_RECONNECT_TIME_WAIT=2000
16+
NATS_MAX_RECONNECT_ATTEMPTS=10
17+
18+
# Logging
19+
LOG_LEVEL=debug

.github/workflows/ci.yml

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: CI
22

33
on:
44
push:
5-
branches: [ main, master ]
5+
branches: [main]
66
pull_request:
7-
branches: [ main, master ]
7+
branches: [main]
88

99
jobs:
1010
test:
@@ -18,24 +18,23 @@ jobs:
1818

1919
steps:
2020
- uses: actions/checkout@v4
21-
21+
2222
- name: Setup Node.js
2323
uses: actions/setup-node@v4
2424
with:
25-
node-version: '20'
25+
node-version: '22'
2626
cache: 'npm'
27-
27+
2828
- name: Install dependencies
29-
run: |
30-
npm ci || (echo "package-lock.json out of sync, running npm install..." && npm install)
31-
32-
- name: Run linter
29+
run: npm ci
30+
31+
- name: Lint
3332
run: npm run lint
34-
33+
3534
- name: Build
3635
run: npm run build
37-
38-
- name: Run tests
36+
37+
- name: Test
3938
run: npm test
4039
env:
4140
NATS_SERVERS: nats://localhost:4222

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
20
1+
22

CONTRIBUTING.md

Lines changed: 39 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,12 @@
11
# Contributing
22

3-
Thank you for considering contributing to this project! We welcome contributions of all kinds.
3+
Contributions are welcome! Whether it's a bug fix, new feature, documentation improvement, or benchmark result — we appreciate your help.
44

5-
## How to Contribute
5+
## Getting Started
66

7-
1. Fork the repository
8-
2. Create your feature branch (`git checkout -b feature/amazing-feature`)
9-
3. Commit your changes (`git commit -m 'Add some amazing feature'`)
10-
4. Push to the branch (`git push origin feature/amazing-feature`)
11-
5. Open a Pull Request
12-
13-
## Development Setup
14-
15-
1. Clone your fork:
7+
1. Fork and clone:
168
```bash
17-
git clone https://github.com/your-username/fastify-microservice-starter-ts.git
9+
git clone https://github.com/<your-username>/fastify-microservice-starter-ts.git
1810
cd fastify-microservice-starter-ts
1911
```
2012

@@ -23,34 +15,52 @@ cd fastify-microservice-starter-ts
2315
npm install
2416
```
2517

26-
3. Start NATS server:
18+
3. Start NATS:
2719
```bash
28-
docker-compose up nats -d
20+
docker compose up nats -d
2921
```
3022

31-
4. Run in development mode:
23+
4. Run dev server:
3224
```bash
3325
npm run dev
3426
```
3527

36-
## Code Style
28+
## Workflow
29+
30+
1. Create a feature branch: `git checkout -b feature/my-feature`
31+
2. Make your changes
32+
3. Run checks:
33+
```bash
34+
npm run lint
35+
npm run build
36+
npm test
37+
```
38+
4. Commit with a clear message
39+
5. Push and open a Pull Request
40+
41+
## Guidelines
3742

38-
- Follow the existing code style
39-
- Run `npm run lint` before committing
40-
- Use TypeScript for all new code
41-
- Write meaningful commit messages
43+
- **TypeScript only** — all new code must be TypeScript with ESM imports (`.js` extensions)
44+
- **Keep it lean** — avoid adding unnecessary dependencies
45+
- **Test your changes** — add or update tests in `src/__tests__/`
46+
- **Follow existing patterns** — match the code style already in the project
47+
- **Run lint**`npm run lint` must pass with no errors
4248

43-
## Testing
49+
## Ideas for Contributions
4450

45-
- Add tests for new features
46-
- Ensure all tests pass: `npm test`
47-
- Ensure the build succeeds: `npm run build`
51+
- Additional NATS patterns (JetStream, key-value store)
52+
- Schema validation examples (Fastify JSON Schema or Zod)
53+
- OpenTelemetry / tracing integration
54+
- More benchmark scenarios
55+
- Documentation improvements
56+
- Bug fixes and performance improvements
4857

49-
## Pull Request Process
58+
## Pull Request Checklist
5059

51-
1. Update the README.md if needed
52-
2. Ensure your code follows the project's style guidelines
53-
3. Make sure all tests pass
54-
4. Request review from maintainers
60+
- [ ] Code follows the project style
61+
- [ ] Tests added/updated and passing
62+
- [ ] Build succeeds (`npm run build`)
63+
- [ ] Lint passes (`npm run lint`)
64+
- [ ] README updated if needed
5565

5666
Thank you for contributing!

Dockerfile

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,19 @@
1-
FROM node:20-alpine AS builder
1+
FROM node:22-alpine AS builder
22

33
WORKDIR /app
44

5-
COPY package*.json ./
6-
COPY tsconfig.json ./
7-
5+
COPY package*.json tsconfig.json ./
86
RUN npm ci
97

108
COPY src ./src
119
RUN npm run build
1210

13-
FROM node:20-alpine
11+
FROM node:22-alpine
1412

1513
WORKDIR /app
1614

1715
COPY package*.json ./
18-
RUN npm ci --only=production
16+
RUN npm ci --omit=dev
1917

2018
COPY --from=builder /app/dist ./dist
2119

0 commit comments

Comments
 (0)