Skip to content

Feat/786 backend eslint prettier config#1073

Merged
Akanimoh12 merged 25 commits into
Akanimoh12:test-implement-dripsfrom
Muyideen-js:feat/786-backend-eslint-prettier-config
Jun 29, 2026
Merged

Feat/786 backend eslint prettier config#1073
Akanimoh12 merged 25 commits into
Akanimoh12:test-implement-dripsfrom
Muyideen-js:feat/786-backend-eslint-prettier-config

Conversation

@Muyideen-js

Copy link
Copy Markdown
Contributor

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:

    • Single quotes
    • Trailing commas (all)
    • 100 character print width
    • No semicolons
    • Arrow parens always
  • 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 behavior

Verification

  • Configuration files created in backend/ directory
  • Settings align with existing eslint.config.js (ESLint flat config)
  • Ready for testing with npm run lint and npm run format from backend directory

Related Issue

Closes #786

Checklist

  • .prettierrc created with project conventions
  • .eslintignore created
  • .prettierignore created
  • Configuration verified against existing ESLint setup
  • Test npm run lint exits 0 on the scaffold
  • Test npm run format reformats without changing committed files

Notes

The backend already has eslint.config.js (ESLint flat config format) and the necessary dependencies in package.json. This PR adds the missing Prettier configuration and ignore files to complete the toolchain setup.# 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:

    • Single quotes
    • Trailing commas (all)
    • 100 character print width
    • No semicolons
    • Arrow parens always
  • 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 behavior

Verification

  • Configuration files created in backend/ directory
  • Settings align with existing eslint.config.js (ESLint flat config)
  • Ready for testing with npm run lint and npm run format from backend directory

Related Issue

Closes #786

Checklist

  • .prettierrc created with project conventions
  • .eslintignore created
  • .prettierignore created
  • Configuration verified against existing ESLint setup
  • Test npm run lint exits 0 on the scaffold
  • Test npm run format reformats without changing committed files

Notes

The backend already has eslint.config.js (ESLint flat config format) and the necessary dependencies in package.json. This PR adds the missing Prettier configuration and ignore files to complete the toolchain setup.

Akanimoh12 and others added 23 commits June 23, 2026 10:04
…ing-readme-803

Feat/contributing readme 803
…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.
…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
…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)
@drips-wave

drips-wave Bot commented Jun 26, 2026

Copy link
Copy Markdown

@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! 🚀

Learn more about application limits

@Akanimoh12

Copy link
Copy Markdown
Owner

Please fix all conflicts

@Muyideen-js

Copy link
Copy Markdown
Contributor Author

@Akanimoh12 Fixed

@Akanimoh12 Akanimoh12 merged commit 7e1ee00 into Akanimoh12:test-implement-drips Jun 29, 2026
4 of 5 checks passed
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.

Set up backend ESLint + Prettier shared config

9 participants