A reactive web application that lets you explore the latest news articles, view detailed article information with related reddit posts and save your favorite articles and sources.
- Features
- Technologies Used
- Application Architecture
- How to Run
- Endpoints
- Testing
- Folder Structure
- Future Enhancements
- Contributors
- View top headlines from your country.
- Search for articles using a custom query.
- Explore:
- Article information.
- Related Reddit Posts.
- Sentiment analysis visualized with pie charts.
- View your saved articles.
- View your favorite sources.
To take a look at the current state of the project, you can follow this link to a demo video. https://my.hidrive.com/share/u9t05xiqy2 Info: This project does not focus on the frontend and it is also still in progress.
- Spring Boot with Kotlin.
- Spring WebFlux for reactive, non-blocking programming.
- R2DBC for working with the database reactively.
- Flyway for database migrations.
- Docker for containerized database management.
- R2DBC database with
ReactiveCrudRepositoryfor seamless reactive interactions.
- News API: Fetch top headlines and search for articles.
- Reddit API: Retrieve Reddit posts and comments.
- Google Natural Language API: Perform sentiment analysis for articles and Reddit discussions.
- Thymeleaf templates for dynamic HTML rendering.
- CSS for styling.
This project is a reactive Spring Boot application that integrates multiple APIs and services to deliver a seamless user experience. The backend handles API calls, sentiment analysis, and database interactions, while the frontend renders the content dynamically.
- Controller Layer:
- Handles HTTP requests, routes, and prepares data for views by delegating logic to services.
- Service Layer:
- API Services: Manage interactions with external APIs like NewsAPI, RedditAPI, and Google Natural Language API.
- Database Services: Handle application logic for database entities and interact with repositories.
- Repository Layer:
- Communicates with the R2DBC database reactively.
The database consists of the following tables:
- ARTICLE: Stores articles with title, author, content, and sentiment attributes.
- REDDIT_POST: Contains Reddit posts with link, title, content, and sentiment attributes.
- REDDIT_COMMENT: Contains Reddit Comments with content and sentiment attributes.
- PROJECT_USER: Tracks users and their preferred sources.
- COUNTRY: Stores country information and associated sources.
- ARTICLE_REDDIT_POST: Links articles to Reddit posts.
- USER_SAVED_ARTICLE: Saves articles that are bookmarked by users.
- COUNTRY_ARTICLE: Links articles to countries.
- Java 17 or higher (tested with Java 21).
- Docker installed and running.
- Kotlin setup.
- Clone the repository:
git clone https://github.com/JuliaTrumpp/vipepress.git cd article.analysis - Start the database with Docker:
docker-compose up -d
- Build and run the application:
./gradlew bootRun
- Access the application in your browser:
http://localhost:8080
Public Endpoints
- Home Page: /
- Displays top headlines, option to search articles by query + menu bar options.
- Article Detail Page: /article/{article-id}
- Displays article details, Reddit posts, and sentiment pie charts.
- Account Account: /account/{name}
- Displays saved articles and favorite sources.
Service layer are covered with unit tests to ensure functionality.
```bash
src/
βββ main/
β βββ kotlin/
β β βββ com.stacs.article.analysis/
β β βββ backend/
β β β βββ apis/
β β β β βββ ArticleApiDataClasses.kt
β β β β βββ ...
β β β βββ Article/
β β β β βββ Article.kt
β β β β βββ ArticleRepository.kt
β β β β βββ ArticleService.kt
β β β βββ ...
β β β
β β βββ frontend_controller/
β β β βββ AccountPageController.kt
β β β βββ ...
β β βββ libarys/
β β β βββ UsefullFunctionsLibrary.kt
β β βββ Application.kt
β βββ resources/
β β βββ db.migration/
β β β βββ V1_initial_setup.sql
β β βββ static/
β β β βββ styles_account.css
β β β βββ ...
β β βββtemplates/
β β β βββ account.html
β β β βββ ...
β β βββ application.properties
βββ test/
βββ same structure as main for tests
- Sentiment analysis with Google Language Api
- Graphs
- to visualize articles (by category, length, source, number of quotes on reddit(?))
- the article's and post's sentiment
- Country detail page:
- information and filter articles by category, language, date or source + sort them
- average sentiment of articles + in country's subreddit
- Country comparison
- comparison of Reddit (country's subreddits) and article sentiments (also by category)
- number of articles (top headlines) + other statistics
- Save source on article page and account page
- Sources detail page:
- list of last articles, which language/ country
- Possibility to delete articles/ other data base entries
Julia Trumpp