How monish-kumar-a/pinvault works
PINVAULT is a Pinterest-inspired visual-content app. Users authenticate, discover and filter a paginated feed, open posts to interact, upload media, and manage profiles, liked posts, and saved posts. The frontend’s pages and reusable components call a shared API layer; Express routes dispatch to domain controllers, which operate on user and post records. The README documents additional discovery and engagement capabilities whose detailed wiring was not sampled, so those links are represented at the subsystem level. Backend source excerpts support the route/controller and persistence links shown.
Main entry points: api.ts API client · server.js Express server · postRoutes.js Post routes · auth.js JWT authorization
Components 26
Frontend experience
- Feed and discovery
frontend/src/app/page.tsx - Post details
frontend/src/app/post/[id]/page.tsx - Media upload
frontend/src/app/upload/page.tsx - User profile
frontend/src/app/profile/[id]/page.tsx - Liked and saved
frontend/src/app/liked/page.tsx - Login and register
frontend/src/app/login/page.tsx - Authentication form
frontend/src/components/AuthForm.tsx - Masonry feed UI
frontend/src/components/MasonryFeed.tsx - Post card UI
frontend/src/components/PostCard.tsx - Session context
frontend/src/context/AuthContext.tsx - Theme context
frontend/src/context/ThemeContext.tsx - API client
frontend/src/lib/api.ts
Backend API
- Express server
backend/src/server.js - Auth routes
backend/src/routes/authRoutes.js - Post routes
backend/src/routes/postRoutes.js - User routes
backend/src/routes/userRoutes.js - JWT authorization
backend/src/middleware/auth.js - Authentication logic
backend/src/controllers/authController.js - Post and comment logic
backend/src/controllers/postController.js - Profile collections logic
backend/src/controllers/userController.js
Persistence and media
- Database connection
backend/src/config/db.js - User records
backend/src/models/User.js - Post records
backend/src/models/Post.js - Uploaded media files
backend/uploads
Other components
- Visitor / user
- MongoDB
Connections 37
- Visitor / user → Feed and discovery: browses
- Visitor / user → Login and register: signs in
- Login and register → Authentication form: renders
- Authentication form → Session context: submits credentials
- Session context → API client: requests session
- Feed and discovery → Masonry feed UI: renders feed
- Masonry feed UI → Post card UI: renders posts
- Feed and discovery → API client: loads discovery
- Post details → API client: loads post
- Media upload → API client: submits media
- User profile → API client: loads profile
- Liked and saved → API client: loads collections
- Visitor / user → Post details: views and interacts
- Visitor / user → Media upload: uploads content
- Visitor / user → User profile: views profile
- Visitor / user → Liked and saved: manages posts
- Express server → Auth routes: mounts routes
- Express server → Post routes: mounts routes
- Express server → User routes: mounts routes
- Express server → Database connection: connects database
- Express server → Uploaded media files: serves files
- API client → Express server: sends API requests
- Auth routes → Authentication logic: dispatches
- Auth routes → JWT authorization: protects session route
- Post routes → Post and comment logic: dispatches
- Post routes → JWT authorization: protects mutations
- Post routes → Uploaded media files: stores uploaded files
- User routes → Profile collections logic: dispatches
- User routes → JWT authorization: protects user routes
- JWT authorization → User records: loads account
- Authentication logic → User records: reads and writes
- Post and comment logic → Post records: reads and writes
- Post and comment logic → User records: reads and writes
- Profile collections logic → User records: reads and writes
- Profile collections logic → Post records: reads posts
- Database connection → MongoDB: connects
- Theme context → Visitor / user: provides theme choice