Note: This documentation is still in-progress
We would like you to implement a "good night" application to let users track when they go to bed and when they wake up. We require some restful APIs to achieve the following:
- Clock In operation, and return all clocked-in times, ordered by created time.
- Users can follow and unfollow other users.
- See the sleep records over the past week for their friends, ordered by the length of their sleep.
Please implement the model, DB migrations, and JSON API. You can assume that there are only two fields on the users: "id" and "name”. You do not need to implement any user registration API. You can use any gems you like.
- Due to not having to implement any user registration API, let's assume that we have all the users that we need in the database. I'm using seed data to illustrate this assumption about user records. Each user must have an id and a name.
- API consumer is assumed to be trusty. Because of not having authentication and authorization, any user can interact with any other user's data.
- There's no API standard is specified, let's assume that our API consumer need a compact API that returns enough information to understand what's going on
To be continued...
-
Create your own database config file
cp config/database.yml.example config/database.yml
-
Install redis
brew install redis
-
Install gems
bundle install
-
Seed data
rails db:drop db:create db:migrate db:seed
-
Start Rails server on localhost:3000
rails s
-
Start sidekiq
bundle exec sidekiq
-
(Optional) If you want to read the explainations and documentations
Install javascript dependencies
brew install node brew install yarn yarn install
Start docs server on localhost:8080
yarn docs:dev
To be continued...