Skip to content

A small Django web application to track time via simple REST API.

License

Notifications You must be signed in to change notification settings

woernsn/punch-the-clock

Repository files navigation

Python Django Docker Postgres Nginx Gunicorn

Table of Content

Show

About

Features

  • WebUI
    • See logged hours in list view or calendar view.
    • Edit or remove existing entries.
    • Generate an API token to use the REST API.
    • Punch in or out directly from the WebUI.
    • Export monthly CSV files.
  • REST API
    • One simple endpoint to punch in or out if already punched in (toggle): /api/punch.
    • BEARER authentication.

Screenshots

Show
  • List View List View

  • Calendar View Calendar View

  • Edit an entry Edit entry

  • Generate API Token Generate API Token

Configuration

Application

See the development env file or the production env file for available configurations.

NGINX

If you want to use the productive Docker image, don't forget to check the nginx.conf file and adapt it accordingly.

Building

Development

  1. Build the image
$ docker compose -f docker-compose.dev.yml up --build
  1. Add the initial admin user
$ docker compose -f docker-compose.dev.yml exec web python manage.py createsuperuser --username=admin --email=admin@example.com

Testing

Run the available tests with

$ docker compose exec web python manage.py test

Production

  1. Build the image
$ docker compose -f docker-compose.prod.yml up --build
  1. Create the database layout
$ docker compose -f docker-compose.prod.yml exec web python manage.py migrate --no-input
  1. Collect the static files for nginx
$ docker compose -f docker-compose.prod.yml exec web python manage.py collectstatic --no-input --clear
  1. Add the initial admin user
$ docker compose -f docker-compose.prod.yml exec web python manage.py createsuperuser --username=admin --email=admin@example.com

Usage

Development

Visit the website under http://127.0.0.1:8000.

Production

Visit the website under http://127.0.0.1.

About

A small Django web application to track time via simple REST API.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published