How khoa-cntt/ncvxdwyt1285 works
Project type and purpose
• This is a full-stack healthcare appointment and information system comprised of:
• A React-Redux single page application (kltn-react-healthcare) for patient and admin UIs
• A Node.js/Express back-end (kltn-node-healthcare) using Sequelize ORM for data persistence
• A relational database (MySQL or PostgreSQL via Sequelize)
• Integrations: Momo payment gateway, e-mail service, and an AI chat endpoint
File structure
• Top-level folders:
• kltn-node-healthcare: server-side code, migrations, models, controllers, services, routes, views (EJS)
• kltn-react-healthcare: client app, components, containers, redux store, assets, services, server (for SSR or proxy)
• Notice MVC-style separation in the back-end: controllers → services → models → migrations/seeders
• The React app uses a typical container/component split, Redux actions/reducers, plus axios for API calls
• External config files: .env, .babelrc, .sequelizerc, package.json, etc.
Key README insights
• Little in the root README; each subproject has its own README describing installation and run scripts
• Back-end README defines database config and environment variables
• Front-end README covers React build, .env for API URLs
Main components & interactions (to include
a. Client layer
• Web Browser (React SPA)
• Static assets served via React public folder or CDN
b. Front-end application
• React components / containers
• Redux store (actions, reducers)
• Axios HTTP client for REST API calls
c. Back-end application
• Express server (server.js)
• Route layer (src/routes, web.js, aiChatRoute.js, momoRoute.js)
• Controller layer (e.g., authController, patientController…)
• Service layer (CRUDservice, authService, patientService…)
• Models (Sequelize definitions) & Migrations/Seeders
• View Engine (EJS templates for admin CRUD pages)
d. Data layer
• Relational Database (MySQL/PostgreSQL)
e. External services
• Momo Payment Gateway (payment initiation & callbacks)
• Email Service (SMTP / third-party provider)
• AI Chat Service (external AI API)
Relationships & data flows
• Browser → React UI
• React → Redux Dispatch → Axios → Express REST endpoints
• Express Routes → Controllers → Services → Models → Database
• Services may call external APIs:
• Momo service for payment requests/callbacks
• Email service for confirmations
• AI Chat endpoint for patient support
• Database migrations and seeders are run at deploy time to prepare schema
Architectural patterns & principles
• Layered architecture (presentation, application, domain, persistence)
• MVC on the server side
• Component/Container pattern on the client side
• Redux for state management
• RESTful API design
• Environment-based configuration
Technologies & frameworks
• Front-end: React, Redux, Axios, SASS/SCSS, Webpack (via Create React App), service workers
• Back-end: Node.js, Express, Sequelize ORM, EJS, dotenv, Nodemailer (or custom email), Momo SDK
• Database: MySQL or PostgreSQL (configured in config/config.json)