Blogs-Analyzer Backend is a Spring Boot application designed to search blogs from WordPress APIs based on username, blog ID, or text. Additionally, it integrates with Gemini to analyze the quality of blog posts using machine learning. Blogs-Analyzer-UI is an Angular application used to display the results on a user interface or dashboard.
Before starting, ensure you have the following installed and configured:
- Java: Ensure Java 21 (or compatible version) is installed.
- Angular CLI: Install Angular CLI globally via npm. Ensure Angular 16 is installed. You can check your Angular
version by running
ng --version
. - Node.js: Install Node.js version 18 or higher. You can download it from here.
- Maven: Install Maven from here. Maven 3.9+ is recommended.
- Google Cloud SDK: Install the Google Cloud SDK and authenticate with your Google Cloud account. Follow the
instructions here. Then, log in to Google Cloud locally using the
command:
gcloud auth application-default login
Technology | Version |
---|---|
Java | 21 |
Spring Boot | 3.3.x |
Angular | 16 |
Node.js | 18.x |
Maven | 3.9+ |
Google Cloud SDK | Latest |
Gemini | Latest |
WordPress API | Latest |
-
Clone the repository:
git clone https://github.com/NashTech-Labs/Blogs-Analyzer.git cd blogs-analyzer
- Spring Boot: The core framework for building the backend application.
- Gemini Client: Used for integrating with Gemini for blog quality analysis. Ensure the necessary configurations and credentials are set up to communicate with Gemini APIs.
- WordPress API Client: Allows communication with WordPress APIs to fetch blog data based on username, blog ID, or text.
-
GET /api/wordpress/posts/{id}
Retrieve a single blog post by its unique identifier (ID).
-
GET /api/wordpress/posts
Fetch a list of all available blog posts.
-
GET /api/wordpress/posts-by-title
Search for blog posts matching a given title.
-
GET /api/wordpress/posts-by-author
Retrieve blog posts authored by a specific user, identified by their author-id.
-
GET /api/wordpress
Fetch a list of all available blog posts and return the blog Id, title, status, url, author name, and author id.
-
POST /api/gemini/v1/review
This endpoint analyzes the quality of a blog post using Gemini. It requires a JSON payload with blog content.
- Starting spring-boot application (For Backend API)
-
Build the project:
mvn clean install
-
Running Application:
Run the main class from Intellij
or
mvn spring-boot:run
-
- Starting Angular Application (For Dashboard)
-
Build the project:
mvn clean install
-
Running Application:
ng serve
-
Now, Application is running at the default port 4200. Dashboard URL: localhost:4200
Once the application is running locally, you can access the API endpoints using tools like Postman or curl. Verify API functionality:
Use the endpoints mentioned in the Endpoints section to verify functionality and interaction with WordPress APIs and Gemini.