How cjc0623/real_pro works
1. Repository shape
- This is a full-stack monorepo with two major applications: backend/ in Spring Boot + Java and front/ in React.
- The backend exposes a REST API for the frontend SPA, and the frontend is built as a client-side application with routed pages and feature-specific components.
2. Backend layering
- The backend follows a classic controller → service → repository → entity structure.
- Controllers are split by business domain (member, cargo, delivery, payment, review, admin, qaboard, etc.).
- Services contain the business rules and orchestrate persistence, validation, and external calls.
- Repositories provide database access, mostly through Spring Data-style persistence, with some query-specific repositories for dashboard/reporting views.
- DTOs are used heavily to keep API contracts separate from entities.
3. Core business domains
- The central domain is a cargo transport matching platform connecting shippers/owners and drivers/carriers.
- Main flows include:
- member signup/login and profile management
- cargo registration and verification
- estimate creation and matching/direct request handling
- delivery lifecycle tracking
- order and payment processing
- review, report, and trust/score management
- Admin functionality is a first-class domain rather than an afterthought.
4. Authentication and authorization boundary
- Security is built around JWT-based authentication with a custom JwtAuthenticationFilter, JwtService, and token utility classes.
- There is also OAuth2 login/signup support for social providers, with dedicated services and success handling.
- Authorization is enforced through a combination of Spring Security config and a custom @RequirePermission annotation backed by an AOP aspect.
- Token revocation/blacklisting is supported through dedicated persistence and service components, which matters for logout and password reset flows.
5. External identity and communication services
- The backend integrates with Google/Naver OAuth for social login.
- Email verification is handled as a separate service/controller boundary.
- Payment verification integrates with an external payment provider via a dedicated verification service.
- There is also a map/proxy layer and AI/chat-related controllers/services, indicating some requests are mediated through the backend rather than calling third-party APIs directly from the browser.
6. Cargo, estimate, matching, and delivery flow
- The logistics pipeline is: cargo registration → estimate/matching → order/payment → delivery tracking.
- estimate and matching packages handle the quote and acceptance logic, while delivery manages delivery status and owner-specific delivery views.
- Separate controllers for owner and admin views suggest different projections over the same core delivery data.
- directrequest indicates an alternate path where requests can be sent directly rather than through the standard matching flow.
7. Payment, fees, and coupon processing
- Payment is a separate subsystem with its own entities, repository, controller, and service layer.
- Fee calculation is split into basic and extra fee domains, with configurable business logic in the backend.
- Coupons are modeled explicitly and include a scheduler, so some discount logic is time-based or periodically updated.
- This subsystem is tightly coupled to order and delivery state, since payment completion likely gates later lifecycle steps.
8. Member, profile, and trust features
- Member management includes signup/login, profile editing, password reset, and social account linkage.
- The system also stores carrier/driver-specific profile data and trust-related DTOs such as review summaries and profile cards.
- Profile photo uploads are supported via backend-managed upload folders and static resources.
- Identity verification for carriers is modeled as a dedicated cargo-owner verification subsystem.
9. Review, report, and community subsystems
- Reviews are a full CRUD domain with images and replies, not just a simple rating table.
- Reports are separate from reviews and are used for user moderation and admin review.
- Notice boards, Q&A boards, and personal inquiry flows are split into distinct modules, with admin response handling where appropriate.
- Notification support exists as a standalone domain, suggesting asynchronous or summary-style user alerts.
10. Admin and analytics boundary
- Admin pages aggregate data across members, cargo, delivery, reports, notices, fees, and sanctions.
- Dashboard DTOs and query rows indicate read-optimized reporting paths separate from transactional entities.
- Admin services are grouped by function: member management, delivery management, dashboard analytics, and sanctions.
- This domain is important for diagramming because it crosses many other bounded contexts rather than owning one of its own.
11. Frontend architecture
- The React app is organized by pages, layouts, route groups, feature components, and API clients.
- src/router defines route boundaries, while src/layout contains domain-specific UI shells such as admin, mypage, order, estimate, and auth flows.
- src/api mirrors backend domains with dedicated API modules, which makes the frontend a thin orchestration layer over the backend REST API.
- State is managed with Redux slices for login/auth, plus custom hooks for auth and navigation.
12. Frontend–backend data flow
- User actions in React call domain-specific API modules, which use an axios setup layer for shared headers and token handling.
- JWT access state is persisted in a client-side token store and reused across protected routes.
- The frontend uses route guards for authenticated pages and role-based UI for admin/member separation.
- This makes the browser the presentation layer while the Spring backend remains the source of truth for authorization and business state.
13. Persistence and schema model
- The backend stores most business objects as entities in a relational database, consistent with the repo’s MariaDB target.
- There are separate entity packages for account/auth, cargo, delivery, estimate, fees, matching, member, payment, Q&A, review, report, and notice domains.
- Some query-only models and row projections are used where the UI needs aggregated or dashboard-shaped data.
- Seed SQL files in resources suggest initial board/content data is loaded on startup or during setup.
14. Operational concerns and file handling
- File uploads are part of the architecture, with dedicated folders for user profiles and cargo-related assets.
- Static resources and frontend build artifacts are present, indicating the app can serve branded assets and packaged UI output.
- Global exception handling is centralized, so domain errors are normalized before reaching the client.
- There is also a scheduler and data loader, implying some business processes run outside request/response traffic.
15. What to show in an architecture diagram
- Draw the system as React SPA → Spring REST API → MariaDB, with side connections to OAuth providers, email service, payment verification, AI/chat, and map/proxy services.
- Inside the backend, group the API by business domains, and show security/auth as a cross-cutting layer in front of all protected endpoints.
- Highlight the main end-to-end flows: signup/login, cargo/estimate/matching, payment/delivery, reviews/reports, and admin analytics/moderation.
Main entry points: BackendApplication.java REST API · repository Persistence · router Routes · security Security
Components 21
React SPA
Client-side presentation layer and route-driven feature UI.
- React app · Route-based SPA that renders pages, layouts, and feature components.
front/src - Routes · Defines public, protected, admin, and feature route boundaries.
front/src/router - API clients · Domain-specific REST clients wrapping shared axios/token handling.
front/src/api - Auth UI · Login, signup, OAuth callback, password reset, and route guards.
front/src/layout/component/users - Feature UI · Order, estimate, delivery, review, Q&A, notification, and mypage components.
front/src/layout/component - Admin UI · Admin pages for members, cargo approval, delivery, fees, reports, and notices.
front/src/layout/component/admin
Spring API
REST backend with business domains, security, persistence, and integrations.
- REST API · Main application entry and HTTP API surface.
backend/src/main/java/com/giproject/BackendApplication.java - Security · JWT filter/service, OAuth2 success handling, permission aspect, and token blacklist.
backend/src/main/java/com/giproject/security - Auth & members · Signup, login, password reset, social auth, member profile, and coupon linkage.
backend/src/main/java/com/giproject/service/auth - Cargo flow · Cargo registration, owner verification, estimates, matching, and direct requests.
backend/src/main/java/com/giproject/service/estimate - Delivery flow · Delivery lifecycle, owner delivery views, and delivery state projections.
backend/src/main/java/com/giproject/service/delivery - Order & payment · Order sheets, payment completion, fee calculation, coupon usage, and provider verification.
backend/src/main/java/com/giproject/service/payment - Trust & comms · Reviews, reports, notices, Q&A, notifications, email verification, and AI/chat/map mediation.
backend/src/main/java/com/giproject/service/review - Admin ops · Dashboard analytics, member moderation, delivery oversight, sanctions, and reporting views.
backend/src/main/java/com/giproject/service/admin - Persistence · Entity and repository layer for MariaDB-backed domain state and query projections.
backend/src/main/java/com/giproject/repository - Scheduler & seed · Coupon scheduler, data loader, and startup seed content.
backend/src/main/java/com/giproject/config
External systems
Third-party providers and outbound service boundaries.
- OAuth providers · External social identity providers used for login and signup.
- Mail service · Outbound email verification and account communication channel.
- Payment gateway · External payment verification service used during payment completion.
- Map & AI · Map proxy and AI/chat-related external request targets mediated by the backend.
- MariaDB · Primary relational store for members, cargo, delivery, payment, reviews, and admin projections.
Connections 29
- React app → Routes: navigates · Application pages are selected through route definitions.
- Routes → Auth UI: public/protected · Routes split into authentication and account flows.
- Routes → Feature UI: feature pages · Routes mount logistics, order, review, Q&A, and profile screens.
- Routes → Admin UI: admin pages · Routes expose backoffice views for privileged users.
- Auth UI → API clients: auth calls · Login, signup, reset, and social callback screens call backend APIs.
- Feature UI → API clients: domain calls · Feature components invoke domain REST clients.
- Admin UI → API clients: admin calls · Admin screens consume reporting and moderation APIs.
- API clients → REST API: REST · Frontend clients send requests to the Spring backend.
- REST API → Security: protected by · Most endpoints are guarded by JWT, OAuth2, and permission checks.
- Security → Auth & members: establishes identity · Security components authenticate and authorize member sessions.
- Security → Admin ops: authorizes · Admin and role-based permissions are enforced before backoffice access.
- REST API → Auth & members: member APIs · Authentication, profile, password reset, social signup, and coupons.
- REST API → Cargo flow: cargo APIs · Cargo registration, verification, estimate, matching, and direct request endpoints.
- REST API → Delivery flow: delivery APIs · Delivery lifecycle and owner-specific delivery views.
- REST API → Order & payment: order/payment APIs · Order sheet creation, payment processing, fee logic, and coupon application.
- REST API → Trust & comms: community APIs · Reviews, reports, notices, Q&A, notifications, email, AI, and map proxy.
- REST API → Admin ops: admin APIs · Admin controllers aggregate members, cargo, delivery, sanctions, and dashboards.
- Auth & members → Persistence: stores · Member, social account, revoked token, and coupon state persists in repositories.
- Cargo flow → Persistence: stores · Cargo, estimate, matching, and verification data are persisted.
- Delivery flow → Persistence: stores · Delivery entities and owner query rows are persisted and read back.
- Order & payment → Persistence: stores · Orders, payments, fees, and coupons use repository-backed state.
- Trust & comms → Persistence: stores · Reviews, reports, boards, notifications, and chat messages persist through repositories.
- Admin ops → Persistence: reads/writes · Admin workflows use transactional entities and dashboard projections.
- Scheduler & seed → Persistence: seed/update · Scheduled coupon work and startup loading touch persisted data.
- Security → OAuth providers: oauth2 login · Social authentication is delegated to Google and Naver.
- Trust & comms → Mail service: verify email · Email verification sends outbound mail through a dedicated service.
- Order & payment → Payment gateway: verify payment · Payment completion is confirmed against an external provider.
- Trust & comms → Map & AI: proxy calls · Map and AI/chat interactions are mediated through backend services.
- Persistence → MariaDB: MariaDB · Repository layer stores the domain model in the relational database.