Skip to content

Latest commit

 

History

History
184 lines (148 loc) · 6.82 KB

README.md

File metadata and controls

184 lines (148 loc) · 6.82 KB

tweet-streamer

Build Status codecov

A spring boot application to stream live tweets from Twitter Stream APIs. User interface allows user to Add rules based on Follower/Track and Reset the App without restart.

  • User can view live feeds in - Live Tab
  • User can view historical tweets in - History Tab

Application screenshots

The tech stack & Open-source libraries

Data

  • H2 - Open-Source Embedded Relational Database Engine

Client - Frontend/UI

  • Angular - Angular is a platform for building mobile and desktop web applications.
  • Angular Material - UI component infrastructure and Material Design components for mobile and desktop Angular web applications.

Server - Backend

  • JDK - Java™ Platform, Standard Edition Development Kit
  • Spring Boot - Framework to ease the bootstrapping and development of new Spring Applications
  • Maven - Dependency Management

Libraries and Plugins

  • Lombok - Lombok is used to reduce boilerplate code for model/data objects.

Others

  • git - Free and Open-Source distributed version control system
  • Postman - API Development Environment (Testing Documentation)
  • Travis CI - A hosted continuous integration service used to build and test software projects hosted at GitHub.
  • Codecov - A hosted tool that is used to measure the test coverage of your codebase.

Testing

  • Download the zip or clone the Git repository.
  • Unzip the zip file (if you downloaded one)
  • Move the root directory and run below command to run tests.
mvn test

Running the application locally / Deploying

  • Download the zip or clone the Git repository.
  • Unzip the zip file (if you downloaded one)
  • Replace the Twitter API Key in application.properties file twitter.config.token=<your API key>
  • Build the project using below command
mvn clean install
mvn spring-boot:run

Fornt End Angular Project Repository

Sample Valid JSON Response

{
	"id": 42,
	"data": "{\"data\":{\"created_at\":\"2020-10-01T06:07:43.000Z\",\"author_id\":\"806204521919762432\",\"id\":\"1311548328186834945\",\"text\":\"RT @ashoswai: No end to Upper caste terror! Another Dalit woman has been gang-raped and killed in UP under Modi-Yogi's Raj! https://t.co/6a…\"},\"includes\":{\"users\":[{\"id\":\"806204521919762432\",\"name\":\"rabia\",\"username\":\"rabiiik527\"}]},\"matching_rules\":[{\"id\":1311547334208053248,\"tag\":\"\"}]}"
}

Documentation

  • Generate Java Documentation in tweet-streamer\target\site\apidocs using the Maven command
mvn javadoc:javadoc

Files and Directories Structure

│   .gitignore
│   .travis.yml
│   mvnw
│   mvnw.cmd
│   pom.xml
│   README.md
│   tweet-streamer.iml
│
├───.mvn
│   └───wrapper
│           maven-wrapper.jar
│           maven-wrapper.properties
│           MavenWrapperDownloader.java
│
├───src
│   ├───main
│   │   ├───java
│   │   │   └───com
│   │   │       └───demo
│   │   │           │   TweetStreamer.java
│   │   │           │
│   │   │           ├───config
│   │   │           │       AsyncConfiguration.java
│   │   │           │       Config.java
│   │   │           │
│   │   │           ├───controller
│   │   │           │       TweetController.java
│   │   │           │
│   │   │           ├───dto
│   │   │           │       Datum.java
│   │   │           │       RuleAddRequest.java
│   │   │           │       RuleDeleteRequest.java
│   │   │           │       RuleObject.java
│   │   │           │
│   │   │           ├───entity
│   │   │           │   │   TweetEntity.java
│   │   │           │   │   TweetView.java
│   │   │           │   │
│   │   │           │   └───repo
│   │   │           │           TweetRepo.java
│   │   │           │
│   │   │           └───service
│   │   │                   ITweetService.java
│   │   │                   TweetService.java
│   │   │
│   │   └───resources
│   │       │   application.properties
│   │       │
│   │       └───static
│   │               3rdpartylicenses.txt
│   │               favicon.ico
│   │               index.html
│   │               main.99369130811ab3e1a6fa.js
│   │               polyfills.35a5ca1855eb057f016a.js
│   │               runtime.acf0dec4155e77772545.js
│   │               styles.7a56496004aef477cd49.css
│   │
│   └───test
│       └───java
│           └───com
│               └───demo
│                   │   TweetStreamerTest.java
│                   │
│                   ├───controller
│                   │       TweetControllerTest.java
│                   │
│                   ├───dto
│                   │       DatumTest.java
│                   │       RuleDeleteRequestTest.java
│                   │
│                   ├───entity
│                   │       TweetEntityTest.java
│                   │
│                   └───service
│                           TweetServiceTest.java

Reference

Twitter Stream API - Twitter Documentation