-
Notifications
You must be signed in to change notification settings - Fork 2
Getting Started
This guide walks through cloning, configuring, running, building, and testing the 360Ghar frontend locally.
- Node.js >= 18 (LTS recommended)
- npm (ships with Node)
- Git
- A Supabase project with Auth enabled
- A Google Cloud project with the Places API and Maps JavaScript API enabled
- (Optional) Local backend running on
http://localhost:3600for full API access
git clone github.com:360ghar/frontend.git
cd frontend
npm installNetlify uses strict peer dependency resolution. If npm install reports ERESOLVE, resolve the conflict locally before pushing. Note that eslint and @eslint/js are pinned to major version 9 because eslint-plugin-react@7.x does not support eslint 10+.
Copy .env.example to .env.local and fill in the values:
cp .env.example .env.local| Variable | Purpose |
|---|---|
VITE_GOOGLE_PLACES_API_KEY |
Google Places autocomplete and Maps JS API |
VITE_SUPABASE_URL |
Supabase project URL (auth SDK) |
VITE_SUPABASE_PUBLISHABLE_KEY |
Supabase anon/publishable key |
VITE_API_BASE_URL |
Backend API base URL. Defaults to /api which the Vite proxy rewrites to http://localhost:3600/api/v1 in dev. In production this points to https://api.360ghar.com. |
Never commit real keys. Use .env.local for machine-specific values.
npm run devStarts the Vite dev server at http://localhost:5173. The /api prefix is proxied to http://localhost:3600 with a rewrite to /api/v1 (see vite.config.js).
npm run buildThe build runs a multi-stage pipeline before Vite bundles the SPA:
- Entity ingestion of Gurgaon area data
-
Sitemap generation (
scripts/generate-sitemaps.mjs) for static, landing, locality, and property URLs -
RSS feeds (
public/rss.xml,public/rss/localities.xml) - Image optimization to AVIF/WebP
- Open Graph image generation
-
Vite build of the React SPA into
dist/ - CSS purge and Bootstrap purge
- HTML prerendering for key routes
To regenerate sitemaps without a full build:
npm run build:sitemapsnpm run previewServes the production dist/ build locally for verification.
npm run lintRuns ESLint 9 with the config in eslint.config.js. Fix all reported issues before committing.
npm testRuns Vitest. Tests live under src/__tests__/ or as *.test.jsx files colocated with source. No formal test suite is fully configured yet; manually verify key flows (auth, property search, contact forms) using npm run dev when tests are missing.
frontend/
├── src/
│ ├── pages/ route-level components by domain
│ ├── components/ feature components by domain
│ ├── common/ shared UI, layout, forms, sidebars, SEO
│ ├── services/ Axios-based API service layer
│ ├── store/ Zustand stores
│ ├── contextApi/ React Context providers
│ ├── data/ static page/feature data
│ ├── styles/ _theme.scss and global styles
│ ├── App.jsx routes
│ └── main.jsx entry with providers
├── public/
│ ├── assets/sass/ SCSS 7-1 architecture
│ ├── data/ public JSON data
│ ├── blueprint3d/ 3D Blueprint tool assets
│ └── sitemap*.xml SEO sitemaps
└── scripts/ build scripts (sitemaps, entity ingestion)
See Architecture for the full system design.
GitHub Wikis require a one-time setup: open the repo's Wiki tab in the browser and create the first page (e.g., Home) through the UI. After that, the .wiki directory can be cloned, pushed, and synced like any other Git remote. Once the first page exists, push the contents of this .wiki/ directory to the wiki remote.