An open API service indexing awesome lists of open source software.

https://github.com/andprov/fix_time

Time tracker
https://github.com/andprov/fix_time

django docker gunicorn nginx postgresql python

Last synced: 4 months ago
JSON representation

Time tracker

Awesome Lists containing this project

README

          

# FixTime

[![License MIT](https://img.shields.io/badge/licence-MIT-green)](https://opensource.org/license/mit/)
[![Code style black](https://img.shields.io/badge/code%20style-black-black)](https://github.com/psf/black)
[![Python versions](https://img.shields.io/badge/python-3.9%20%7C%203.10%20%7C%203.11-blue)](#)
[![Django versions](https://img.shields.io/badge/Django-4.2-blue?logo=django)](#)
[![Nginx version](https://img.shields.io/badge/Nginx-1.22-blue?logo=nginx)](#)
[![Postgres version](https://img.shields.io/badge/PSQL-14-blue?logo=postgresql)](#)

"Fix time" - A time tracker that allows monitoring the time spent on tasks.

## Features

Time control
![dashboard](https://github.com/andprov/fix_time/blob/main/tracker/static_front/img/dashboard.png)

Project control
![project](https://github.com/andprov/fix_time/blob/main/tracker/static_front/img/project.png)

Report
![report](https://github.com/andprov/fix_time/blob/main/tracker/static_front/img/report.png)

## Installation

### Running the project locally

Clone a repository:
```shell
git clone git clone
```

Go to the project directory:
```shell
cd fix_time
```

Create `.env` file:
```shell
touch .env
```

Template for `.env` file:
```shell
# Django settings
DEBUG=True
SECRET_KEY=
ALLOWED_HOSTS=127.0.0.1;localhost;

# DB
POSTGRES_USER=postgres
POSTGRES_PASSWORD=postgres
POSTGRES_DB=fixtime
DB_HOST=db
DB_PORT=5432

# Superuser
ADMIN_USERNAME=admin
ADMIN_EMAIL=admin@admin.com
ADMIN_PASSWORD=admin
```

Deploy the application:
```shell
docker compose -f docker-compose.dev.yml up -d
```

### Running a project on a remote server
To deploy to a remote server, you need to clone the repository to a local machine.
Prepare and upload images to the Docker Pub.

Clone a repository:
```shell
git clone git clone
```

Go to the project directory:
```shell
cd fix_time
```

Create `.env` file:
```shell
touch .env
```

Template for `.env` file:
```shell
# Django settings
DEBUG=False
SECRET_KEY=
ALLOWED_HOSTS=127.0.0.1;localhost;

# SMTP
EMAIL_HOST=
EMAIL_PORT=
EMAIL_HOST_USER=
EMAIL_HOST_PASSWORD=

# DB
POSTGRES_USER=postgres
POSTGRES_PASSWORD=postgres
POSTGRES_DB=fixtime
DB_HOST=db
DB_PORT=5432

# Docker images
BACKEND_IMAGE=/tracker_back
GATEWAY_IMAGE=/tracker_gateway

# Superuser
ADMIN_USERNAME=admin
ADMIN_EMAIL=admin@admin.com
ADMIN_PASSWORD=admin
```

Create docker images images:
```shell
sudo docker build -t /tracker_back tracker/
sudo docker build -t /tracker_gateway gateway/
```

Upload images to Docker Hub:
```shell
sudo docker push /tracker_back
sudo docker push /tracker_gateway
```

Copy the `.env` and `docker-compose.prod.yml` files to a remote server:
```shell
scp .env docker-compose.prod.yml @:/home//
```

Deploy the application on the server:
```shell
sudo docker compose -f docker-compose.prod.yml up -d
```