live: https://wildr.onrender.com/
A React + React-Bootstrap app for discovering and booking campsites.
- Install dependencies
cd frontend
npm install
- Create environment file
Copy .env.example to .env and set your keys:
REACT_APP_WEATHER_API_KEY=your_openweather_api_key
- Run the app
npm start
App runs at http://localhost:3000
- Campsites live in
frontend/src/pages/campsiteData.js(raw) and are normalized viafrontend/src/pages/campsites.js. - Normalized fields exposed to the app:
images: array of{ url, caption, credit }coverImage: string URLcoordinates:[lat, lon]if presentmapLink,weatherLink: computed if not provided
Use import campsites from './pages/campsites' anywhere you need campsite data.
REACT_APP_WEATHER_API_KEY(OpenWeather). Without a key, a mock value is used on the detail page.
Safe-guard: ensure .env files are git‑ignored; only .env.example should be committed.
- Global error boundary:
src/components/ErrorBoundary.js. - 404 route:
src/pages/NotFoundPage.js.
- Client merges server bookings from
GET /bookings/mewith locally saved pending bookings when the backend is unavailable. - Local pending storage key:
pending_bookings.
npm start– start dev servernpm run build– production build
Deploy the frontend build to a static host (Netlify/Vercel/etc.).
- Build
npm run build
- Deploy the
frontend/builddirectory. Ensure environment variables are configured in the hosting provider.
This project expects imports at the top of each module and standard ESLint rules.
- Unit tests for data normalization in
pages/campsites.js. - Integration test for booking flow and no‑coordinates fallback.
