How anup4944/vinstagram works
This is a social-network application: users authenticate, browse a post feed, interact with posts, and manage profiles and relationships. The client routes users through protected pages and provides shared authentication, post, and user state; the Express API handles domain operations backed by Prisma and Cloudinary. Password reset also uses email. The excerpts show several client-to-API calls and controller dependencies, but not the full client API wiring or server setup, so uncertain cross-tier links are omitted or marked unverified.
Main entry points: server.ts HTTP server · App.tsx Route application · useAuth.ts Auth hook · Posts.tsx Feed page
Components 26
Web client
- Route application
client/src/App.tsx - Auth state
client/src/context/AuthProvider.tsx - Login and signup
client/src/pages/Login.tsx - Feed page
client/src/pages/Posts.tsx - Post interactions
client/src/components/Post.tsx - Post editing
client/src/components/EditPostModal.tsx - Profile management
client/src/pages/UserProfile.tsx - Search
client/src/components/Search.tsx - Post state
client/src/context/PostProvider.tsx - User state
client/src/context/UserProvider.tsx - Post hook
client/src/hooks/usePosts.ts - Auth hook
client/src/hooks/useAuth.ts - Route protection
client/src/components/ProtectedRoute.tsx
API and domain
- HTTP server
server/server.ts - Auth routes
server/routes/authRoutes.ts - Authentication
server/contollers/authController.ts - Post routes
server/routes/postRoute.ts - Posts and comments
server/contollers/postController.ts - User routes
server/routes/userRoutes.ts - Profiles and follows
server/contollers/userContoller.ts - Token verification
server/middleware/auth.ts
Persistence and integrations
- Relational data
server/config/prisma.ts - Media storage
server/config/cloudinary.ts - Reset email
server/utils/sendEmail.ts - Mail transport
server/config/nodemailer.ts
Other components
- User
Connections 35
- User → Route application: uses
client/src/App.tsx - Route application → Login and signup: routes to
client/src/App.tsx - Route application → Feed page: routes to
client/src/App.tsx - Route application → Profile management: routes to
client/src/App.tsx - Route application → Route protection: guards pages
client/src/App.tsx - Login and signup → Auth hook: uses
client/src/pages/Login.tsx - Auth hook → Auth state: reads context
client/src/hooks/useAuth.ts - Feed page → Search: renders
client/src/pages/Posts.tsx - Feed page → Post interactions: renders
client/src/pages/Posts.tsx - Feed page → Post hook: reads state
client/src/pages/Posts.tsx - Post editing → Post hook: updates posts
client/src/components/EditPostModal.tsx - Profile management → Post editing: opens
client/src/pages/UserProfile.tsx - Profile management → Post hook: reads state
client/src/pages/UserProfile.tsx - Profile management → Auth hook: reads state
client/src/pages/UserProfile.tsx - Search → Auth hook: uses
client/src/components/Search.tsx - Search → Post hook: searches posts
client/src/components/Search.tsx - Route protection → Auth hook: checks session
client/src/components/ProtectedRoute.tsx - HTTP server → Auth routes: registers
server/server.ts - HTTP server → Post routes: registers
server/server.ts - HTTP server → User routes: registers
server/server.ts - Auth routes → Authentication: dispatches
server/routes/authRoutes.ts - Post routes → Posts and comments: dispatches
server/routes/postRoute.ts - User routes → Profiles and follows: dispatches
server/routes/userRoutes.ts - Post routes → Token verification: protects routes
server/routes/postRoute.ts - User routes → Token verification: protects routes
server/routes/userRoutes.ts - Authentication → Relational data: reads and writes
server/contollers/authController.ts - Posts and comments → Relational data: reads and writes
server/contollers/postController.ts - Profiles and follows → Relational data: reads and writes
server/contollers/userContoller.ts - Authentication → Media storage: uploads avatars
server/contollers/authController.ts - Posts and comments → Media storage: manages images
server/contollers/postController.ts - Authentication → Reset email: sends reset link
server/contollers/authController.ts - Reset email → Mail transport: uses transport
server/utils/sendEmail.ts - Auth state → HTTP server: calls API
- Post state → HTTP server: calls API
- User state → HTTP server: calls API