Skip to main content

Repo Dependency Map

This page is the implementation-level dependency map for TrickBook across repositories.

Repositories​

RepoPathRole
Web (Next.js)/Users/weshuber/Documents/TrickBookNextJS/TrickBookWebsiteWebsite UI + NextAuth + admin/content workflows
Mobile (Expo RN)/Users/weshuber/Reactnative/TrickListiOS/Android app + typed API layer + feature UIs
Backend (Express)/Users/weshuber/Reactnative/BackendShared REST API + Socket.IO + integrations
Docs (Docusaurus)/Users/weshuber/Reactnative/docsInternal technical documentation

Runtime Topology​

Next.js Web

Backend API
api.thetrickbook.com/api

Expo Mobile

Chrome Extension

Socket.IO
/feed, /messages

MongoDB Atlas

AWS S3

Bunny.net

Stripe

Google APIs

Client To Backend Contracts​

Web App -> Backend​

Primary source files:

  • lib/api*.js
  • lib/socket.js
  • pages/api/auth/[...nextauth].js
Web moduleBackend route groupNotes
lib/api.js, lib/apiTrickipedia.js/api/trickipedia, /api/categories, /api/blog, /api/trickImageTrickipedia/blog/admin content
lib/apiTrickLists.js/api/listings, /api/listingUser trick lists and list tricks
lib/apiSpots.js/api/spots, /api/spotlists, /api/spot-reviewsSpot discovery, lists, moderation
lib/apiHomies.js/api/users/*Homie network and requests
lib/apiMessages.js/api/dm/*Direct messages
lib/apiFeed.js/api/feed/*Feed posts/comments/reactions
lib/apiMedia.js/api/couch/*Curated media library
lib/apiUpload.js/api/upload/*Video/image upload flow
lib/apiPayments.js/api/payments/*Stripe subscription actions
lib/socket.jsSocket namespaces /feed, /messagesReal-time comments and DM events

Mobile App -> Backend​

Primary source files:

  • src/constants/api.ts
  • src/lib/api/*.ts
  • src/lib/api/client.ts
Mobile moduleBackend route groupNotes
auth.ts, user.ts/api/auth, /api/users, /api/userEmail+password, Google, Apple, profile
trickbook.ts/api/trickipedia, /api/listings, /api/listing, /api/categoriesTrickipedia + personal lists
spots.ts, spotlists.ts, spotReviews.ts/api/spots, /api/spotlists, /api/spot-reviewsMaps, spot lists, reviews
homies.ts/api/users/*Social graph
messages.ts/api/dm/*Conversations/messages
feed.ts/api/feed/*Feed operations
couch.ts/api/couch/*Curated video library
upload.ts/api/upload/*Bunny video + S3 image support

Auth And Session Contracts​

ConcernContract
REST auth headerx-auth-token: <jwt>
Socket authsocket.handshake.auth.token = <jwt>
Web sign-inNextAuth provider callback posts to /api/auth and /api/auth/google-auth
Mobile sign-inAPI layer posts to /api/auth, /api/auth/google-auth, /api/auth/apple-auth

Socket Event Contracts​

/feed namespace​

  • Join/leave: join:post, leave:post
  • Server push: comment:new, comment:deleted, comment:loved

/messages namespace​

  • Join/leave: join:conversation, leave:conversation
  • Client emit: typing:start, typing:stop
  • Server push: message:new, messages:read, typing events

External Service Dependencies​

ServiceUsed ByPrimary backend code
MongoDB AtlasAll featuresroute handlers + middleware
AWS S3Images (profile, tricks, spots, blog)services/s3Upload.js, routes/image.js, routes/trickImage.js, routes/blogImage.js
Bunny.netMedia upload/streamingservices/bunnyStream.js, routes/upload.js, routes/couch.js, routes/feed.js
StripePremium subscriptionsroutes/payments.js, config/stripe.js
Google Places/GeocodeSpot enrichment/searchservices/googlePlaces.js, routes/spots.js
Google Drive APICouch sync/adminroutes/couch.js
Expo PushDevice notificationsroutes/expoPushTokens.js

Current Drift To Watch​

  1. Web mixes environment-based URLs with hardcoded production URLs in API modules.
  2. Mobile still contains legacy app/api/* while new work is in src/lib/api/*.
  3. Some docs examples still show older endpoint shapes; backend route files are source of truth.
  4. Development host for mobile is pinned in src/constants/api.ts (DEV_API_HOST).

Change Management Rules​

  1. Treat backend route contracts as shared public API.
  2. For any endpoint change, verify callers in both web and mobile repos before merge.
  3. Keep auth header behavior stable (x-auth-token) unless all clients are migrated.
  4. For socket event changes, update web and mobile listeners/emitters in the same release.