feat: harden production setup and redesign frontend - #1
Merged
Conversation
Add Prettier and ESLint configuration, pin Node/npm via engines and .nvmrc, and register format, format:check and lint scripts. Dependency and script updates for the whole hardening effort land here so that every later commit resolves against a consistent lockfile. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Mechanical reformatting only: quote style, trailing commas and line wrapping. No behavioural change, isolated in its own commit so the functional commits that follow contain no formatting noise. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Add helmet, CORS allow-listing and per-route rate limiting. Reject placeholder and undersized JWT secrets, sign access tokens with an explicit issuer, audience and one-hour expiry, and verify those claims on every request. Enforce the bcrypt 72-byte password limit and separate client-only routes from admin routes with a dedicated middleware. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Replace the direct prisma migrate deploy call with a deploy script that fingerprints a legacy schema, adopts it into the migration history when needed, and verifies published migration checksums before applying. Add migrations that reconcile the legacy hardening, enforce loan safety constraints and normalise user identifiers. Require explicit TLS verification settings and drop the unused database-postgres re-export. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…ates Require an Idempotency-Key header on loan creation and return the existing loan when a key is replayed, so a retried request cannot open a second contract. Reject a key reused with different terms. Derive instalment due dates from a civil date in the business timezone and clamp to the last valid day of the month, so contracts opened on the 29th to 31st no longer skip a month. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Accept cursor and limit on the admin listing and return a nextCursor, so the review queue no longer loads every proposal in a single response. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Require an explicit opt-in for demo seeding and refuse it against non-local databases or example passwords. Restrict the integration reset to local databases whose name ends in _test. Run the seed inside a transaction and add an integration test that upgrades a legacy schema through the full migration history. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Describe date-only fields with format date and document the one-hour token lifetime that replaced the previous seven-day claim. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Validate the stored session against the API on startup and clear it on a 401, so an expired token no longer keeps the router authenticated. Send an idempotency key with each loan request and remember the attempt locally, so a retry after a network failure reuses the same key. Apply the API's own amount, term and justification limits in the forms, and page through the admin queue with a load-more control. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The figure utility forces a monospace face with tabular numerals, so it rendered the prose fallbacks "Sem parcelas pendentes" and "Dados insuficientes" in the wrong typeface. Apply it only when the slot holds a number. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Extend the Cypress suite for the idempotency header, the paginated admin queue and the session revalidation that clears an expired token. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Describe the new environment variables, the non-destructive migration commands, the explicit opt-ins for seeding and resets, and the requirement to generate a real JWT secret. Extend the CI pipeline with format, lint and migration checks. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Laurowd
marked this pull request as ready for review
July 30, 2026 04:40
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.
Resumo
Validação