How culesbao/find-job-be works
Project type and purpose
• This is a Spring Boot–based backend RESTful API for a job‐finding platform (“find-job-be”).
• It exposes endpoints for account management, job postings, profiles, applications, followers, chat, and file uploads.
• It uses JWT‐based security, OAuth2 social login, Cloudinary for file storage, email service, and a Gemini AI integration.
File structure
• Top-level:
• Dockerfile & docker-compose.yml for containerizing the app plus its backing services (database, message broker, etc.).
• pom.xml and .mvn wrapper for Maven build.
• src/main/java/com/findjobbe/findjobbe:
• config: Spring beans, security setup, password encoding, message bundles.
• controller: REST controllers (AccountController, JobController, ChatController, etc.).
• service (and impl): business logic interfaces and implementations.
• repository: Spring Data JPA repositories.
• model: JPA entities.
• mapper: DTO ↔ request/response mappers.
• security: JWT filter, entry point, token manager, OAuth2 success handler.
• factory: factory classes to pick follower/profile services.
• exception: custom exception types and global error handler.
• utils: small helpers (e.g., code generation).
• resources: application.properties, SQL seed files, email template.
• test: one smoke test for the Spring context.
Key README insights
• Minimal README, so no built-in architecture doc. We must infer a layered, monolithic microservice.
a. Client(s)—Web or Mobile UI (external to this repo)
b. API Gateway / HTTP Layer—Spring MVC controllers + Spring Security filters (JWT, OAuth2)
c. Business Layer—Service interfaces and implementations
d. Data Layer—Spring Data repositories + JPA entities + SQL seed scripts
e. External Services:
• Cloudinary (file storage)
• SMTP server (email verification)
• OAuth2 Providers (Google, Facebook, etc.)
• (Optionally) Gemini AI service
f. Infrastructure:
• Docker container running the Spring Boot app
• docker-compose orchestrating the app, database (MySQL/Postgres), possibly Redis or RabbitMQ (if used)
Relationships and interactions
• Client → HTTP request → Security Filter Chain (JWTAuthenticationFilter) → Controller
• Controller → calls Service → Service → Repository → Database
• Service → calls external APIs (Cloudinary, MailServiceImpl→SMTP, OAuth2ServiceImpl→OAuth provider, GeminiServiceImpl→AI endpoint)
• Errors bubble up as custom exceptions handled by GlobalExceptionHandler
• Data flows back via DTO mappers into JSON responses
Architectural patterns & principles
• Layered (Controller → Service → Repository)
• Dependency Injection via Spring
• Factory pattern for follower/profile services
• JWT stateless authentication + OAuth2 social login
• Use of DTOs & mappers to decouple domain from API
• Externalized configuration (application.properties, CloudinaryConfig)
Technologies & frameworks to annotate
• Java 17 (or configured JDK) + Spring Boot
• Spring MVC, Spring Security, Spring Data JPA
• Maven build
• Docker & Docker Compose
• Cloudinary SDK, JavaMailSender, OAuth2Client, JWT library
• H2/MySQL/PostgreSQL (depending on compose file)
• (Optional) Gemini AI HTTP client