-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
8 changed files
with
155 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,71 +1,103 @@ | ||
# blogs-analyzer | ||
# Blogs Analyzer | ||
|
||
## Description | ||
[](https://github.com/NashTech-Labs/Blogs-Analyzer/actions/workflows/maven.yml) | ||
|
||
Blogs-Analyzer Backend is a Spring Boot application built to search blogs from WordPress APIs based on username, blog ID, or text. Additionally, it integrates with Vertex AI for analyzing the quality of a particular blog post using machine learning capabilities. | ||
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 Vertex AI 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. | ||
|
||
## Table of Contents | ||
|
||
- [Description](#description) | ||
- [Prerequisites](#prerequisites) | ||
- [Setup Instructions](#setup-instructions) | ||
- [Dependencies](#dependencies) | ||
- [Endpoints](#endpoints) | ||
- [Running the Application](#running-the-application) | ||
|
||
## Setup Instructions | ||
## Prerequisites | ||
|
||
Before starting, ensure you have the following installed and configured: | ||
|
||
To set up and run the Blogs-Analyzer Backend locally, follow these steps: | ||
- **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](https://nodejs.org/en/download/). | ||
- **Maven**: Install Maven from [here](https://maven.apache.org/download.cgi). Maven 3.9+ is recommended. | ||
- **Google Cloud SDK**: Install the Google Cloud SDK and authenticate with your Google Cloud account. Follow the | ||
instructions [here](https://cloud.google.com/sdk/docs/install). Then, log in to Google Cloud locally using the | ||
command: ```gcloud auth application-default login``` | ||
|
||
## Setup Instructions | ||
|
||
1. **Clone the repository:** | ||
|
||
```bash | ||
git clone https://github.com/NashTech-Labs/Blogs-Analyzer.git | ||
cd blogs-analyzer | ||
|
||
## Ensure Java 21 (or compatible version) is installed. | ||
|
||
## Install Maven (if not already installed): | ||
## Dependencies | ||
|
||
Download and install Maven from https://maven.apache.org/download.cgi | ||
- **Spring Boot**: The core framework for building the backend application. | ||
- **Vertex AI Client**: Used for integrating with Vertex AI for blog quality analysis. Ensure the necessary | ||
configurations and credentials are set up to communicate with Vertex AI APIs. | ||
- **WordPress API Client**: Allows communication with WordPress APIs to fetch blog data based on username, blog ID, or | ||
text. | ||
|
||
## Build the project: | ||
## Endpoints | ||
|
||
mvn clean install | ||
1. #### Get a Specific Blog Post by ID | ||
|
||
## Dependencies | ||
- `GET /api/wordpress/posts/{id}` Retrieve a single blog post by its unique identifier (ID). | ||
|
||
1) Spring Boot: Backend framework for building Java-based applications. | ||
2) Vertex AI Client: Dependency for integrating with Vertex AI for blog quality analysis. Ensure the necessary configurations and credentials are set up to communicate with Vertex AI APIs. | ||
3) WordPress API Client: Dependency for communicating with WordPress APIs to fetch blog data based on username, blog ID, or text. | ||
2. #### Get All Blog Posts | ||
|
||
## Endpoints | ||
- `GET /api/wordpress/posts` Fetch a list of all available blog posts. | ||
|
||
The backend exposes the following endpoints: | ||
3. #### Get Blog Posts by Title | ||
|
||
Search Blogs: | ||
- `GET /api/wordpress/posts-by-title` Search for blog posts matching a given title. | ||
|
||
GET /api/wordpress/posts/{id} | ||
GET /api/wordpress/posts | ||
GET /api/wordpress/posts-by-title | ||
GET /api/wordpress/posts-by-author | ||
4. #### Get Blog Posts by Author | ||
|
||
Search blogs from WordPress APIs based on username, blog ID, or text. | ||
- `GET /api/wordpress/posts-by-author` Retrieve blog posts authored by a specific user, identified by their | ||
author-id. | ||
|
||
## Analyze Blog Quality: | ||
5. #### Get List of All Available Blog Posts | ||
|
||
POST /api/gemini/v1/review | ||
- `GET /api/wordpress` Fetch a list of all available blog posts and return the blog Id, title, status, url, author | ||
name, and author id. | ||
|
||
Endpoint to analyze the quality of a blog post using Vertex AI. Requires a JSON payload with blog content. | ||
6. #### Analyze Blog Quality | ||
- `POST /api/gemini/v1/review` This endpoint analyzes the quality of a blog post using Vertex AI. It requires a JSON | ||
payload with blog content. | ||
|
||
## Running the application: | ||
|
||
bash | ||
Copy code | ||
java -jar target/blogs-analyzer.jar | ||
1. Starting spring-boot application (For Backend API) | ||
- Build the project: | ||
```bash | ||
mvn clean install | ||
``` | ||
- Running Application: | ||
|
||
Run the main class from Intellij | ||
|
||
or | ||
```bash | ||
mvn spring-boot:run | ||
``` | ||
2. Starting Angular Application (For Dashboard) | ||
```bash | ||
ng serve | ||
``` | ||
|
||
Now, Application is running at the default port 4200. Dashboard URL: ```localhost:4200``` | ||
|
||
## Access the API endpoints: | ||
|
||
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 Vertex AI. | ||
Use the endpoints mentioned in the Endpoints section to verify functionality and interaction with WordPress APIs and | ||
Vertex AI. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 7 additions & 1 deletion
8
blogs-analyzer-ui/src/app/dashboard/components/home/home.component.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 7 additions & 1 deletion
8
blogs-analyzer-ui/src/app/dashboard/components/tabular-view/tabular-view.component.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 8 additions & 4 deletions
12
blogs-analyzer-ui/src/app/dashboard/dashboard.component.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 8 additions & 1 deletion
9
blogs-analyzer-ui/src/app/quality-check/quality-check.component.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters