Tracker is an API to track the amount of time a user is spending on common daily tasks. It exposes the api to create, delete, get and update Tasks. The Tasks are organized into three major categories and a user can make CRUD calls to add or remove tasks from them.
-
get /groups
- retrieve a list of all groups. -
get /tasks
- retrieve a list of user tasks. This accepts 3 query params as followsdate
- when provided, only the entry for this date will be included in the response.start
- when provided, entries earlier than this date will not be included in the responseend
- when provided, entries later than this date will not be included in the response.
Example response
[ { "id": 1, "title": "A Task", "group_id": 2, "user_id": 3, "entries": [ { "id": 1, "entry_date": "2021-09-22", "task_id": 1, "duration": 500 }, { "id": 2, "entry_date": "2021-09-21", "task_id": 1, "duration": 200 } ] } ]
-
get /tasks/:id
- retrieve the task with given id. It also accepts the query params as above. -
post /groups/:id/tasks/
- create a task with title provided in the body. The only accepted parameter is title.Example accepted parameters
{ "title": "A Task" }
-
put /tasks/
- update a task with title provided in the body. Accepts the same parameters aspost
. -
delete /tasks/:id
- remove task given by id from the database. -
put /entries/:id
- update given entry duration.
- Ruby On Rails
- Postgresql
- ruby '2.7.2'
- Rails >= 6.1.3
To get a local copy of the project up and running, follow these steps.
# clone repository and cd into its directory
$ git clone https://github.com/chasscepts/tracker-api.git
$ cd tracker-api
# install gems
$ bundle install
# install npm dependencies
$ yarn install
# create database, run migration and seed the category table
$ rails db:create
$ rails db:migrate
$ rails db:seed
# Run Tests (RSpec is used for testing)
$ bundle exec rspec
# Run Ruby Linter
$ rubocop .
👤 Obetta Francis
Contributions, issues, and feature requests are welcome!
Feel free to check the issues page.
Give a ⭐️ if you like this project!
- Huge Thanks to Microverse community for all their supports.
- I appreciate everyone whose work was used in this project.
This project is MIT