Skip to content
This repository has been archived by the owner on Aug 22, 2020. It is now read-only.

ayltai/hknews-backend

Repository files navigation

Warning

This repository is deprecated. Please check out hknews.

HK News Backend

Category Measurement
Pipeline CircleCI
Quality Code Quality LGTM Grade Sonar Quality Gate Sonar Violations (short format)
Coverage Sonar Test Success Rate Code Coverage Code Coverage Sonar Coverage
Ratings Maintainability Rating Reliability Rating Sonar Tech Debt
Security Security Rating CII Best Practices Tiered Percentage Vulnerabilities
Miscellaneous Uptime Robot status Swagger Validator Maintenance Release License

Serves aggregated news from 10+ local news publishers in Hong Kong. Made with ❤

Buy me a coffee

Features

  • Support text, image and video news
  • Read news from 10+ local news publishers
  • No ads. We hate ads as much as you do

News Publishers

API Documentation

View interactive API documentation

HK News Frontend

HK News Infrastructure

hknews-infrastructure

Installation

  1. Install JDK 11*
  2. Install MongoDB 4.x
  3. Start MongoDB daemon
    mongod
  4. Build the project
    ./build.sh

* JDK 8, 9 and 10 also work. JDK 11 is used here for better runtime performance.

How to run for development environment

  1. Start the server
    export SPRING_PROFILES_ACTIVE=development
    ./gradlew bootRun
  2. Test specific API
    curl http://localhost:8080/sources

How to run for production environment

  1. Export SSL certificate key for using HTTPS
    export SSL_KEY=x123y456
  2. Export Instrumental API key for using sending system metrics to cloud service
    export INSTRUMENTAL_API_KEY=a111b222
  3. Export Logz.io token for using sending application logs to cloud service
    export LOGZIO_TOKEN=abcdef
  4. Start the server
    java -server -Xverify:none -Xms256m -Xmx512m -Xss512k -XX:+ScavengeBeforeFullGC -XX:+CMSScavengeBeforeRemark -Dfile.encoding=UTF-8 -Dserver.ssl.key-store-password=${SSL_KEY} -Dserver.ssl.trust-store-password=${SSL_KEY} -Dspring.profiles.active=production -jar ./build/libs/hknews-backend-1.2.3.jar
  5. Test specific API
    curl https://hknews.dev/sources

Acknowledgements

This software is made with the support of open source projects:

... and closed source services: