How god3tier/heap_project works
Project type and purpose
• This is a full-stack web application called “Up2u” that helps users find food stalls near SMU based on filters (price, cuisine, rating, proximity).
• Frontend: React + Vite single-page application (SPA) deployed on Vercel.
• Backend: Spring Boot (Java 21, Maven) REST API with JWT authentication.
• Database: relational (likely PostgreSQL or another SQL DB via JDBC).
• External service: Google Maps JavaScript & Geocode APIs for map display and geolocation.
File structure
• Top-level:
• backend/ → Spring Boot project (standard Maven layout, controllers, services, repos, security config)
• frontend/up2u-react/ → React + Vite app (components, pages, assets, env configuration)
• Backend layers:
• controller (AuthApiController, StallMealController, UserReviewController)
• service (AuthServiceImpl, StallServiceImpl, UserReviewServiceImpl)
• repo (JPA repositories for User, Stall, Meal, Review)
• security (filters, JWT service, authentication handlers)
• config (ModelMapper, SecurityConfig)
• Frontend modules:
• pages (home, login, signup, search, maps, reviews, list-reviews, about-us)
• components (NavBar, Layout, RatingDropdown, StallsDropdown)
• assets & styles for UI
• Deployment/dev:
• backend Dockerfile + compose.yaml
• frontend Vercel config
• environment files (.env, .env.local)
README for insights
• Backend requires a .env with DB credentials, SECRET_PASSCODE, FRONTEND_URL/PORT.
• Frontend uses VITE_BACKEND_URL and VITE_MAPS_API.
• Illustrates integration points: SPA ←→ REST API ←→ Database and Google Maps.
a. Main components
• Client (Browser) running React SPA
• Frontend server (Vercel or local dev server)
• API Gateway / Load Balancer (optional, for production)
• Spring Boot Application (REST API)
• Relational Database (PostgreSQL)
• External Google Maps APIs (JavaScript & Geocoding)
b. Relationships & interactions
1. User interacts with React SPA → SPA issues HTTP(S) calls to Spring Boot REST endpoints (e.g., /api/stalls, /api/auth/login, /api/reviews).
2. Spring Boot controller → service → repository → DB.
3. Auth flow: SPA sends credentials → AuthController → JwtService → issues JWT → SPA stores token → includes in Authorization header on subsequent requests.
4. Maps integration: SPA loads Google Maps JS API using VITE_MAPS_API key, performs geocoding or map rendering in browser.
c. Architectural patterns
• Frontend: Component-based SPA, client-side routing.
• Backend: Layered (Controller → Service → Repository), JWT-based stateless authentication, ModelMapper for DTO mapping, Spring Security filter chain.
• Database per service (monolithic data store).
• Dockerized backend for consistent deployment.
d. Key technologies
• React, Vite, Node.js, npm
• Spring Boot, Spring Security, JWT
• Maven, Java 21
• PostgreSQL (or similar)
• Docker, Docker Compose
• Google Maps JavaScript & Geocode APIs
Don’t overthink—capture all components
• Frontend: Browser, Vercel, React pages & components.
• Backend: Docker container, Spring Boot layers (controllers, services, repos), security filter.
• Database: relational store.
• External: Google Maps JS & Geocoding API.
• Infrastructure: optional load balancer, Docker Compose network.