Skip to content

Web migration#466

Closed
ShantKhatri wants to merge 94 commits into
Dev-Card:developfrom
ShantKhatri:web-migration
Closed

Web migration#466
ShantKhatri wants to merge 94 commits into
Dev-Card:developfrom
ShantKhatri:web-migration

Conversation

@ShantKhatri
Copy link
Copy Markdown
Contributor

Summary

Migrated web module from Svelt to React and initialized the npm there instead of pnpm.


Type of Change

  • Bug fix
  • New feature
  • Refactor (no functional change)
  • UI / Design change
  • Tests only
  • Documentation
  • Infrastructure / DevOps
  • Security

Checklist

  • My code follows the project's coding style (pnpm -r run lint passes).
  • TypeScript compiles without errors (pnpm -r run typecheck).
  • I have added or updated tests for the changes I made.
  • All tests pass locally (pnpm -r run test).
  • I have updated documentation where necessary.
  • No new console.log or debug statements left in the code.
  • Breaking changes are documented in this PR description.

Harxhit and others added 30 commits May 17, 2026 18:09
Co-authored-by: Amrit <amrit@example.com>
Replace the default browser scrollbar with a custom themed one that
matches DevCard's brand gradient. CSS-only, no JavaScript.

- WebKit/Chromium/Safari: gradient thumb (primary -> accent), themed
  track, hover state with glow.
- Firefox: scrollbar-width thin + scrollbar-color using the same theme
  variables (solid thumb fallback since gradients aren't supported).
- Reuses existing --primary/--accent/--bg-secondary/--primary-glow
  CSS variables so light/dark mode just work.

Closes Dev-Card#151.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
)

* Improve mobile UI/UX responsiveness and layout consistency

* Remove unnecessary package-lock.json
…d#150)

* chore(backend): add and configure ESLint for backend workspace

