How minhtan0804/foos-store-fe works
Project type and purpose
• This is a single-page application (SPA) built with React, TypeScript, and Vite.
• It serves as the front-end of an e-commerce & content management system, with both public store pages (home, products, cart, payment, blogs, reviews) and an admin console (product, order, user, review, article, addon management).
• It communicates via RESTful APIs (src/apis) to a back-end service and is deployed as a static site behind Nginx in Docker.
File structure
• Top level:
• Dockerfile + .nginx/nginx.conf → containerized static server
• .github/workflows/ci-cd.yml → CI/CD pipeline
• .env/.env.example → environment variables for API endpoints, feature flags, etc.
• vite.config.ts, tsconfig.json → build and TypeScript setup
• src/apis: type-safe axios wrappers for each resource (auth, product, order, cart, etc.)
• src/lib/react-query & src/lib/axios: shared HTTP client and query client
• src/pages + src/routes: React Router-driven page modules (public vs protected/admin)
• src/components + src/layout: reusable UI pieces and page layouts
• src/store + react-query: client-side state management and server cache
• config, constants, helper, hooks, i18n, assets, styles: cross-cutting concerns
README
• Standard React+TS+Vite template with HMR and ESLint.
Elements
• Labels: “Browser”, “React App”, “API Layer”, “E-commerce API Service”, “Database”, “File Storage”, “Payment Gateway”, “CI/CD Pipeline”, “Docker & Nginx”.
• Build → Container → Deployment
• Browser → Nginx → React App → API Layer → Back-end
• API calls → Database/File/Payment Gateway
• Rectangles for applications/components
Final advice
• Be very granular: split your front-end into UI, state management, API, build/deploy.
• Both happy-path (data fetch) and auth-flow (login → token storage → protected routes).
• Full lifecycle: code commit → CI → build → deployment → runtime in browser → API interactions.