How sai-deekshith-06/playo works
What this project is (type + purpose)
This repo is a full-stack, microservices-based web application:
• Frontend: frontend/ is a React + Vite SPA (Tailwind present via tailwind.config.js), with pages for booking, playing, trainers, and player profile flows.
• Backend: services/ is a Spring Boot / Spring Cloud microservices setup orchestrated by Docker Compose, with:
• API Gateway (services/api-gateway) — Spring Cloud Gateway routing + CORS.
• Service Discovery (services/eureka-server) — Netflix Eureka.
• Auth/User service (services/auth-server) — JWT security, registration/login, profile update, Cloudinary image upload, persistence via Postgres, and Redis likely for caching/session/other (per README ports).
Purpose, from structure: a “Sportify”-like platform enabling users to browse sports offerings (games/venues/coaching/events/memberships), book things, and manage user profile/authentication, with a gateway + discovery.
Frontend (frontend/)
Key architectural hints:
• src/Pages/... indicates a page-driven SPA. Major domains:
• Pages/book/* (venues, events, coaching, memberships)
• Pages/play/* (games browsing/filtering)
• Pages/player/* (profile, bookings, feedback)
• Pages/trainer/* (trainers listing/search)
• src/api/axios.js suggests a single HTTP client wrapper (likely baseURL to gateway + interceptors for JWT).
• src/utils/userContext.jsx suggests client-side auth state (context provider for user/session).
Backend (services/)
• docker-compose.yml is the orchestration truth: this is where Postgres/Redis and the Spring services are wired.
• Eureka pattern: services register with Eureka; the API Gateway routes to services by logical name.
• auth-server/security/* and SecurityConfig.java clearly show JWT-based auth.
• auth-server/config/CloudinaryConfig.java + service/UploadImage.java means an external dependency: Cloudinary.
• auth-server/repository/UserRepository.java + entity/User.java means PostgreSQL as source of truth for users.
• README calls out Redis; not shown in code usage from tree alone, but it’s part of deployed architecture and should be diagrammed (possibly used by auth service or future services).
Context / System Landscape (Level 1)
Goal: show the product boundary and external dependencies.
Include:
• End User (Browser)
• Your System: “Sportify Web App”
• External services: Cloudinary
• (Optional) “Future/Other microservices” as a placeholder since Eureka/Gateway suggests expansion
Goal: capture deployable units and runtime communication.
• Browser
• Frontend SPA (React/Vite) — served separately (local dev via Vite; production could be static hosting)
• API Gateway (Spring Cloud Gateway, :8040)
• Eureka Server (:8761)
• Auth Server (Spring Boot)
• PostgreSQL (:5432)
• Redis (:6379)
• Cloudinary (external)
Auth Server → Cloudinary (upload/profile image hosting)
9. API Gateway → Frontend? (usually no; keep it separate unless gateway serves static assets, which isn’t implied here)
Also annotate cross-cutting concerns:
• JWT validation location: either at gateway, auth-server, or both. Given auth-server/security/JwtAuthenticationFilter.java, auth server validates JWT for its endpoints; gateway may just forward (unless configured otherwise—route config file might show filters).
Goal: represent internal structure of the most substantial service (auth-server).
• Controllers:
• AuthController (login/register endpoints)
• UpdateProfileController
• Security:
• SecurityConfig
• JwtAuthenticationFilter
• JwtService
• CustomUserDetailsService
• CustomUserPrincipal
• Data layer:
• UserRepository
• Entities: User, Role
• Integration:
• UploadImage → Cloudinary
• DTO boundary:
• AuthRequest, RegisterRequest, AuthResponse, ErrorResponse
• Error handling:
• GlobalExceptionHandler
• Controllers → Services/Security → Repository → Postgres
• Profile update flow → UploadImage → Cloudinary
• Security filter → JwtService/UserDetailsService → Repository
What to include as labels (technologies + ports + protocols)
• Frontend: React, Vite, Tailwind, Axios
• Gateway: Spring Boot, Spring Cloud Gateway, CORS, routes config
• Discovery: Netflix Eureka
• Auth: Spring Boot, Spring Security, JWT, Cloudinary integration, Spring Data JPA
• Data: PostgreSQL, Redis
• Orchestration: Docker Compose
• Gateway :8040
• Eureka :8761
• Postgres :5432
• Redis :6379
• “HTTPS/REST + JWT”
• “Service registration”
• “Service discovery”
• “JDBC/JPA”
• “Redis protocol”
• “Cloudinary API”
Concrete “component separation” checklist (don’t overthink; split aggressively)
• SPA
• Gateway
• Eureka
• Auth service
• Postgres
• Redis
• Cloudinary
• Controller layer
• Security/JWT filter layer
• Service layer (UploadImage, JwtService, UserDetails)
• Repository/entities
• External integration (Cloudinary)
• Data stores
• GatewayRouteConfig (routes → auth-server)
• CorsConfig
• HealthController
• Any filters (if present later)
(Optional) Request flow sequence: Login + Authenticated Profile Update
• Browser → SPA → Gateway → Auth Controller → Postgres
• SPA stores JWT via context → subsequent request with Authorization header
• Profile update includes image upload → Cloudinary