How annguyenbinh03/fufleamarket works
Based on our analysis, this project is a full‐stack application with multiple front‐end clients (a mobile app built with React Native/Expo found under the “mobile” directory and a web app in the “react” directory) and a robust backend built in .NET (see the “TestFUFM” folder with its layered structure including Business Objects, DTOs, Repositories, Services, and a WebAPI). There is also a set of static HTML/CSS pages that seem to serve a legacy or administrative front end.
Client Applications
a. Web Client
• Located under “react”
• Uses React and related libraries for UI and API integration
b. Mobile Client
• Located under “mobile”
• Built on React Native / Expo
• Uses APIs to connect with backend services
c. Static HTML/CSS pages
• Found in “HTML CSS”
• Likely serve static views or legacy admin pages
Backend API (WebAPI)
• Found under “TestFUFM/WebAPI” – handles HTTP requests
• Controllers such as CategoryController, OrderController, ProductController, etc.
• Exposes REST endpoints for the clients
• Contains integration code, e.g., VNPay for payment processing
Business/Application Logic Layers
a. Business Objects
• Contains domain models and context (e.g., FufleaMarketContext)
• Located in “TestFUFM/BusinessObjects”
b. Data Transfer Objects (DTOs)
• Acts as contracts between backend layers; located in “TestFUFM/DTO”
c. Repository Layer
• Abstracts database access; located in “TestFUFM/Repository”
• Contains interfaces and concrete repository classes
d. Service Layer
• Contains business rules and workflow logic
• Includes background services (e.g., PromotionPackagesService, StatusOrderService) and various domain-specific services
• Found in “TestFUFM/Service” with several functional areas (order totals, product totals, etc.)
Data Persistence
• While not explicitly a “database” folder, the presence of contexts (e.g., FufleaMarketContext) and SQL scripts in the “document” folder (FUFM.sql, DeleteAllTableAzure.sql) indicate a relational database (likely MS SQL) that stores data model entities.
External Integrations & Utilities
• VNPay integration found in “TestFUFM/BusinessObjects/VNPay” and in the WebAPI controllers
• Configuration files (e.g., appsettings.json) governing environment-specific settings
Architectural Patterns and Design Principles
• Layered architecture separating concerns (Controllers → Business Logic/Services → Repositories → Database)
• The use of DTOs and Mappers to decouple internal models from external representations
• Modular separation permitting individual testing and maintenance of mobile, web, and backend components
– Group the “Web Client (React)” and “Mobile Client (React Native/Expo)” with a note that they are separate front-end interfaces communicating via HTTP/HTTPS.
– Optionally, include the “Static HTML/CSS” component as a legacy/admin interface if applicable.
– Represent the WebAPI as the primary entry point for client requests.
• In the center or next to the WebAPI, show the Application Layers:
• A database component:
– Represent the relational database (MS SQL or similar) and indicate that it stores models represented in BusinessObjects (e.g., Product, Order, User).
• External services:
– Optionally, note any other external APIs if mentioned in documentation or inferred (e.g., authentication through Google SignIn as seen in the DTO and controller names).
• For design clarity, use:
– Clear labels for each component with concise descriptions
• Tailoring to the Project’s Purpose:
– Given the project might be an “OnDemandTuroring” platform (as per the README) but seems to have evolved with market-like functionalities (products, orders, promotions), clearly label components that support user interactions (ordering, chatting, product listings) along with admin functions.
– Highlight the micro-level detail in the backend (e.g., separate controllers for Contacts, Orders, Trading Orders, etc.) to indicate a modular design where each domain function is isolated.
• Final Touches: