Coder Social home page Coder Social logo

tracylu2015 / news-streams Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 1.01 MB

News-Stream Android Mobile App

Python 62.84% JavaScript 23.12% Ruby 0.33% Starlark 1.18% Java 12.53%
kafka elasticsearch python mongodb reactnative django-framework kubernetes docker jenkins

news-streams's Introduction

news-streams project

Build Status

news_stream_django

  1. Required environment variables
    • MONGODB_URI
      • A Mongodb Uri with username, password and mongodb dns
    • MEMCACHED_SERVICE
      • A Memcached service DNS name which include all Memcached IP addresses
      • Client can resolve this DNS name to get all IPs in this Memcached cluster
    • ELASTIC_HOST
      • An Elasticsearch local host to get search results in Elasticsearch database
  2. How to run after setting environment variables
    • direct to news_stream_django folder
      • run command ''' python manage.py '''
  3. Endpoints
    • /api
      • to get all twitters information according to SocialPost model including required hashtags
      • Return format: Json
    • /api/trending
      • to get all recently mentioned top counted hashtags aggregate from mongodb
      • Return format: Json
    • /api/tags/{tag}
      • to get tweets which text including specified tag
      • param need to pass: string of tag pass from frontend url
      • Return format: Json
    • /health
      • to check whether app is health
    • /metrics
      • to get kafka received tweets and processed tweets

news_stream_frontend

  • React command to run on Android ''' npm run android
'''

news_stream_streams

  1. Required environment variables
    • CONSUMER_KEY / CONSUMER_SECRET / ACCESS_TOKEN / ACCESS_TOKEN_SECRET /BEARER_TOKEN
      • twitterAPI credentials
    • KAFKA_BOOTSTRAP_SERVERS
      • a list of host/post pairs separated by "," to establish initial connection to the Kafka cluster
    • KAFKA_GROUP_CONSUMER
      • a Kafka consumer name which cooperate multiple consumers to consume data from same topics
    • MONGODB_URI
      • A Mongodb Uri with username, password and mongodb dns
    • ELASTIC_HOST
      • An Elasticsearch local host to get search results in Elasticsearch database
  2. How to run after setting environment variables
    • direct to news_stream_stream folder
      • run command to get Twitter stream and produce raw data to Kafka
        python twitter_stream.py
        
      • run command to start consume and process data and insert into database
        python kafka_main.py
        
  3. streams (from twitter and reddit)
    • filtered twitter posts according to twitterAPI rule
    • add kafka producer to the filtered tweets and prometheus metrics
    • add kafka consumer and prometheus metrics before insert data into mongodb database
  4. models
    • SocialPost model to parse required fields from twitter posts with related tags
  5. mongo_query
    • mongo aggregation to have top counted hashtags and converted to python based
    • merge same categories of hashtags into one list and sum counts
    • add to memcache to reduce database queries times

Dockerfiles

Dockerfile for both streams and django service which can be built in CI to docker image

Deploy

Contains Kubernetes configurations for all components which includes: - backend-api - memcached - news-streams

news-streams's People

Contributors

tracylu2015 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.