Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion BACKEND.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Backend api consists of following endpoints:
# Backend api consists of following endpoints

- `GET /<id>` - get the current timer value - returns json with `{ "start": <start timestamp relative to a reference timestamp (in seconds)>, "elapsed": <time elapsed since start (in seconds)> }`
- `POST /reset/<id>` - reset the timer, returns new timer value - returns json with `{ "start": <start timestamp relative to a reference timestamp (in seconds)>, "elapsed": <time elapsed since start (in seconds)> }`
Expand Down
25 changes: 23 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,26 @@ This is a boilerplate project for the timer test task. You can add any additiona

Project structure is up to you.

To run the backend, use `docker run -p 7654:7654 -d strander/timer-api`. The backend will be available at `http://localhost:7654`.
Refer to the [backend README](BACKEND.md) for more information.
## The task

Create an application to show timers - one local timer and some timers from the server.
There are "Timers" and "Settings" views.
Timers are shown as a table, values should change every second,
"Reset" button should drop value of its timer to zero.
Local timer is always shown, and it's value can be preserved between session,
if corresponding option is selected on "Settings" view.
As an extra option, implement showing the views as Tabs to switch between them.
Initial option to view as tabs or as all in one should be passed by page URL.

Use mockup.jpg as a reference, but it should not be precisely copied.

## Backend

To run the backend, use `docker run -p 7654:7654 -d strander/timer-api`.
The backend will be available at `http://localhost:7654`.

### Endpoints

- `GET /<id>` - get the current timer value - returns json with `{ "start": <start timestamp relative to a reference timestamp (in seconds)>, "elapsed": <time elapsed since start (in seconds)> }`
- `POST /reset/<id>` - reset the timer, returns new timer value - returns json with `{ "start": <start timestamp relative to a reference timestamp (in seconds)>, "elapsed": <time elapsed since start (in seconds)> }`
- `GET /list` - get the list of all timers - returns json list if ids of all timers
Binary file added mockup.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.