How ha-seungjun/pro_2 works
1. Repository shape
- This is a two-app monorepo: backend/ is a Spring Boot REST API, and front/ is a React single-page application.
- The product is a freight brokerage platform connecting shippers and carriers, with separate experiences for user roles like shipper, carrier, and admin.
2. Top-level runtime boundaries
- The frontend is a browser client that renders pages, manages local auth state, and calls backend APIs through a centralized Axios layer.
- The backend owns all business rules, persistence, authentication, authorization, and role-specific workflows.
- The system is organized around HTTP request/response flows; there is no evidence of a separate message broker or microservice split.
3. Frontend architecture
- src/router defines page-level route groups such as auth, estimate, order, mypage, admin, and service center.
- src/layout/component contains most feature UIs, while src/common and src/components hold shared navigation, headers, footers, and reusable sections.
- src/api is the main integration boundary to the backend, with one API module per domain area.
- src/store, src/slice, and hooks like useCustomLogin indicate client-side auth/session state management, likely centered on JWT handling.
4. Backend entry and cross-cutting concerns
- BackendApplication is the Spring Boot entrypoint.
- Cross-cutting concerns are centralized in config, security, aop, and common.
- SecurityConfig, JwtAuthenticationFilter, JwtService, and OAuth-related classes define authentication flows.
- RequirePermission and PermissionAspect enforce method- or controller-level authorization beyond standard Spring Security checks.
- Global error handling is split between GlobalExceptionHandler, AppGlobalExceptionHandler, and ApiExceptionHandler, with a shared ErrorResponse model.
5. Backend layering
- The backend follows a classic controller/service/repository structure.
- Controllers map HTTP endpoints for each domain.
- Services contain business logic and orchestration.
- Repositories encapsulate persistence queries against MariaDB via Spring Data/JPA-style access.
- DTOs are used heavily between controller and service layers, keeping entities internal to the backend.
6. Core domain subsystems
- Auth and account management: login, signup, password reset, social login, token auth, and user info endpoints.
- Cargo / estimate / matching: shipper cargo registration, freight estimation, carrier acceptance validation, and matching state.
- Delivery: delivery status and owner-facing delivery views.
- Order / payment: order sheets, order completion, payment records, and settlement-related flows.
- Review / report / Q&A / notice: post-delivery reviews, user reports, Q&A boards, and notice boards.
- Admin: dashboard metrics, member management, cargo approval, delivery oversight, and sanctions.
7. Primary business flow
- The main lifecycle appears to be: user signup/login → shipper registers cargo or quotation request → system computes estimate/fees and applies coupon or distance discounts → carrier reviews and accepts matching → delivery progresses through status states → payment completes → review/reporting becomes available.
- This lifecycle is split across dedicated controllers and services rather than one large workflow service.
8. Role- and permission-based access
- The README emphasizes shipper, carrier, and admin views, and the code reflects that with separate controller groups and frontend routers for admin and mypage.
- Permission checking is not purely route-based; backend aspect-oriented authorization suggests business actions are guarded centrally.
- The frontend also has auth guards such as RequireAuth, and admin-specific UI containers like AdminLayout and AdminSidebar.
9. External integrations and infrastructure
- OAuth providers: Google, Naver, and Kakao are integrated for social login, with callback pages in the frontend and OAuth service/config classes in the backend.
- Email: there is a dedicated email verification controller/service for account verification and likely password reset support.
- Cloudinary: backend config and service classes indicate image upload/storage integration, used especially for user profiles or related media.
- Local file storage: the repo also includes upload directories under backend/uploads and top-level uploads, suggesting some assets are stored on disk as well.
10. Data model and persistence
- Entities are organized by domain package: member, cargo, delivery, estimate, matching, order, payment, review, report, qaboard, noboard, and oauth.
- The database appears to be MariaDB from the README, with repositories such as AdminDashboardRepository, PaymentRepository, ReviewRepository, and QAPostRepository.
- Several projection/row-style repository classes and DTOs indicate custom query views for dashboards and analytics.
11. Analytics, dashboards, and scheduled jobs
- Dashboard features are first-class: admin metrics, owner metrics, and likely shipper/carrier summaries are surfaced through dedicated service/controller pairs.
- CouponScheduler indicates background scheduling for coupon lifecycle or periodic cleanup/updates.
- Dashboard repositories and monthly DTOs suggest aggregate queries over orders, deliveries, revenue, and member growth.
12. Frontend/backend API contract
- The frontend is structured around domain-specific API modules that mirror backend controllers, making the API boundary explicit and stable.
- This symmetry is strongest in domains like admin, delivery, estimate, payment, qna, review, and user info.
- The result is a coarse-grained REST integration model: UI components call feature APIs, APIs map to Spring controllers, and services perform the actual business operations.
13. Static assets and UI delivery
- The backend includes resources/static and SQL seed files, but the deployed UI is primarily the React build in front/build.
- The frontend build output shows the app is shipped as static assets, which can be hosted independently from the API server.
- The backend likely serves only API responses and possibly uploaded/public assets, not the main SPA in production.
14. What to draw in an architecture diagram
- Show a browser-based React SPA on the left, a Spring Boot API on the right, and MariaDB plus file/image storage beneath the backend.
- Add external identity providers for social login, email service for verification/reset, and Cloudinary or file storage for profile/media uploads.
- Group backend domains into auth/account, freight/matching, delivery/order/payment, review/report/Q&A/notice, and admin/analytics.
- Indicate cross-cutting security via JWT filter + Spring Security + permission aspect, and separate frontend route guards and token storage.
Main entry points: service Domain Services · src Browser App · security Security Core · controller Auth & Account
Components 20
Frontend SPA
React client-side application and its feature composition.
- Browser App · Client-side freight brokerage UI rendered in the browser.
front/src - Route Map · Page-level route groups for auth, estimate, order, mypage, admin, and service center.
front/src/router - UI Shell · Shared headers, nav, layouts, and reusable feature components.
front/src/layout/component - API Layer · Centralized domain API modules that call the backend.
front/src/api - Auth State · Local login/session state, token storage, and route guards.
front/src/store
Backend API
Spring Boot REST API, business logic, and persistence.
- Boot App · Backend application entrypoint and startup wiring.
backend/src/main/java/com/giproject/BackendApplication.java - Security Core · Spring Security, JWT filters/services, OAuth success handling, and permission aspect enforcement.
backend/src/main/java/com/giproject/security - Cross-Cutting · CORS, OAuth clients, Cloudinary, exception handling, and shared app configuration.
backend/src/main/java/com/giproject/config - Auth & Account · Login, signup, password reset, social auth, email verification, and user info.
backend/src/main/java/com/giproject/controller - Freight Flow · Cargo registration, estimate calculation, fees, verification, and matching workflow.
backend/src/main/java/com/giproject/controller - Ops Flow · Delivery status, order sheets, payment completion, and owner-facing views.
backend/src/main/java/com/giproject/controller - Community · Reviews, reports, Q&A boards, and notice board content.
backend/src/main/java/com/giproject/controller - Admin Ops · Admin dashboards, member controls, cargo approval, delivery oversight, sanctions, and metrics.
backend/src/main/java/com/giproject/controller/admin - Domain Services · Orchestration layer implementing business rules across domains.
backend/src/main/java/com/giproject/service - Repositories · Spring Data/JPA repositories and custom query projections against MariaDB.
backend/src/main/java/com/giproject/repository - Domain Models · Entities and DTOs for members, cargo, delivery, orders, payment, reviews, and boards.
backend/src/main/java/com/giproject/entity
External Systems
Outside services and storage used by the platform.
- MariaDB · Primary relational datastore for the platform.
- OAuth Providers · External identity providers for social login.
- Email Service · Email verification and reset-related outbound mail delivery.
- File Storage · Cloudinary and local upload storage for profile and media assets.
Connections 24
- Browser App → Route Map: navigates · The SPA renders page flows through route groups.
- Browser App → UI Shell: composes · Pages are assembled from shared shells and reusable components.
- Browser App → API Layer: calls · Feature UI talks to backend through centralized API modules.
- Browser App → Auth State: stores session · Client maintains login state and JWT-related guards.
- Route Map → UI Shell: mounts · Route groups load the relevant page layouts and feature containers.
- Auth State → API Layer: attaches token · Authenticated requests use stored token and auth helpers.
- Boot App → Security Core: boots with · Application startup wires security and auth infrastructure.
- Boot App → Cross-Cutting: loads · Bootstraps config, CORS, OAuth clients, and error handling.
- Security Core → Auth & Account: protects · JWT and permission checks guard account endpoints and workflows.
- Security Core → OAuth Providers: delegates social auth · OAuth login flows rely on external providers.
- Security Core → File Storage: authorizes uploads · Media/profile flows are secured alongside storage integration.
- Auth & Account → Domain Services: orchestrates · Controllers delegate auth and account business logic to services.
- Freight Flow → Domain Services: orchestrates · Cargo, estimate, fees, verification, and matching are handled in services.
- Ops Flow → Domain Services: orchestrates · Delivery, order, and payment controllers call service layer workflows.
- Community → Domain Services: orchestrates · Boards and moderation features are implemented via services.
- Admin Ops → Domain Services: orchestrates · Admin metrics and operations are service-driven.
- Domain Services → Repositories: queries · Services persist and read via repositories.
- Repositories → MariaDB: stores · Repositories access the MariaDB-backed persistence layer.
- Domain Services → Domain Models: maps data · Business logic exchanges entities and DTOs across layers.
- Domain Models → Repositories: backed by · Entities and projections shape repository access patterns.
- Auth & Account → Email Service: verifies · Email verification and password reset use outbound mail.
- Auth & Account → OAuth Providers: social login · Social signup/login integrates Google, Naver, and Kakao.
- Freight Flow → File Storage: uploads media · Cargo or user-related images can flow to Cloudinary/local storage.
- Admin Ops → MariaDB: reads metrics · Dashboard and moderation views aggregate stored operational data.