How iftruereturn/notepad-online works
Main Components
A. Frontend Layer (React/Redux):
• Components (UI Layer)
• Containers (Smart Components)
• Actions/Reducers (State Management)
• Store (Redux Store)
• Routing (React-Router)
B. Backend Layer (Koa.js):
• Routes
• Controllers
• Models
• Authentication (Passport.js)
• Configuration
C. Database Layer:
Component Relationships and Data Flow
• User Interface → Redux Actions
• Redux Actions → Redux Store
• Redux Store → React Components
• React Components → API Calls
• API Calls → Koa Routes
• Koa Routes → Controllers
• Controllers → Models
• Models → MongoDB
Specific Implementation Details
Key architectural elements:
• Authentication flow (Passport.js integration)
• CRUD operations flow
• Frontend build process (Webpack)
• API endpoints structure
Detailed Component Breakdown
Frontend (React/Redux):
Components/
• App
• AuthPanel
• LandingPage
• ListPage
• NotePage
• Common Components
Backend (Koa.js):
API/
• Routes
• Controllers (users, notes)
• Models (user, note)
• Config
Additional Elements
• Development Tools (Webpack, Babel)
• Testing Framework (Mocha)
• Style Processing (SCSS)
• Asset Management
Important Notes
• Separation between development and production environments
• Webpack bundling process
• Role of middleware (especially for authentication)
• How the frontend communicates with the backend through API endpoints
Data Persistence Layer (bottom)
Remember to:
• Keep components grouped logically
• Clear data flow directions
• Notes about key technologies (React, Redux, Koa, MongoDB)
• Version information for critical dependencies