How vancovx/bull3d works
Project Type and Purpose
• BULL3D is a full-stack MERN (MongoDB, Express, React, Node.js) web application for centralized management of digital assets (3D models, textures, audio).
• It provides user authentication (JWT + bcrypt), asset CRUD operations, comments, favorites, downloads, and cloud storage integration (Google Drive).
File Structure Analysis
• Top-level:
• backend/ – Express API with MVC layers (models, routes, controllers) plus middleware and config
• frontend/ – React SPA with Redux slices (features), reusable components, pages, and state store
• Backend patterns: layered architecture (routing → controllers → models → MongoDB), middleware for auth, error handling, and Google Drive integration
• Frontend patterns: presentation components, pages, Redux Toolkit slices (assets, auth, comments, favorites, downloads, users) calling REST services
Main Architectural Components
a. Client Layer (Frontend)
• React SPA served from webpack dev server or static build
• Redux store manages global state; React components/pages dispatch actions and subscribe to slices
• Asset upload/download flows integrate with Google Drive middleware via backend
b. API Layer (Backend)
• Express.js server (server.js) exposes REST endpoints under /api
• Routes map to controllers (assetController, userController, etc.)
• Controllers execute business logic, call Mongoose models, and return JSON
• Middleware chain handles authentication (JWT), error responses, and Google Drive file transfers
c. Data Persistence
• MongoDB (self-hosted or Atlas) accessed via Mongoose ODM
• Schemas: User, Asset, Comment, Favorite, Download
d. External Services
• Google Drive / Google Cloud Storage for file uploads
• JWT issuer/validator
• bcrypt for password hashing
Component Relationships and Data Flows
• Browser → HTTP(S) → Frontend SPA
• SPA dispatches REST calls (Axios or fetch) to Express API
• Express middleware authenticates JWT, parses body, logs errors
• Controllers orchestrate:
• UserController (login, register, profile)
• AssetController (CRUD, search, view)
• CommentController, FavoriteController, DownloadController
• ProxyRoutes for Google Drive operations
• Controllers call Mongoose models → MongoDB
• For file storage, AssetController delegates to googleDriveMiddleware → Google Drive API → cloud storage
• Responses propagate back through middleware to SPA
Key Architectural Patterns and Principles
• Layered (Presentation → Business → Data)
• Separation of concerns (frontend vs. backend, controllers vs. models)
• Stateless authentication using JWT
• Single API gateway (Express monolith) rather than microservices
• Redux Toolkit for predictable state transitions