Create a new Events API hosted project with a backend(Ruby on Rails) and database(Postgres)
Needed Url: https://eventsapp101.herokuapp.com/
name and event_type are the required key/value pairs
Event type should be one of the following:
[submit refer click read login logout share signup subcribe]
One can include more key/value pairs and those will be considered "additional_data" and according to the requirments of this project, if no additional data exists, the object will be empty.
{"event" : {"name" : "subscribe_button", "event_type" : "subscribe", "button_type" : "primary", "button_color" : "blue" }
return a JSON Object that looks like this:
{
"id": 1,
"name": "subscribe_button",
"event_type": "subscribe",
"additional_data": {
"button_type" : "primary",
"button_color" : "blue"
}
}
That's all you need to know to start! 🎉
curl -X POST --header 'Content-Type: application/json' --data '{"event" : {"name" : "subscribe_button", "event_type" : "subscribe","button_color" : "blue" }}' 'https://eventsapp101.herokuapp.com/'
You can run this command:
rails test test/models/event_test.rb
This endpoint takes all the events received today, groups them by event_type and returns the count for each. The response are in JSON
for example
{"todays_stats" :
[
{"click" : 34},
{"view": 54}
]
}
This can be accessed here https://eventsapp101.herokuapp.com/todaystats