React + Vite implementation of the Melking experience (manager, resident, and public portals) with Redux Toolkit and end-to-end API integration with the Django backend.
- Node.js 20.x (use
nvm use 20or install from nodejs.org) - npm 10+
- Modern browser supporting ES2020
cd frontend
npm install
cp env.example .env.local # یا فایل را دستی بسازید
npm run devVisit http://localhost:5173 – the dev server will call the backend defined in VITE_API_BASE_URL.
| Command | Description |
|---|---|
npm run dev |
Start Vite dev server with HMR |
npm run build |
Production build (outputs to dist/) |
npm run preview |
Preview the built bundle locally |
npm run lint |
ESLint (JS + JSX) checks |
All Vite variables require the VITE_ prefix. Copy env.example to .env.local (development) or .env.production (CI/CD) and update the values.
| Variable | Description | Example |
|---|---|---|
VITE_API_BASE_URL |
Base URL for the Django REST API | https://melkingapp.ir/api/v1 |
frontend/
├─ public/ # Static assets copied as-is
├─ src/
│ ├─ app/ # Redux store configuration
│ ├─ features/ # Domain slices + UI
│ ├─ layout/ # Shell layouts
│ ├─ pages/ # Route-level pages
│ ├─ shared/ # Components, hooks, services, utils
│ ├─ config/api.js # API base + endpoint helpers
│ └─ styles/ # Global styles / fonts
├─ env.example # Sample environment variables
└─ .github/workflows/ # CI/CD definitions
ci-cd.yml mirrors the backend pipeline with Node tooling:
- Install & Cache –
npm cion Node 20 with dependency cache - Lint –
npm run lint - Build –
npm run build(injectsVITE_API_BASE_URLfrom secrets) - Deploy – Copies
dist/to/var/www/melking/frontend-new, updates thecurrentsymlink, reloads Nginx, and health-checksDEPLOYMENT_URL - Notify – Emits success/failure hooks (replace with Slack/Discord/etc.)
Read CI_CD_SETUP.md, DEPLOYMENT.md, and .github/SECRETS_SETUP.md for the detailed checklist (secrets, server prep, troubleshooting).
API_INTEGRATION_README.md– Backend ↔ Frontend endpointsCI_CD_SETUP.md– GitHub Actions & secrets checklistDEPLOYMENT.md– Server steps (directory layout, Nginx, health checks).github/workflows/README.md– Workflow overview
Need help? Open an issue in melkingapp/frontend یا به تیم DevOps/FE پیام بدهید. Happy shipping! 🚀