docs: add CONTRIBUTING.md, update README and .env.example - Add CONTR…#38
Open
alamuoyeemmanuel7-create wants to merge 1 commit into
Open
Conversation
…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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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