How tishanssr/camplify works
Purpose and Entry Points
This is a full-stack trip and campsite planning application. The frontend is a Vite/React client rooted at client/src/main.jsx, with route/page composition in client/src/App.jsx. The backend is a Node.js HTTP API started from backend/server.js.
Client Application Shell
The client organizes authenticated application UI around shared navigation and screen layout components: client/src/components/layout/ScreenLayout.jsx, client/src/components/layout/AppHeader.jsx, and client/src/components/layout/AppSidebar.jsx. Page-level features include trip management, campsite exploration/detail, invitations, notifications, profiles, and personal checklists under client/src/pages/.
Authentication and Session Boundary
Authentication state is held client-side in client/src/context/AuthContext.jsx; API calls are centralized through client/src/lib/api.js and authentication-specific operations through client/src/services/authService.js. On the server, backend/routes/authRoutes.js dispatches to backend/controllers/authController.js, while backend/middleware/userAuth.js establishes the protected-route boundary. User persistence is represented by backend/model/userModel.js.
Trip Planning Domain
Trips are the central collaboration aggregate. The client exposes trip creation, listing, and detail flows in client/src/pages/create-trip.jsx, client/src/pages/trips.jsx, and client/src/pages/trip-detail.jsx, backed by client/src/services/tripService.js. Server operations flow through backend/routes/tripRoutes.js and backend/controllers/tripController.js to backend/model/tripModel.js. Editing is surfaced as a reusable UI flow in client/src/components/common/EditTripModal.jsx.
Campsites and Mapping
Campsite discovery and detail views are implemented by client/src/pages/explore.jsx and client/src/pages/campsite-detail.jsx, with map rendering isolated in client/src/components/common/CampsiteMap.jsx. Client map settings reside in client/src/config/mapConfig.js. The API boundary is backend/routes/campsiteRoutes.js → backend/controllers/campsiteController.js → backend/model/campsiteModel.js.
Collaboration, Checklists, and Notifications
Trip participation is managed through invitation endpoints and UI: backend/controllers/invitationController.js, backend/model/invitationModel.js, and client/src/pages/invitation.jsx. Checklist support has separate personal and group persistence models—backend/model/personalChecklistModel.js and backend/model/groupChecklistModel.js—behind backend/controllers/checklistController.js; the personal workflow is represented by client/src/pages/personal-checklist.jsx. Notifications follow a parallel route/controller/model stack in backend/routes/notificationRoutes.js, backend/controllers/notificationController.js, and backend/model/notificationModel.js.
Infrastructure and External Integrations
MongoDB connectivity is configured in backend/config/mongodb.js, making the backend models the persistence boundary. Email delivery is configured in backend/config/nodmailer.js, likely supporting account verification, password recovery, or invitations reflected by client/src/pages/verify-email.jsx, client/src/pages/forgot-password.jsx, and client/src/pages/reset-password.jsx. Weather is isolated as a backend integration boundary in backend/routes/weatherRoutes.js and backend/controllers/weatherController.js; no provider is identified in the repository tree.
Main entry points: tripController.js Domain controllers · api.js API client · App.jsx App routes · mongodb.js MongoDB connection
Components 22
React Client
Vite application and feature UI.
- Client entry
client/src/main.jsx - App routes
client/src/App.jsx - Authenticated shell · Shared screen, header, and sidebar UI.
client/src/components/layout/ScreenLayout.jsx - Auth session · Client-side session state and authentication operations.
client/src/context/AuthContext.jsx - API client
client/src/lib/api.js - Trip UI · Create, list, detail, and edit trip flows.
client/src/pages/trip-detail.jsx - Trip service
client/src/services/tripService.js - Campsite explorer · Discovery, detail, and map rendering.
client/src/pages/explore.jsx - Collaboration UI · Invitation, personal checklist, and notification workflows.
client/src/pages/invitation.jsx
Node API
HTTP routes, domain controllers, and protected access.
- Auth routes
backend/routes/authRoutes.js - Trip routes
backend/routes/tripRoutes.js - Campsite routes
backend/routes/campsiteRoutes.js - Weather routes
backend/routes/weatherRoutes.js - User auth middleware · Establishes protected-route identity.
backend/middleware/userAuth.js - Domain controllers · Auth, trip, campsite, invitation, checklist, notification, and weather operations.
backend/controllers/tripController.js - Auth controller
backend/controllers/authController.js
Persistence & Integrations
MongoDB-backed models and outbound services.
- User model
backend/model/userModel.js - Trip model · Central collaboration aggregate.
backend/model/tripModel.js - Campsite model
backend/model/campsiteModel.js - Collaboration models · Invitation, personal/group checklist, and notification persistence.
backend/model/invitationModel.js - Email delivery · Supports verification, recovery, or invitations.
backend/config/nodmailer.js - MongoDB connection
backend/config/mongodb.js
Connections 27
- Client entry → App routes: mounts
- App routes → Authenticated shell: composes
- App routes → Trip UI: routes to
- App routes → Campsite explorer: routes to
- App routes → Collaboration UI: routes to
- Auth session → API client: authenticates requests
- Trip UI → Trip service: uses
- Trip service → API client: calls
- API client → Auth routes: auth requests
- API client → Trip routes: trip requests
- API client → Campsite routes: campsite requests
- API client → Weather routes: weather requests
- Auth routes → Auth controller: dispatches
- Auth controller → User model: persists users
- Trip routes → User auth middleware: protects
- User auth middleware → Domain controllers: authorizes
- Trip routes → Domain controllers: dispatches
- Campsite routes → Domain controllers: dispatches
- Weather routes → Domain controllers: dispatches
- Domain controllers → Trip model: manages trips
- Domain controllers → Campsite model: manages campsites
- Domain controllers → Collaboration models: manages collaboration
- Domain controllers → Email delivery: sends email
- User model → MongoDB connection: connects through
- Trip model → MongoDB connection: connects through
- Campsite model → MongoDB connection: connects through
- Collaboration models → MongoDB connection: connects through