Feat/786 backend eslint prettier config#1073
Merged
Akanimoh12 merged 25 commits intoJun 29, 2026
Merged
Conversation
…ing-readme-803 Feat/contributing readme 803
…ias-788 Feat/tsconfig path alias 788
…oint (Akanimoh12#845) Implements two of the four auth/DB issues for the off-chain backend: Akanimoh12#835 - Auth: JWT access token issuance util - signAccessToken(user) signs short-lived JWTs with sub + address claims - Expiry driven by JWT_EXPIRES_IN env var - verifyAccessToken() for use in middleware - Inputs validated with Zod; throws BadRequestError on bad input Akanimoh12#845 - Auth: current user endpoint GET /auth/me - requireAuth middleware extracts + verifies Bearer token from Authorization header - GET /api/v1/auth/me returns id, stellarAddress, username, createdAt, updatedAt - Returns 401 on missing/invalid/expired token, 404 when user not found - All inputs validated with Zod; errors use AppError subclasses - authRouter mounted in app.ts Akanimoh12#848 and Akanimoh12#828 are tracked and will be addressed separately. Tests: 10 new tests covering success + failure paths for both issues.
Feat/db schema updates
…rips stellr tips contract implementations
Merged latest origin/main into feat/auth-jwt-me-835-845-848-828. Conflict resolution strategy: - Kept origin/main's full auth module (challenge/verify/refresh/logout flows) as the base since it's more complete - Retained our Akanimoh12#835 signAccessToken util in auth.utils.ts, updated to use AuthPayload shape consistent with the rest of the service - Updated auth.middleware.ts to use authMiddleware name + requireAuth alias - Standardised all imports to use @/ path alias (consistent with tsconfig) - Fixed auth.controller.ts GET /me to return 404 NOT_FOUND (not BadRequest) and wrap response in { data: ... } per our Akanimoh12#845 implementation - Updated schema.prisma: replaced old AuthChallenge (address/nonce) with the version the service expects (stellarAddress/challenge/usedAt) and added RefreshToken model required by the refresh token rotation logic - Updated auth.test.ts token claims to match AuthPayload shape (userId/stellarAddress)
…5-845-848-828 Feat/auth jwt me 835 845 848 828
…Akanimoh12#837 Akanimoh12#847 - Add Zod durationString validator for JWT_EXPIRES_IN and REFRESH_TOKEN_EXPIRES_IN in env.ts; rejects invalid formats at startup. Akanimoh12#830 - Add backend/src/types/enums.ts re-exporting Period, TipStatus, WithdrawalStatus from @prisma/client for centralised enum imports. Akanimoh12#839 - Add optionalAuth middleware that attaches req.auth on valid token but never rejects; silent on missing/invalid/expired tokens. Akanimoh12#837 - Logout endpoint (revokeRefreshToken) already implemented via upstream merge; verified idempotent and Zod-validated. Tests: ttl-validation.test.ts (duration format), optionalAuth suite in auth.test.ts (4 new cases). Closes Akanimoh12#847, Akanimoh12#830, Akanimoh12#839, Akanimoh12#837
…ancements feat(auth): fix issues Akanimoh12#847, Akanimoh12#830, Akanimoh12#839, Akanimoh12#837
…nd profiles module - Add ed25519 signature verification with Zod validation (closes Akanimoh12#850) - Implement requireRole and requireScope middleware for authorization (closes Akanimoh12#840) - Create profiles module skeleton with CRUD operations (closes Akanimoh12#852) - Bind auth challenge to address and network for replay protection (closes Akanimoh12#843) - Fix ZodError property references (.issues instead of .errors) - All inputs validated with Zod schemas - Errors use AppError classes - Typecheck and lint pass successfully
- Resolved conflicts in auth module files - Integrated optionalAuth middleware from main - Fixed AuthPayload to include role and scopes - Maintained all features from both branches - Typecheck and lint pass
…re-roles-profiles feat: implement auth signature verification, role/scope middleware, and profiles module
…est helper - Akanimoh12#792: backend/Makefile with phony targets (dev, test, coverage, lint, typecheck, db-up, db-down, migrate, seed) - Akanimoh12#793: Local development loop section in backend/README.md covering tsx watch hot-reload behaviour, port config, and Makefile shortcuts - Akanimoh12#794: vitest.config.ts coverage thresholds set to 40% across lines, functions, branches, and statements; HTML report already configured - Akanimoh12#796: backend/tests/helpers/db.ts with resetDb() truncating all tables in a single transaction; usage documented in BACKEND_CONTRIBUTING.md Closes Akanimoh12#792 Closes Akanimoh12#793 Closes Akanimoh12#794 Closes Akanimoh12#796
…goal-subscription-webhook-817-810-811-820 feat(db): add RefreshToken, Goal, Subscription and WebhookDelivery
…93-794-796 feat(backend): Makefile, dev-loop docs, coverage thresholds, db test helper (Akanimoh12#792 Akanimoh12#793 Akanimoh12#794 Akanimoh12#796)
|
@Muyideen-js Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
Owner
|
Please fix all conflicts |
Contributor
Author
|
@Akanimoh12 Fixed |
7e1ee00
into
Akanimoh12:test-implement-drips
4 of 5 checks passed
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.
Set up backend ESLint + Prettier shared config
Summary
Finalize the backend lint/format toolchain so every contributor gets identical formatting and lint rules.
Changes
Add
.prettierrc: Configure Prettier with project conventions:Add
.eslintignore: Exclude generated and dependency files from linting:node_modules/dist/coverage/build/*.js(compiled JavaScript)*.d.ts(TypeScript declaration files)Add
.prettierignore: Same ignore patterns as ESLint to ensure consistent behaviorVerification
backend/directoryeslint.config.js(ESLint flat config)npm run lintandnpm run formatfrom backend directoryRelated Issue
Closes #786
Checklist
.prettierrccreated with project conventions.eslintignorecreated.prettierignorecreatednpm run lintexits 0 on the scaffoldnpm run formatreformats without changing committed filesNotes
The backend already has
eslint.config.js(ESLint flat config format) and the necessary dependencies inpackage.json. This PR adds the missing Prettier configuration and ignore files to complete the toolchain setup.# Set up backend ESLint + Prettier shared configSummary
Finalize the backend lint/format toolchain so every contributor gets identical formatting and lint rules.
Changes
Add
.prettierrc: Configure Prettier with project conventions:Add
.eslintignore: Exclude generated and dependency files from linting:node_modules/dist/coverage/build/*.js(compiled JavaScript)*.d.ts(TypeScript declaration files)Add
.prettierignore: Same ignore patterns as ESLint to ensure consistent behaviorVerification
backend/directoryeslint.config.js(ESLint flat config)npm run lintandnpm run formatfrom backend directoryRelated Issue
Closes #786
Checklist
.prettierrccreated with project conventions.eslintignorecreated.prettierignorecreatednpm run lintexits 0 on the scaffoldnpm run formatreformats without changing committed filesNotes
The backend already has
eslint.config.js(ESLint flat config format) and the necessary dependencies inpackage.json. This PR adds the missing Prettier configuration and ignore files to complete the toolchain setup.