DAIET is a modern React single-page application for fitness and nutrition services, built with Vite. It includes program plans, recipes, BMI calculator, testimonials, and a contact form with a responsive UI and theme toggle (dark/light).
- Vercel: https://daiet-six.vercel.app/
- React 19
- React Router DOM 7 (
BrowserRouter) - Vite 7
- Tailwind CSS 4
- Framer Motion
- ESLint 9
- Multi-page SPA routing:
- Home
- Programs
- Recipes
- BMI Calculator
- Testimonials
- Contact
- Dark/Light theme toggle with persistence
- Responsive layout for desktop and mobile
- Animated UI interactions (Framer Motion)
- Local optimized image usage from
public/images
src/
components/
hooks/
pages/
App.jsx
main.jsx
public/
images/
npm installnpm run devnpm run buildnpm run previewnpm run dev- start local dev servernpm run build- create production build indist/npm run preview- preview production build locallynpm run lint- run ESLintnpm run deploy- deploydist/to GitHub Pages (optional)
This project is configured for SPA routing on Vercel:
vercel.jsonrewrites all routes toindex.htmlvite.config.jsuses:base: process.env.VITE_BASE_PATH || '/'
main.jsxuses:<BrowserRouter basename={import.meta.env.BASE_URL}>
- Framework Preset:
Vite - Build Command:
npm run build - Output Directory:
dist
For normal Vercel deployment, keep VITE_BASE_PATH unset (defaults to /).
Set it only when deploying under a subpath (example: /daiet/).
This project is for educational and portfolio use.