How pranjal-yadav05/smartblogbackend works
SmartBlog Backend is a Spring Boot API for blog publishing, user accounts, and newsletter operations. The main workflow runs from frontend API requests through controllers into services, which manage posts, drafts, comments, users, and subscriptions; persistence is backed by MySQL. Authentication combines JWT and OAuth, while post workflows also expose image and AI integrations. Contact submissions and scheduled newsletters are additional product branches. Several service and controller implementations were not sampled, so their links are included only where the source index or README supports them.
Main entry points: controller REST controllers · BlogPostService.java Blog service · SubscriberService.java Subscription service · CloudinaryService.java Image storage
Components 21
API and security
- REST controllers
src/main/java/com/smartblogbackend/controller - Security configuration
src/main/java/com/smartblogbackend/config/SecurityConfig.java - JWT filter
src/main/java/com/smartblogbackend/config/JwtAuthenticationFilter.java
Publishing
- Blog service
src/main/java/com/smartblogbackend/service/BlogPostService.java - Domain entities
src/main/java/com/smartblogbackend/model - Post repositories
src/main/java/com/smartblogbackend/repository - Image storage
src/main/java/com/smartblogbackend/service/CloudinaryService.java - AI content service
src/main/java/com/smartblogbackend/service/OpenRouterAIService.java
Accounts
- JWT utility
src/main/java/com/smartblogbackend/util/JwtUtil.java - OAuth user service
src/main/java/com/smartblogbackend/service/OAuth2UserService.java - User service
src/main/java/com/smartblogbackend/service/UserService.java - User repository
src/main/java/com/smartblogbackend/repository/UserRepository.java
Audience and messaging
- Contact handling
src/main/java/com/smartblogbackend/service/ContactFormService.java - Subscription service
src/main/java/com/smartblogbackend/service/SubscriberService.java - Newsletter scheduler
src/main/java/com/smartblogbackend/service/NewsletterScheduler.java - Email delivery
src/main/java/com/smartblogbackend/service/EmailService.java
Other components
- Frontend client
- MySQL database
- Cloudinary
- AI provider
- Mail service
Connections 23
- Frontend client → REST controllers: sends requests
README.md - REST controllers → Blog service: delegates posts
src/main/java/com/smartblogbackend/controller/BlogPostController.java - REST controllers → User service: delegates accounts
src/main/java/com/smartblogbackend/controller/UserController.java - REST controllers → Contact handling: delegates contact
src/main/java/com/smartblogbackend/controller/ContactController.java - REST controllers → Subscription service: delegates subscriptions
src/main/java/com/smartblogbackend/controller/SubscriberController.java - REST controllers → AI content service: requests suggestions
src/main/java/com/smartblogbackend/controller/BlogPostController.java - REST controllers → Image storage: uploads images
src/main/java/com/smartblogbackend/controller/BlogPostController.java - Security configuration → JWT filter: registers filter
src/main/java/com/smartblogbackend/config/SecurityConfig.java - Security configuration → OAuth user service: configures OAuth
src/main/java/com/smartblogbackend/config/SecurityConfig.java - JWT filter → JWT utility: validates tokens
src/main/java/com/smartblogbackend/config/JwtAuthenticationFilter.java - OAuth user service → User service: loads user
src/main/java/com/smartblogbackend/service/OAuth2UserService.java - User service → User repository: queries users
src/main/java/com/smartblogbackend/service/UserService.java - Blog service → Post repositories: manages posts
src/main/java/com/smartblogbackend/service/BlogPostService.java - Blog service → Image storage: deletes images
src/main/java/com/smartblogbackend/service/BlogPostService.java - Subscription service → Email delivery: sends newsletters
src/main/java/com/smartblogbackend/service/SubscriberService.java - Subscription service → Blog service: gets recent posts
src/main/java/com/smartblogbackend/service/SubscriberService.java - Newsletter scheduler → Subscription service: triggers sending
src/main/java/com/smartblogbackend/service/NewsletterScheduler.java - Contact handling → MySQL database: persists submissions
README.md - Post repositories → MySQL database: persists content
README.md - User repository → MySQL database: persists accounts
README.md - Image storage → Cloudinary: stores images
src/main/java/com/smartblogbackend/service/CloudinaryService.java - AI content service → AI provider: requests generation
- Email delivery → Mail service: sends messages
src/main/java/com/smartblogbackend/service/EmailService.java