Skip to content

ituhin/time-tracker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Nest Logo

A progressive Node.js framework for building efficient and scalable server-side applications, heavily inspired by Angular.

NPM Version Package License NPM Downloads Travis Linux Coverage Gitter Backers on Open Collective Sponsors on Open Collective

Description

Nest framework TypeScript starter repository.

Installation

$ npm install

Running the app

# development
$ npm run start

# watch mode
$ npm run start:dev

# production mode
$ npm run start:prod

Test

# unit tests
$ npm run test

# e2e tests
$ npm run test:e2e

# test coverage
$ npm run test:cov

Note

did not used any db and data is stored in memory, its just a test project, so restart will wipe out the data.

these endpoints are available

  1. POST /users/login params - { "user_name": "somename", "password": "pass" } returns jwt-token which should be sent as "jwt" header in other api calls any user_name with a dummy password will give you a token, there is no seeded user data inside. added sample auth-middleware to parse the jwt-token header to user-name

note, as there is no user db user-name is used instead of standard uid

below these endpoints expects jwt header to get the user 2. POST /user-timer/start params - { "title": "hello world" } the title field i kept required here, lately had a thought about moving it to /stop instead of /start returns timer object with an id

  1. POST /user-timer/stop no params required, it stops the running timer, and returns a the timer object

  2. POST /user-timer/edit/{timer-id} sample param - { "title": "some new title", "start_time": 1601401038, "end_time": 1601401039 } all the fields are optional here time fields are unix timestamp, can be displayed in any format as well returns updated object

  3. GET /user-timer/getAll

returns timer records sorted by start_time in descending order or recent first, also returns total-duration (running timer duration excluded, but can be included as well)

  1. GET /user-timer/search?title={keyword} returns those records where title is having the keyword, again sorted by start_time recent first

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published