SivaLabs Blog is a blog application developed using Java and Spring Boot. It provides a platform for publishing blog posts, managing categories and tags, handling user comments, and engaging with subscribers through email notifications. The application includes both public-facing features for readers and an administrative interface for content management.
-
Backend:
- Java
- Spring Boot
- Spring Modulith
- Spring Data JPA, PostgreSQL, Flyway
- Spring Security
- Maven
- JUnit, Testcontainers
- Docker Compose
-
Frontend:
- Thymeleaf
- HTMX, Alpine.js, jQuery
- Tailwind CSS
- Font Awesome
- JDK 24
- Docker and Docker Compose
- Your favourite IDE (Recommended: IntelliJ IDEA)
Install JDK using SDKMAN
$ curl -s "https://get.sdkman.io" | bash
$ source "$HOME/.sdkman/bin/sdkman-init.sh"
$ sdk install java 24.0.1-tem
$ sdk install maven
$ git clone https://github.com/sivaprasadreddy/sivalabs-blog.git
$ cd sivalabs-blog
This project uses NPM to have live reloading.
Use the following steps to get it working:
- Run the Spring Boot application with the
local
profile - From a terminal:
- Run
npm install
- Run
npm run build && npm run watch
(You can also runnpm run --silent build && npm run --silent watch
if you want less output in the terminal)
- Run
- Your default browser will open at http://localhost:3000
NOTE: If the page doesn't load properly, stop and re-run the npm run build && npm run watch
command.
You should now be able to change any HTML or CSS and have the browser reload upon saving the file.
The application is designed as a Modular Monolith. While it's a single deployable unit, the codebase is organized into distinct, independent modules, each responsible for a specific business capability. This modular approach enhances maintainability, scalability, and allows for clear separation of concerns.
The key modules in the application are:
admin
: Handles administrative functionalities like content management, user administration, and system settings.analytics
: Manages tracking and reporting of application metrics, such as page views and events.auth
: Implements user authentication and authorization using Spring Security.blog
: Contains the core logic for blog posts, categories, tags, and comments.notification
: Responsible for sending email notifications to subscribers and users.shared
: Includes common components, utilities, and entities that are used across multiple modules.
This architecture provides the benefits of a microservices-style design—such as improved organization and scalability—while avoiding the complexities of a distributed system. It allows for independent development and testing of modules, making the application easier to manage and evolve over time.
Anyone (without logging in) can perform the following actions:
- View the list of posts by reverse chronological order with pagination
- View the list of posts by category with pagination
- View the list of posts by tag with pagination
- Search posts by keyword
- View post details
- Add comment to a post
- Subscribe to the newsletter
- View Contact details
- Sent a message to the Admin
Administrators and authors can log in and perform the following actions:
-
Posts:
- View the list of posts
- Create, update, delete
- Publish, unpublish, archive
-
Comments:
- View the list of comments
- Delete, approve, mark as span
-
Categories:
- View the list of categories
- Create a new category
-
Tags:
- View the list of tags
- Delete tags
-
Messages:
- View the list of messages
- Delete messages
-
Subscribers:
- View the list of subscribers
- Delete subscribers
-
Users:
- View the list of users(authors, administrators)
-
My Profile:
- Update the login user profile details
- Change Password
- Upload profile image
-
Settings:
- Configure application-level settings
NOTE: Some actions (delete posts, update settings, etc.) can only be performed by Administrators, but not authors.