How yoteapp/yote works
Project type and purpose
• This is a “super-stack” full-stack application (“Yote”) that delivers:
• A web client (React + Redux)
• A native mobile client (React Native + Redux)
• A Node.js/Express API server (with Passport.js for auth)
• A MongoDB database (via Mongoose)
File structure
• Top-level directories:
• /web — React/Redux single-page application
• /mobile/Yote — React Native mobile application
• /server — Node.js/Express REST API
• /docs — project documentation (split into client, mobile, server)
• Each client folder contains its own build/config (e.g., craco, Babel, Gradle, Xcode workspace).
• The server follows an MVC-style structure: /resources (models/controllers/apis), /global (handlers, helpers), plus config files for different environments.
Key insights from README
• “Super-stack” = integrated web, mobile, and API layers
• Tech stack: MongoDB/Mongoose, Node/Express/Passport (server), React/React-Router/Redux (web), React Native/Redux (mobile)
• Emphasis on flexibility, extendability, performance, and caching server data in Redux stores.
Main components
A. Presentation Layer
• Web Client: React SPA
– Redux Toolkit for state
– React Router for navigation
• Mobile Client: React Native app
– Redux Toolkit for state
– Native modules via Buck/Gradle (Android) and CocoaPods/Xcode (iOS)
B. API Layer
• Node.js + Express server (app.js, index.js)
• Passport.js for authentication flows
• Resource modules (/resources/*): controllers, API routers, Mongoose models
• Error and request handlers (/global/handlers)
• Configuration per environment (development, production, staging)
C. Data Layer
• MongoDB database
• Mongoose ODM for schema definitions and queries
D. (Optional) Infrastructure / DevOps
• Docker (server container)
• nodemon for hot reload
• CI/CD docs in /docs/server/deployment.md
Relationships and interactions
• Web Client ↔ HTTP(S) REST API
• User travels through React Router → dispatch Redux actions → invoke api.js → call Express endpoints
• Mobile Client ↔ HTTP(S) REST API
• App.js bootstraps React Native → dispatch Redux actions → use serviceHooks/api.js → call Express endpoints
• API Server ↔ MongoDB
• Express routes → controller → Mongoose model → MongoDB CRUD
• Authentication flow
• Web/Mobile send credentials → Passport middleware → session or JWT → protected resource access
Architectural patterns & design principles
• Layered architecture: Presentation → API → Data
• RESTful resource modules (user, product, notification)
• MVC (controllers + models + routers) on server
• Centralized state management (Redux Toolkit) on clients
• Environment-specific configuration (12-factor /config directory)
• Test harness in each layer (/__tests__, jest.config.js)