/twitterapi

Clever API for Twitter Service (CATS)

Primary LanguageGroovy

Clever API for Twitter Service (CATS)

Description

Build a simple social networking application, similar to Twitter, and expose it through a web API. The application should support the scenarios below.

Scenarios

Posting

A user should be able to post a 140 character message.

Wall

A user should be able to see a list of the messages they've posted, in reverse chronological order.

Following

A user should be able to follow another user. Following doesn't have to be reciprocal: Alice can follow Bob without Bob having to follow Alice.

Timeline

A user should be able to see a list of the messages posted by all the people they follow, in reverse chronological order.

Prerequisites and Solution

  • Code: Java 8, Spring Boot, Spring Web Framework, Gradle
  • In memory storage
  • Application splitted into 3 sub apps
  • Functional tests: Spock, Groovy, Spring Mock MVC
  • Application architecture - MVC & Ports-And-Adapters
  • Solution time: 2 days - most of the time I spent on writing tests
  • Added Actuator - just for fun
  • Deploy application on AWS - use this address in POSTMAN for proper POST request handling

Running application locally

  • use gradle: ./gradlew bootJar
  • java -jar twitter-rest-api/build/libs/cats-0.1.2.jar

Load postman collection from postman_collection folder

Post man view

Requests examples ready to play with on localhost, port 8080

Actuator - mappings:

Test coverage report

Post man view