The KrishiSheba technical ecosystem is built upon an N-Tier monolithic Spring Boot layout, optimizing rapid deployment speeds alongside standard Object-Oriented best practices.
A typical request navigates the following stack vertically:
-
Frontend Interface (Thymeleaf/JS/CSS)
- Views injected with Dynamic model data.
- Decoupled API requests fetched by vanilla JavaScript clients (e.g.
homepage-api.js).
-
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.
- Authenticated users matched rapidly against stateless
-
Controller Layer (REST + MVC)
- Distributes workloads mapping explicitly to standard JSON schemas protected natively by
ApiResponse<T>.
- Distributes workloads mapping explicitly to standard JSON schemas protected natively by
-
Service Layer (Core Business Logic)
- The heart of KrishiSheba isolating computations encapsulating complex search queries, rental state machines, and statistic projections.
- Annotations like
@Transactionalgracefully handle nested database modifications rolling back explicitly when required to avoid data corruption.
-
Repository Layer (Spring Data JPA)
- Resolves abstraction bindings allowing SQL injection-free code.
-
Database (PostgreSQL / H2)
- Fully relational modeling binding
Rentals->Equipment->Users.
- Fully relational modeling binding
- 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.ymlvsapplication-prod.yml)
/com/krishisheba/controller: Contains all@RestControllerand@Controllerentry 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@Entityrecords 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: ExtendingJpaRepositoryinterfacing dynamically with the database engine.