A comprehensive, modern React application connecting Freelancers and Employers.
Milestone is a full-featured freelance marketplace frontend built with React 19, Vite, and Tailwind CSS. It supports multiple user roles (Admin, Employer, Freelancer, Moderator) and features real-time chat, job postings, interactive maps, payment integrations, and rich dashboards.
- Role-Based Access Control: Tailored dashboards and routing for Admins, Employers, Freelancers, and Moderators.
- Real-Time Communication: Integrated
socket.io-clientfor live chat and instant notifications. - Job Board & Applications: Seamless job listing browsing, smart filtering, and application management.
- Payment Integration: Secure transaction flows utilizing Razorpay.
- Interactive Maps & Analytics: Geographical data visualization with React Leaflet and metric tracking with Recharts.
- Robust Forms & Validation: Built with Formik and Yup for seamless data entry.
- State Management: Redux Toolkit for global state and Redux Persist for local storage caching.
- Production-Ready Dockerization: Multi-stage Docker builds powered by an optimized Nginx configuration.
The application is built as a Single Page Application (SPA) utilizing a modern component-based architecture.
graph TD
Client[Client Browser]
subgraph "Frontend Environment (Docker / Nginx)"
Nginx[Nginx Web Server]
subgraph "React Application"
Routing[React Router DOM]
subgraph "State Management"
Redux[(Redux Store)]
Persist[Redux Persist]
Redux --- Persist
end
subgraph "Core Modules"
Auth[Authentication & JWT]
Pages[Role-Based Pages]
Components[Smart/Dumb Components]
end
Routing --> Pages
Pages --> Components
Pages --> Redux
Components --> Redux
end
Nginx -->|Serves optimized static assets| Routing
end
subgraph "External & Backend Services"
API[Backend REST API / Node.js]
Socket[Socket.IO Server]
Razorpay[Razorpay Gateway]
end
Client -->|HTTP Request| Nginx
Auth -->|Axios REST| API
Components -->|Axios REST| API
Components -->|WebSockets| Socket
Pages -->|Payment Intents| Razorpay
| Category | Technologies |
|---|---|
| Core | React 19, Vite, JavaScript (ES6+) |
| State & Routing | Redux Toolkit, Redux Persist, React Router DOM v7 |
| Styling & UI | Tailwind CSS v4, Lucide React |
| Network & Real-time | Axios, Socket.io-client |
| Forms & Validation | Formik, Yup |
| Data Viz & Maps | Recharts, React Leaflet |
| Testing | Vitest, React Testing Library, ESLint |
| Deployment | Docker, Nginx |
src/
├── assets/ # Static assets (images, icons)
├── components/ # Reusable UI components (Navbars, Modals, Smart Filters)
├── context/ # React Context providers
├── hooks/ # Custom React hooks
├── pages/ # Route-level components grouped by role (Admin, Employer, Freelancer...)
├── redux/ # Redux Toolkit slices, selectors, and store configuration
├── styles/ # Global styles and Tailwind configurations
└── utils/ # Helper functions, API constants, and formatters
The project uses a local .env file for development configuration.
# Backend base URL compiled into the production frontend build
VITE_BACKEND_URL=http://localhost:9000
# Optional alias used in parts of the codebase
VITE_API_BASE_URL=http://localhost:9000Note
For Docker production builds, pass the backend URL using build arguments instead of .env files.
- Node.js (v20+ recommended)
- npm or yarn
-
Clone the repository and install dependencies:
npm install
-
Start the development server:
npm run dev
The application will be available at
http://localhost:5173. -
Running Tests:
npm run test # Run Vitest npm run test:coverage # Generate coverage report
This frontend is fully productionized. The Docker context aggressively excludes unnecessary files via .dockerignore for faster, cleaner image builds.
Dockerfile: Multi-stage build (Node 20 builder + Nginx runtime).nginx.conf: SPA-safe routing (unknown routes fallback to/index.html) and aggressive static asset caching.
1. Build the image (Injecting the API URL):
docker build -t milestone-frontend --build-arg VITE_BACKEND_URL=http://localhost:9000 .2. Run the container:
docker run --rm -p 3000:80 milestone-frontendOpen http://localhost:3000 in your browser.
If you are running the backend in tandem:
cd ../m-backend
docker compose up -d --buildExpected Services:
- MongoDB:
27017 - Backend API:
9000 - Frontend:
3000
Warning
Frontend loads, but API calls fail:
You likely built the Docker image with the wrong backend URL. Rebuild the frontend providing the correct VITE_BACKEND_URL.
Tip
Routes return 404 after refresh (Nginx):
Ensure the container is utilizing the included nginx.conf. It relies on SPA fallback routing:
try_files $uri $uri/ /index.html;