How tanbinhphuoc/swp391-druguseprevention-fe works
Project type and purpose
• This is a single‐page application (SPA) built with React and Vite.
• Its primary purpose is to provide a modular UI for various user roles (admin, manager, staff, consultant, user) and features (articles, blogs, services “dichvu,” resources, authentication, dashboards, etc.).
• No backend code resides here; data is fetched via the api abstraction in src/services/api.js or mocked in src/mock.
File structure
• Top-level files:
• package.json / package-lock.json – dependency and script manifest
• vite.config.js – build & dev server config
• postcss.config.js, tailwind.config.js – CSS build pipeline
• eslint.config.js – linting rules
• index.html – SPA shell
• src/main.jsx: application entry point (mounts App)
• src/App.jsx: root component & router layout
• src/components: feature-based folders (home, login, admin, manager, staff, user, article, blog, dichvu/*, resource)
• src/services/api.js: API wrapper (fetch/post calls)
• src/mock: mock data for dev/testing
• public: static assets
README for additional insights
• Confirms it’s the standard Vite + React SPA template
• Uses HMR via @vitejs/plugin-react or SWC plugin
• Encourages ESLint + PostCSS + Tailwind for styling and linting