* fix(backend): align Prisma versions
… logging (Dev-Card#172)

reply.statusCode defaults to 200 before any response is sent, so the
previous check always evaluated to true and logged failed follows as
success. followGitHub now returns { success, response } so the caller
can log based on the actual API outcome.

Closes Dev-Card#148
…nt APIs (Dev-Card#139)

* docs: add Discord community invitation link to README and CONTRIBUTING.md

* git commit -m "feat(events-api): implement event management REST API with Prisma models"

* fix: revert changes to align with repository tech stack

* fix: Revert changes

* fix: add location field to schema and update API, validation, and tests

* fix: remove accidental schema.prisma file

* fix: Updated schema with location in event
…nagement & deep-link fallback (Dev-Card#177)

* feat: Layer 2 WebView Follow Engine — LinkedIn In-App Connect + Session Management

* fix: resolve TypeScript compilation issues and restore settings navigation

* feat: WebView LinkedIn Connect Engine + Follow system (Section 6.9)

- Backend: followRoutes returns webview strategy for LinkedIn/Twitter platforms
- Backend: POST /api/follow/:platform/:targetUsername/log for telemetry
- Backend: DELETE /api/follow/:platform/:targetUsername/log to reset Done state
- Backend: public profile now returns followed:true for previously connected links
- Backend: auth improvements — encode mobile redirect URI in OAuth state
- Mobile: WebViewScreen — full LinkedIn JS injection engine with polling,
  MutationObserver, visibilitychange, popstate, and injectedJSBeforeContentLoaded
- Mobile: DevCardViewScreen — premium UI, emoji icons, brand-colored buttons,
  Done tile with long-press reset, GitHub browser fallback
- Mobile: HomeScreen — username search bar to view any DevCard profile
- Mobile: App.tsx — hash fragment token extraction for OAuth deep links
- Mobile: config.ts — auto-detects LAN IP via Expo Constants for Expo Go
- Mobile: Expo migration — index.js, metro.config.js, babel.config.js, app.json
- Tests: new follow.test.ts cases for webview strategy and log endpoint
- Docs: README updated with telemetry and fallback overlay details
- Config: docker-compose port 5433, .env.example LAN IP placeholders

* fix: address PR review comments from Harxhit

- prisma.ts: replace authenticate:any with proper typed signature
  (request: FastifyRequest, reply: FastifyReply) => Promise<void>
- auth.ts: replace err as any with instanceof Error check in both
  GitHub and Google OAuth catch blocks for type-safe error handling
- Skeleton.tsx: replace width/height as any with DimensionValue type
  from react-native to preserve TypeScript safety

* fix: address remaining PR review comments from Harxhit

- connect.ts: replace err as any with instanceof Error check in
  GitHub connect catch block (same pattern as auth.ts fix)
- MainTabs.tsx: extract WebViewConnect params into standalone exported
  type WebViewConnectParams for reusability and future maintainability
- profiles.test.ts: replace mockPrisma as any with Pick<PrismaClient,'user'>
  and unknown cast to preserve TypeScript safety in tests
Signed-off-by: Parth Patidar <parth11.patidar@gmail.com>
* feat: add context-card diffing utility and validation layer

* feat: add NFC tag payload generation endpoint with card ownership validation

* fix: add Zod query validation and improve error handling in NFC route

* fix: resolve merge conflicts in app.ts

* fix: add typed response schema NfcPayloadResponse

* fix: remove typo in import statement in cards.ts

* refactor: narrow try catch scope in NFC payload route
…ate (Dev-Card#211)

randomBytes was used in generateState() without being imported from
crypto, causing a ReferenceError crash on any GET /connect/github request.
Also renamed parseGoogleState to parseOAuthState since the function is
exclusively used in the GitHub connect flow — Google connect does not
exist in this file.

Closes Dev-Card#178

Signed-off-by: Prashantkumar Khatri <96608160+ShantKhatri@users.noreply.github.com>
Co-authored-by: Prashantkumar Khatri <96608160+ShantKhatri@users.noreply.github.com>
…v-Card#144)

* fix(auth): encrypt OAuth tokens using encryption utility directly

auth.ts silently stored GitHub OAuth access tokens as plaintext because
the encryption check relied on a non-existent `app.encryption` Fastify
decorator - the condition always evaluated false, falling back to the raw
token. connect.ts called `app.encryption.encrypt()` directly, throwing
a TypeError at runtime and breaking the GitHub connect flow entirely.

Both routes now import `encrypt()` directly from utils/encryption.ts,
consistent with how follow.ts already imports `decrypt()` from the same module.

* fix(auth): isolate OAuth token persistence with focused try/catch

Wrap the encrypt + oAuthToken.upsert block in its own try/catch so that
a transient DB failure during token storage does not abort the login flow.
The platform token is supplementary -- authentication (JWT issuance) proceeds
even when persistence fails, and the error is logged for observability.

Addresses reviewer feedback on PR Dev-Card#144.

---------

Signed-off-by: Prashantkumar Khatri <96608160+ShantKhatri@users.noreply.github.com>
Co-authored-by: Prashantkumar Khatri <96608160+ShantKhatri@users.noreply.github.com>
…ard#171)

Following PA instructions merge conflicts are fixed.
…ard#228)

* fix: resolve ESLint issues in apps/backend/src/routes/cards.ts

* chore: remove local .eslintrc.json

---------

Signed-off-by: Krish Kumar <anuragbraveboy@gmail.com>
Co-authored-by: anuragbraveboy-sudo <krishnyk229@gmail.com>
…ev-Card#157)

* feat: improve card UI in light mode with better shadows and spacing

* style: improve card spacing and add smooth hover shadow
Co-authored-by: Prashantkumar Khatri <prashantkhatri202@gmail.com>
* fix: improve error handling in public.ts

* chore: remove unrelated frontend changes

* fix: improve typing and standardized error handling in public.ts

* chore: remove unrelated frontend changes

* fix: use shared getErrorMessage utility
…ation (Dev-Card#229)

All five route handlers in eventRoutes defined absolute /api/events* paths
while app.ts also registered the plugin with prefix: '/api/events'. Fastify
concatenates registration prefix and route path, producing double-prefixed
endpoints (/api/events/api/events, /api/events/api/events/:slug, etc.) that
are unreachable in production.

Strip the /api/events prefix from every route definition so paths are
relative (/, /:slug, /:slug/join, /:slug/leave, /:slug/attendees),
consistent with every other route plugin in the codebase.

Update the test buildApp() to register with { prefix: '/api/events' },
matching production. Inject URLs in existing tests already use the full
/api/events/* paths and require no changes.

Fixes Dev-Card#224.
roshankumar0036singh and others added 23 commits May 30, 2026 10:24
* fix: remove duplicate OAuth callback route registrations in auth.ts

- Removed duplicate nested app.get('/github/callback') that was registered
  inside an outer callback handler (caused by a bad merge)
- Removed duplicate nested app.get('/google/callback') same issue
- Removed dead code blocks (stray authUrl + redirect calls outside handlers)
  that were left over after the duplicate outer wrappers were stripped
- All routes (/github, /github/callback, /google, /google/callback, /me, /logout)
  are now correctly registered at the top level within authRoutes plugin scope

* fix: resolve OAuth CSRF vulnerabilities and add cookie types

---------

Signed-off-by: Roshan Kumar Singh <162692544+roshankumar0036singh@users.noreply.github.com>
…and navigation updates (Dev-Card#413)

Signed-off-by: Prashantkumar Khatri <96608160+ShantKhatri@users.noreply.github.com>
…#422)

Co-authored-by: prakash meena <prakash.meena@example.com>
…ev-Card#450)

* fix: Fixed linting issues

* feat(ci): add selective monorepo CI and PR result comments
…ev-Card#453)

* fix: Fixed linting issues

* fix(ci): improve selective checks and detailed PR comment reporting
…ing (Dev-Card#455)

* fix: Fixed linting issues

* fix(ci): improve workflow reporting and add collaborator support
…ev-Card#457)

* fix: Fixed linting issues

* fix(ci): expose backendTests output and improve smart test execution
…:slug response (Dev-Card#346)

The event detail endpoint was returning the raw organizer UUID via
organizerId, leaking an internal database identifier to unauthenticated
callers. Fetch the organizer relation and expose organizerUsername and
organizerDisplayName instead.
…ev-Card#459)

* fix: Fixed linting issues

* fix(workflow): switch discord reminder to pull_request_target for comment permissions
* feat: add rate limiting to OAuth endpoints

- Create oauthRateLimit plugin with per-IP bucket strategy
- Apply stricter rate limits to OAuth callback endpoints (5 req/min)
- Apply moderate rate limits to OAuth start endpoints (10 req/min)
- Prevent brute force attacks and token guessing
- Add per-user fallback for authenticated requests
- Fixes: No Rate Limiting on OAuth Endpoints

* fix: improve OAuth rate limiting implementation

- Fix off-by-one error: use >= instead of > for count checks
- Add Retry-After HTTP header to 429 responses (standard approach)
- Add type declaration merging for decorator properties
- Remove as any casts from auth routes
- Document cache:10000 reasoning in comments
@ShantKhatri ShantKhatri marked this pull request as draft June 3, 2026 11:10
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 3, 2026

CI Results — ❌ Some checks failed

🖥️ Backend (❌ failure)

Check Status
Lint ❌ failure
Test ❌ failure
Typecheck ❌ failure

📱 Mobile (❌ failure)

Check Status
Lint ❌ failure
Test ❌ failure

🌐 Web (❌ failure)

Check Status
Check ❌ failure
Build ✅ success

🕐 Last updated: Wed, 03 Jun 2026 11:11:13 GMT

@ShantKhatri ShantKhatri marked this pull request as ready for review June 3, 2026 11:22
@ShantKhatri ShantKhatri closed this Jun 3, 2026
@ShantKhatri ShantKhatri reopened this Jun 3, 2026
@ShantKhatri ShantKhatri closed this Jun 3, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 3, 2026

CI — Checks Failed

Backend — FAIL

Check Result
Lint FAIL
Test SKIP
Typecheck FAIL

Mobile — FAIL

Check Result
Lint FAIL
Test SKIP

Web — FAIL

Check Result
Check FAIL
Build FAIL

Last updated: Wed, 03 Jun 2026 11:31:02 GMT

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.