How paul-austin-oswego-csc480-hci521/oz-csc-480-hci-521-spring-2025 works
Project type and purpose
• This is a full-stack web application (“Quotable”) that lets users and guests search, manage, favorite, and share inspirational quotes.
• It uses two Java microservices (user-service and quote-service) on Open Liberty (MicroProfile), a React/Vite frontend, an NGINX proxy, MongoDB as the primary data store, and Google OAuth for authentication.
File structure
• Top-level:
• docker-compose.yml orchestrates containers
• proxy/ holds the NGINX proxy config
• frontend/src/main/frontend contains a React/Vite SPA
• _backend/services/quote-service and user-service each contain a MicroProfile Java service
• Each service has its own Dockerfile, server.xml (Liberty), microprofile-config, resource endpoints (RESTApplication, *Resource.java), and client classes for inter-service calls (UserClient, QuoteClient).
• The .env and microprofile-config.properties define endpoints for proxy, user-service, quote-service, and OAuth credentials.
Main components
a. Client Tier
• User’s Browser (SPA)
b. Presentation & Routing Tier
• React/Vite container (serves index.html, JS/CSS assets)
• NGINX Proxy container (routes /users/* → user-service, /quotes/* → quote-service, /auth/callback → user-service/auth, static → frontend)
c. Business Logic Tier (Microservices)
• User Service
– Modules: Auth (JwtService, SessionService), Accounts, Bookmarks, Notifications, SharedQuotes, UsedQuotes
– Exposes REST endpoints via RestApplication
• Quote Service
– Modules: QuoteCreate/Read/Update/Delete, Moderation (ProfanityClass, DeleteService), Reporting
– Exposes REST endpoints via RestApplication
• Inter-service calls:
– User-service uses QuoteClient to fetch quote info
– Quote-service uses UserClient to fetch user data
d. Data Tier
• MongoDB container (one or two databases/collections for users and quotes; accessed via MongoUtil)
e. External Services
• Google OAuth 2.0 (CLIENT_ID, CLIENT_SECRET, REDIRECT_URI)
Relationships and data flows
• Browser → NGINX Proxy (HTTP) →
• Static assets → React/Vite
• API calls → appropriate microservice
• Microservices → MongoDB (read/write)
• Microservices ↔ each other (UserClient ↔ QuoteClient)
• User-service → Google OAuth (redirect, token exchange)
• Docker Compose orchestrates and links all containers
Architectural patterns & principles
• Microservices: two independent stateless services, each in its own container
• API Gateway / Reverse Proxy: NGINX routes requests and enforces CORS, TLS, host headers
• Single-Page Application: React app decoupled from backend, communicates over JSON REST
• Containerization & Orchestration: Docker Compose defines service dependencies and network links
• Configuration-as-Code: .env, microprofile-config.properties, server.xml
• Automated CI/CD & Testing: GitHub Actions workflows under .github/workflows, Playwright tests