/time-tracker-api

Backend of a time tracker application for employees of a company.

Primary LanguageJavaScriptApache License 2.0Apache-2.0

Time Tracker API

Introduction

Backend of a time tracker application for employees of a company. In this MVP, you can input hours of work per day and see statistics of hours worked and overtime hours for each user.

Context

The first thing was to use as a scaffold my personal repository of scaffolding for Node.js, which contains the basic configuration to start working with Node.js and not lose time. It contains the following:

This backend is based on a hexagonal architecture applied to Node.js and using SOLID principles whenever possible.

Hexagonal architecture

Data model

Data model

Tech stack

Installation and configuration

Prerequisites

Container execution

The recommendation is to execute the containers with docker-compose to deploy both server and MongoDB instances:

$ docker-compose build
$ docker-compose up

Installation

$ npm i

Configuration

There is a configuration management by environment (based on the environment variable NODE_ENV). There are several environments:

  • default (for development)
  • production
  • docker (container deployment)

Execution

$ npm start

Tests

$ npm t