This project demonstrates a microservices architecture for a blogging platform using Spring Boot, MongoDB, and various Spring technologies.
The project consists of several microservices that collectively provide a blogging platform with functionalities such as post management, user authentication, and notifications.
- PostService: Manages posts, comments, likes, and search functionality.
- UserService: Manages user profiles, authentication, and user-related operations.
- NotificationService: Manages notifications and alerting users about activities.
To run the project locally, follow these steps:
-
Clone the repository:
git clone https://github.com/SayeedBlog.git cd /SayeedBlog
-
Build the project:
mvn clean install
-
Run each microservice:
-
PostService:
cd PostService mvn spring-boot:run
-
UserService:
cd UserService mvn spring-boot:run
-
NotificationService:
cd NotificationService mvn spring-boot:run
-
-
Access APIs:
- PostService APIs: http://localhost/api/posts
- UserService APIs: http://localhost/api/users
- NotificationService APIs: http://localhost/api/notifications
-
Documentation:
Swagger/OpenAPI documentation can be accessed at:
- PostService: http://localhost/swagger-ui.html
- UserService: http://localhost/swagger-ui.html
- NotificationService: http://localhost/swagger-ui.html
The project is organized into the following modules:
Structure:
PostService
├── src
│ ├── main
│ │ ├── java/com/strong/PostService
│ │ │ ├── controller // REST controllers
│ │ │ ├── model // Entity classes (Post, Comment, Like, Search)
│ │ │ ├── repository // Spring Data MongoDB repositories
│ │ │ ├── service // Service classes (PostService, CommentService, etc.)
│ │ │ └── PostServiceApplication.java // Spring Boot application main class
│ │ └── resources
│ │ ├── application.properties // Configuration properties
│ │ └── static
│ └── test
│ └── java/com/strong/PostService
│ └── (Unit and Integration Tests)
└── pom.xml
Structure:
UserService
├── src
│ ├── main
│ │ ├── java/com/strong/UserService
│ │ │ ├── controller // REST controllers
│ │ │ ├── model // Entity classes (User, Role, AuthRequest, AuthResponse)
│ │ │ ├── repository // Spring Data MongoDB repositories
│ │ │ ├── service // Service classes (UserService, AuthenticationService, etc.)
│ │ │ └── UserServiceApplication.java // Spring Boot application main class
│ │ └── resources
│ │ ├── application.properties // Configuration properties
│ │ └── static
│ └── test
│ └── java/com/strong/UserService
│ └── (Unit and Integration Tests)
└── pom.xml
Structure:
NotificationService
├── src
│ ├── main
│ │ ├── java/com/strong/NotificationService
│ │ │ ├── controller // REST controllers
│ │ │ ├── model // Entity classes (Notification, NotificationTemplate)
│ │ │ ├── repository // Spring Data MongoDB repositories
│ │ │ ├── service // Service classes (NotificationService, EmailService, etc.)
│ │ │ └── NotificationServiceApplication.java // Spring Boot application main class
│ │ └── resources
│ │ ├── application.properties // Configuration properties
│ │ └── static
│ └── test
│ └── java/com/strong/NotificationService
│ └── (Unit and Integration Tests)
└── pom.xml
- Spring Boot: Framework for creating microservices.
- Spring Data MongoDB: Integration with MongoDB for data storage.
- Spring Security: Authentication and authorization.
- Swagger/OpenAPI: API documentation and testing.
- Maven: Dependency management and build automation.
Feel free to contribute to this project by forking and creating pull requests. For major changes, please open an issue first to discuss what you would like to change.
This project is licensed under the MIT License - see the LICENSE file for details.