Sign inSign up

kauanmocelin/smartnewstracker

By kauanmocelin

•Updated 4 months ago

SmartNews Tracker is an API that allows users to monitor news based on specific keywords.

Image
0

94

kauanmocelin/smartnewstracker repository overview

⁠SmartNews Tracker Docker Image

This Docker image encapsulates a Spring Boot-based microservice application known as SmartNews Tracker. The API periodically queries a news source based on keywords registered by users and sends email alerts whenever new matching articles are found. It connects to a PostgreSQL database for persistence and uses Flyway for schema migrations. Endpoints and data schemas are documented via SpringDoc / OpenAPI 3.0.

Github repository: https://github.com/kauanmocelin/smart-news-tracker⁠

⁠Quick Reference

⁠How to Use This Image

⁠Starting a SmartNews Tracker Instance

Before starting the container, make sure you have:

Starting a SmartNews Tracker instance is as simple as running the following command. Be sure to replace tag with the desired image tag and provide the required environment variables:

docker run --name smart-news-tracker -d \
  -e DB_URL=jdbc:postgresql://localhost:5432/smartnewstracker \
  -e DB_USERNAME=postgres \
  -e DB_PASSWORD=postgres \
  -e JWT_SECRET_KEY=your_jwt_secret \
  -e NEWS_API_KEY=your_news_api_key \
  -p 8080:8080 \
  kauanmocelin/smartnewstracker:latest
⁠Configuration

You can customize this Docker image using the following environment variables:

VariableDescriptionExample
SERVER_BASE_URLBase URL the application is served fromhttp://localhost
SERVER_PORTPort the application listens on internally8080
DB_URLJDBC URL for your PostgreSQL databasejdbc:postgresql://localhost:5432/smartnewstracker
DB_USERNAMEUsername for your PostgreSQL databasepostgres
DB_PASSWORDPassword for your PostgreSQL databasepostgres
MAIL_HOSTSMTP host used to send email alertslocalhost
MAIL_PORTSMTP port1025
MAIL_USERNAMESMTP username[email protected]
MAIL_PASSWORDSMTP password—
JWT_SECRET_KEY32-byte secret used to sign JWT tokens—
NEWS_API_KEYAPI key from newsapi.org⁠ used to fetch news articles—
LOG_DIRDirectory where application logs are written/tmp

You can set these variables using the -e flag in the docker run command, as shown in the example above.

⁠Ports

The application listens on port 8080 for HTTP traffic by default (configurable via SERVER_PORT). You can map this to any port on your host machine using the -p flag in the docker run command.

⁠Dependencies

This application requires:

  • A PostgreSQL server to function correctly. DB_URL should point to a running PostgreSQL instance.
  • A News API key from newsapi.org⁠ to fetch articles.
  • An SMTP server (e.g., Mailpit, Mailhog, or a real provider) to deliver email alerts and verification emails.

Tag summary

Content type

Image

Digest

sha256:4ec779b74…

Size

167.6 MB

Last updated

4 months ago

docker pull kauanmocelin/smartnewstracker