How diksha78dev/familyvault works
1. Repository shape
- This is a monorepo with two distinct deployable parts:
- a Spring Boot backend at the repository root
- a React frontend in familyvault-frontend/
- The architecture is a classic client/server split, with the frontend consuming backend APIs over HTTP.
2. Product boundary
- FamilyVault is a document vault for family groups.
- Core user flows are: join a family group with a code, upload documents, and search/list documents by name or category.
- The app is designed for browser use on mobile, so there is no native mobile client or desktop app layer.
3. Backend application entry
- The backend starts from FamilyVaultApplication.java, which is the Spring Boot bootstrap class.
- Maven is the build/runtime tool for the server side (pom.xml, mvnw), so the backend is the authoritative application runtime.
4. Backend domain model
- There are two main domain objects:
- Document — represents uploaded files and their metadata
- FamilyGroup — represents a family workspace or access group
- These two entities define the business boundary: documents belong to a family context rather than to a generic global library.
5. Backend API layer
- DocumentController.java and FamilyGroupController.java expose the HTTP endpoints for the app.
- These controllers are the integration point between the React UI and the server-side business logic.
- Based on the README, this API likely supports document creation/upload, listing, search, and family-group joining/lookup.
6. Backend business logic
- DocumentService.java and FamilyGroupService.java hold the application rules and orchestration.
- This service layer sits between controllers and persistence/storage, which keeps the controllers thin and makes the document/group workflows explicit.
7. Persistence layer
- DocumentRepository.java and FamilyGroupRepository.java are the JPA repositories.
- The README states the backend uses Spring Boot + JPA + MySQL, so relational persistence is the system-of-record for document metadata and family-group data.
- application.properties.example indicates runtime configuration is externalized, likely including database settings and other environment-specific values.
8. File/storage integration
- CloudinaryConfig.java is a notable architectural boundary: document files are not just stored in the database.
- This implies uploaded document content is handled through an external file/media service, while the database stores metadata and references.
- In the architecture diagram, Cloudinary should be shown as a separate external dependency from MySQL.
9. Frontend structure
- The React app is organized around a few clear UI concerns:
- LandingPage.js for the public entry experience
- LoginPage.js for group-code access
- UploadForm.js for submitting documents
- DocumentList.js for browsing/searching documents
- ProtectedRoute.js for route gating on the client side
- App.js is the main composition/routing layer, with shared styling in App.css and index.css.
10. Frontend-to-backend data flow
- The expected flow is:
1. user opens the React app
2. user joins or accesses a family group
3. protected views let the user upload or browse documents
4. the frontend sends API requests to the Spring Boot backend
5. the backend persists metadata in MySQL and coordinates file storage through Cloudinary
- This means the React app is a presentation/orchestration layer; it does not own business state.
11. Security/access boundary
- The app avoids “complex signup” and instead uses a simple family code model.
- ProtectedRoute.js suggests client-side route protection, but the real access model is still centered on the backend’s family-group logic.
- For an architecture diagram, treat “family code membership” as the main authorization boundary.
12. Deployment and packaging
- Frontend deployment is configured separately via familyvault-frontend/vercel.json, so the UI can be hosted independently from the backend.
- The repository therefore supports a split deployment model: static React hosting plus a Spring Boot API server.
- The public/ assets and manifest.json confirm the frontend is a browser-first app.
13. Testing and quality boundaries
- Backend testing exists via src/test/.../FamilyVaultApplicationTests.java.
- The React app also has test scaffolding (App.test.js, setupTests.js).
- This suggests both layers are testable independently, reinforcing the separation between UI and server logic.
Main entry points: DocumentService.java Doc service · DocumentController.java Docs API · App.js App shell · FamilyGroupService.java Group service
Components 18
Backend
Spring Boot API, domain, persistence, and file-storage integration.
- FamilyVaultApp · Bootstraps the Spring Boot server.
src/main/java/com/diksha/FamilyVault/FamilyVaultApplication.java - Docs API · HTTP endpoints for document workflows.
src/main/java/com/diksha/FamilyVault/DocumentController.java - Groups API · HTTP endpoints for family-group access and lookup.
src/main/java/com/diksha/FamilyVault/FamilyGroupController.java - Doc service · Orchestrates upload, listing, and search rules for documents.
src/main/java/com/diksha/FamilyVault/DocumentService.java - Group service · Handles family-code membership and group workflows.
src/main/java/com/diksha/FamilyVault/FamilyGroupService.java - Doc repo · Persists and queries document metadata.
src/main/java/com/diksha/FamilyVault/DocumentRepository.java - Group repo · Persists and queries family-group records.
src/main/java/com/diksha/FamilyVault/FamilyGroupRepository.java - Document · Uploaded file metadata and family context.
src/main/java/com/diksha/FamilyVault/Document.java - FamilyGroup · Family workspace and access group.
src/main/java/com/diksha/FamilyVault/FamilyGroup.java - Cloudinary · Configures external document/file media handling.
src/main/java/com/diksha/FamilyVault/CloudinaryConfig.java
Frontend
React browser app for joining groups, uploading, and browsing documents.
- App shell · Main React composition and routing layer.
familyvault-frontend/src/App.js - Landing · Public entry experience.
familyvault-frontend/src/LandingPage.js - Join group · Family-code access and group entry flow.
familyvault-frontend/src/LoginPage.js - Protected route · Client-side route gating for authenticated family access.
familyvault-frontend/src/ProtectedRoute.js - Upload form · Document submission UI.
familyvault-frontend/src/UploadForm.js - Document list · Browsing and search UI for documents.
familyvault-frontend/src/DocumentList.js
External systems
Runtime dependencies outside the repository.
- MySQL · System of record for document metadata and family-group data.
- Cloudinary service · External file/media storage for uploaded documents.
Connections 20
- FamilyVaultApp → Docs API: exposes · Starts the API runtime that serves document endpoints.
- FamilyVaultApp → Groups API: exposes · Starts the API runtime that serves group endpoints.
- Docs API → Doc service: calls · Delegates document operations to application logic.
- Groups API → Group service: calls · Delegates family-group operations to application logic.
- Doc service → Doc repo: persists via · Stores and queries document metadata.
- Group service → Group repo: persists via · Stores and queries family-group records.
- Doc service → Document: uses · Manipulates document domain objects.
- Group service → FamilyGroup: uses · Manipulates family-group domain objects.
- Doc repo → MySQL: reads/writes · JPA persistence target for document data.
- Group repo → MySQL: reads/writes · JPA persistence target for group data.
- Doc service → Cloudinary: uploads via · Coordinates file handling through external media storage.
- Cloudinary → Cloudinary service: integrates with · Connects the backend to Cloudinary.
- App shell → Landing: navigates to · Composes the public landing experience.
- App shell → Join group: navigates to · Composes the family-code access flow.
- App shell → Protected route: guards · Wraps protected views with client-side access checks.
- Protected route → Upload form: allows · Shows upload flow after group access.
- Protected route → Document list: allows · Shows document browsing after group access.
- Upload form → Docs API: posts to · Sends upload requests to the backend API.
- Document list → Docs API: queries · Fetches document lists and search results from the backend API.
- Join group → Groups API: joins via · Uses group endpoints for family-code access.