Create an application/service that:
- Sync contacts between two services: MockAPI and Mailchimp
- Every contact contains the following information: first name, last name and email address.
- The contacts in MockAPI must be synchronized with contacts in Mailchimp
- The application must be deployed in Heroku or Netlify
- The application will synchronize contacts by triggering a GET request to /contacts/sync.
- This endpoint should return the information of contacts synchronized.
The project (code) has been uploaded to Github here.
The project has been deployed in Heroku in https://trio-take-home-gm.herokuapp.com.
The document that describes the technical design can be located in Google Docs here.
Video files:
- How does the software work
- How did I build the project and why did I build it that way
- Sync successfully
Scala, JDK and libraries used in this project:
- Scala 2.13.7
- sbt 1.5.5
- JDK 11
- Akka 2.6.17
- Akka Http 10.2.7
- Circe 0.14.1
- PureConfig 0.16.0
- Logback 1.2.7
- Scala Logging 3.9.4
Plugins:
- sbt-scalafmt 2.4.3
- sbt-native-packager 1.7.6
To run the service locally use sbt:
sbt run
If everything is fine you should see something similar to:
14:22:16.769 [main] INFO com.trio.api.MainApiApp$ - Starting MainApiApp ...
14:22:18.034 [main] DEBUG com.trio.common.config.ApiAppConfig$ - Successfully loaded configuration (ApiAppConfig), ApiAppConfig(ApiConfig(contacts,0.0.0.0,8080),MailChimpConfig(b6749f9334fb7684fd16c5818632d647-us20,us20,https://us20.api.mailchimp.com/3.0,9f2da7d6f2,1000),MockApiConfig(http://localhost:8081))
14:22:19.015 [MainApiApp-akka.actor.default-dispatcher-4] INFO com.trio.api.MainApiApp$ - Started at port 8080
To trigger the sync:
curl localhost:8080/contacts/sync
From the terminal run:
curl https://trio-take-home-gm.herokuapp.com/contacts/sync
To make changes on the configuration check the technical design in the section Configuration.
From the terminal just run:
sbt test