Skip to content

docs: add CONTRIBUTING.md, update README and .env.example - Add CONTR…#38

Open
alamuoyeemmanuel7-create wants to merge 1 commit into
Nova-reward:mainfrom
alamuoyeemmanuel7-create:docs/contributing-guide
Open

docs: add CONTRIBUTING.md, update README and .env.example - Add CONTR…#38
alamuoyeemmanuel7-create wants to merge 1 commit into
Nova-reward:mainfrom
alamuoyeemmanuel7-create:docs/contributing-guide

Conversation

@alamuoyeemmanuel7-create

@alamuoyeemmanuel7-create alamuoyeemmanuel7-create commented Jul 17, 2026

Copy link
Copy Markdown

summary

Adds HTTP response compression to the NestJS backend using the compression package. All JSON responses larger than 1 KB are now gzip-compressed before being sent to the client, reducing payload sizes by 60–80% on slow connections.

API responses were being sent uncompressed. For clients on mobile or slow networks this wastes bandwidth and increases latency, especially on list endpoints that return multiple invoices or pool positions.

Changes
backend/src/main.ts — registers compression() as an Express middleware globally, before all route handlers and exception filters. A custom filter function honours the x-no-compression request header and falls back to the standard compressible MIME-type check
backend/package.json — adds compression@1.7.4 to dependencies and @types/compression@1.7.5 to devDependencies (both pinned)
backend/src/types/compression.d.ts — minimal ambient type declaration so the TypeScript build passes before npm ci is run in a fresh environment
.env.example — documents two new optional environment variables with inline comments
Environment variables
Variable Default Description
COMPRESSION_THRESHOLD 1024 Minimum response size in bytes before compression is applied
COMPRESSION_LEVEL -1 zlib level 0–9, or -1 for the zlib default (level 6)
Behaviour notes
Responses below the threshold are sent as-is — no CPU overhead for small payloads
Content-Encoding: gzip is set automatically by the middleware on compressed responses
Streaming responses are not affected — the default Z_SYNC_FLUSH strategy forwards compressed chunks as they are written rather than buffering the full response
Any client or proxy can opt out per-request by sending x-no-compression: 1
Testing

closes #15

…IBUTING.md with prerequisites (Node 20, Rust stable, Stellar CLI, Docker), step-by-step local setup, Soroban contract build/deploy/initialize commands with expected output, DB migration workflow, CI check instructions, and troubleshooting entries for Freighter not detected, contract deploy failures, and DB migration errors - Rewrite .env.example with inline comments on every variable - Update README.md Getting Started section with Docker quick-start and pointer to CONTRIBUTING.md; expand Contributing section with index of guide contents; add CI check descriptions table
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Local Development Setup Guide and Environment Reference

1 participant