Skip to content

Latest commit

 

History

History
49 lines (36 loc) · 2.63 KB

File metadata and controls

49 lines (36 loc) · 2.63 KB

Project Architecture 🏗️

The KrishiSheba technical ecosystem is built upon an N-Tier monolithic Spring Boot layout, optimizing rapid deployment speeds alongside standard Object-Oriented best practices.

System Layers

A typical request navigates the following stack vertically:

  1. Frontend Interface (Thymeleaf/JS/CSS)

    • Views injected with Dynamic model data.
    • Decoupled API requests fetched by vanilla JavaScript clients (e.g. homepage-api.js).
  2. Security Chain (Spring Security Filter Chain)

    • Authenticated users matched rapidly against stateless JwtAuthenticationFilter.
    • Incoming requests bounded by IP mapping using RateLimitFilter (Bucket4j) shielding exhaustive DDOS vectors on public APIs.
  3. Controller Layer (REST + MVC)

    • Distributes workloads mapping explicitly to standard JSON schemas protected natively by ApiResponse<T>.
  4. Service Layer (Core Business Logic)

    • The heart of KrishiSheba isolating computations encapsulating complex search queries, rental state machines, and statistic projections.
    • Annotations like @Transactional gracefully handle nested database modifications rolling back explicitly when required to avoid data corruption.
  5. Repository Layer (Spring Data JPA)

    • Resolves abstraction bindings allowing SQL injection-free code.
  6. Database (PostgreSQL / H2)

    • Fully relational modeling binding Rentals -> Equipment -> Users.

Tech Stack Overview

  • SDK: OpenJDK 17
  • Core Framework: Spring Boot 3.2.5
  • ORM: Hibernate (via Spring Data JPA)
  • Security: Spring Security + JSON Web Tokens (JWT)
  • Rate Limiting: Bucket4j
  • API Documentation: SpringDoc OpenAPI + Swagger
  • View Engine: Thymeleaf
  • Build Tool: Apache Maven
  • Environment Targeting: Application configurations divided gracefully (application-dev.yml vs application-prod.yml)

Codebase Map 🗺️

  • /com/krishisheba/controller: Contains all @RestController and @Controller entry points separating Views from APIs.
  • /com/krishisheba/dto: Defines unified data-transfer objects isolating the internal Hibernate model graphs from front-facing clients eliminating cyclic errors.
  • /com/krishisheba/model: Native @Entity records managed exclusively by JPA annotations mapping table schemas accurately.
  • /com/krishisheba/security: Configuration files routing WebSecurity, Auth Filter sequences, CORS policies, and Bucket4j ratelimits.
  • /com/krishisheba/service: Specialized classes parsing exact domain tasks ensuring thin controllers.
  • /com/krishisheba/repository: Extending JpaRepository interfacing dynamically with the database engine.