How anshikaagr/haven works
Haven is a web app for storing and organizing personal documents, with account access, importance flags, and expiry tracking. Users register or log in, then upload documents and manage them through dashboard, document, important, and expiry views; settings supports account maintenance. The client calls an API backed by Express controllers, MongoDB models, and Cloudinary file storage. The graph reflects sampled source and README/index evidence; unsampled page and server details are represented only where the index supports them.
Main entry points: api.js HTTP client · App.jsx Route selection · DocumentCard.jsx Document actions · Documents.jsx Document library
Components 24
Web client
- Route selection
client/src/App.jsx - Sign in
client/src/pages/Login.jsx - Registration
client/src/pages/Register.jsx - Dashboard
client/src/pages/Dashboard.jsx - Document library
client/src/pages/Documents.jsx - Important view
client/src/pages/Important.jsx - Expiry center
client/src/pages/Expiry.jsx - Account settings
client/src/pages/Settings.jsx - HTTP client
client/src/api/api.js - Document upload
client/src/components/UploadModal.jsx - Document actions
client/src/components/DocumentCard.jsx
API services
- Account routes
server/routes/authRoutes.js - Account operations
server/controllers/authController.js - Token validation
server/middleware/authMiddleware.js - Document routes
server/routes/documentRoutes.js - Document operations
server/controllers/documentController.js - File intake
server/middleware/uploadMiddleware.js - API server
server/server.js
Persistence
- User records
server/models/User.js - Document records
server/models/Document.js - MongoDB
- Cloudinary files
server/config/cloudinary.js - Database connection
server/config/db.js
Other components
- User
Connections 40
- User → Route selection: uses
client/src/App.jsx - Route selection → Sign in: routes
client/src/App.jsx - Route selection → Registration: routes
client/src/App.jsx - Route selection → Dashboard: routes
client/src/App.jsx - Route selection → Document library: routes
client/src/App.jsx - Route selection → Important view: routes
client/src/App.jsx - Route selection → Expiry center: routes
client/src/App.jsx - Route selection → Account settings: routes
client/src/App.jsx - Sign in → HTTP client: calls
client/src/pages/Login.jsx - Registration → HTTP client: calls
client/src/pages/Register.jsx - Dashboard → HTTP client: fetches
client/src/pages/Dashboard.jsx - Document library → HTTP client: fetches
client/src/pages/Documents.jsx - Important view → HTTP client: fetches
client/src/pages/Important.jsx - Expiry center → HTTP client: fetches
client/src/pages/Expiry.jsx - Account settings → HTTP client: calls
client/src/pages/Settings.jsx - Document library → Document upload: renders
client/src/pages/Documents.jsx - Expiry center → Document upload: renders
client/src/pages/Expiry.jsx - Important view → Document upload: renders
client/src/pages/Important.jsx - Document library → Document actions: renders
client/src/pages/Documents.jsx - Expiry center → Document actions: renders
client/src/pages/Expiry.jsx - Important view → Document actions: renders
client/src/pages/Important.jsx - Dashboard → Document actions: renders
client/src/pages/Dashboard.jsx - Document upload → HTTP client: posts
client/src/components/UploadModal.jsx - Document actions → HTTP client: updates
client/src/components/DocumentCard.jsx - HTTP client → API server: sends API requests
- API server → Account routes: mounts
server/server.js - API server → Document routes: mounts
server/server.js - Account routes → Token validation: protects
server/routes/authRoutes.js - Account routes → Account operations: dispatches
server/routes/authRoutes.js - Document routes → Token validation: protects
server/routes/documentRoutes.js - Document routes → File intake: accepts files
server/routes/documentRoutes.js - Document routes → Document operations: dispatches
server/routes/documentRoutes.js - Account operations → User records: reads and writes
server/controllers/authController.js - Account operations → Document records: manages user files
server/controllers/authController.js - Token validation → User records: loads user
server/middleware/authMiddleware.js - Document operations → Document records: reads and writes
server/controllers/documentController.js - Document operations → Cloudinary files: uploads and deletes
server/controllers/documentController.js - Database connection → MongoDB: connects
- Document records → MongoDB: persists
- User records → MongoDB: persists