How techcamp-training/pictweet_java_back works
Main System Components
• Web Layer (Frontend/Presentation):
• Controllers (TweetController, UserController, CommentController)
• Templates (HTML templates under “src/main/resources/templates” for tweets and users)
• Static Resources (Static CSS and images under “src/main/resources/static”)
• Business Logic Layer:
• Services (UserService, UserAuthenticationService)
• Validation components (classes under “src/main/java/in/tech_camp/pictweet/validation”)
• Data Access Layer:
• Repositories (TweetRepository, UserRepository, CommentRepository)
• Entities (TweetEntity, UserEntity, CommentEntity)
• Persistence and Configuration:
• Database Migrations (SQL scripts under “src/main/resources/db/migration”)
• Application configuration properties (in “src/main/resources/application.properties”)
• Security:
• Security Configuration (SecurityConfig.java) that likely integrates with the authentication service.
• Testing:
• Integration tests and unit tests, shown under the “src/test” directories for various areas (factories, forms, system/integration).
• Build and Deployment:
• Gradle build scripts and properties (build.gradle, gradlew, settings.gradle) to manage dependencies, building, and packaging.
Relationships and Data Flow
• The Web Layer (Controllers) handles HTTP requests from users and forwards them to the Service Layer.
• The Service Layer applies business logic (e.g., user authentication, tweet posting) and coordinates with the Data Access Layer.
• The Data Access Layer (Repositories) interacts with the underlying database. The database schema is evolved through migration files.
• The Security configuration is a cross-cutting concern affecting how requests are processed and authenticated.
• Static Resources and Templates are used to render the front-end UI that users interact with.
Architectural Patterns and Technologies
• MVC Pattern: Clear separation among controllers (handling web requests), services (business logic), and repositories/entities (data access).
• Layered Architecture: Distinguish the presentation, business, and persistence layers.
• Database versioning and migration through SQL scripts – this shows a commitment to maintainable schema management.
• Integration and Unit Testing: Indicate that each layer is testable and separated, enhancing reliability.