Skip to content

Commit c43f6f3

Browse files
Initial commit: time tracker v0.1.0
0 parents  commit c43f6f3

57 files changed

Lines changed: 3808 additions & 0 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.dockerignore

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# VCS
2+
.git/
3+
.gitignore
4+
.github/
5+
6+
# Local environment
7+
.env
8+
.env.*
9+
!.env.example
10+
11+
# Python cruft
12+
__pycache__/
13+
*.py[cod]
14+
*.egg-info/
15+
.venv/
16+
venv/
17+
18+
# Django local artefacts
19+
*.sqlite3
20+
staticfiles/
21+
media/
22+
test_settings.py
23+
24+
# Editor / OS
25+
.idea/
26+
.vscode/
27+
.DS_Store
28+
29+
# Docs / dev-only files (not needed in the running container)
30+
docs/
31+
CONTRIBUTING.md
32+
SECURITY.md
33+
CHANGELOG.md
34+
AUTHORS
35+
36+
# Tests don't need to ship in the image (kept anyway since they're tiny — uncomment to exclude)
37+
# tracker/tests.py

.editorconfig

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
end_of_line = lf
6+
insert_final_newline = true
7+
trim_trailing_whitespace = true
8+
indent_style = space
9+
indent_size = 4
10+
11+
[*.{html,css,js,yml,yaml,json,md}]
12+
indent_size = 2
13+
14+
[Makefile]
15+
indent_style = tab

.env.example

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# =====================================================================
2+
# Time Tracker — environment configuration
3+
# Copy this file to .env and edit the values. Never commit .env to git.
4+
# =====================================================================
5+
6+
# ---- Django ----------------------------------------------------------
7+
# REQUIRED for production. Generate with:
8+
# python -c 'import secrets; print(secrets.token_urlsafe(64))'
9+
DJANGO_SECRET_KEY=
10+
11+
# Set to True only for local development. Never True in production.
12+
DJANGO_DEBUG=False
13+
14+
# Hostnames the app will accept (browser-facing). Comma-separated.
15+
# Example: timetracker.example.com,localhost
16+
DJANGO_ALLOWED_HOSTS=localhost,127.0.0.1
17+
18+
# Trusted origins for CSRF (include scheme). Required when behind a proxy with HTTPS.
19+
# Example: https://timetracker.example.com
20+
DJANGO_CSRF_TRUSTED_ORIGINS=http://localhost,http://127.0.0.1
21+
22+
# ---- Reverse proxy / HTTPS hardening --------------------------------
23+
# Set to True only if a reverse proxy you control terminates HTTPS and
24+
# sets X-Forwarded-Proto. NEVER enable this when the container is reachable
25+
# directly without a trusted proxy in front.
26+
DJANGO_BEHIND_HTTPS_PROXY=False
27+
28+
# Enable secure-cookie flags. Only set True when the site is served over HTTPS.
29+
DJANGO_COOKIE_SECURE=False
30+
31+
# Enable HSTS. Only set True when the site is served over HTTPS and you have
32+
# verified the certificate chain — HSTS is a one-way street.
33+
DJANGO_HSTS=False
34+
35+
# ---- PostgreSQL ------------------------------------------------------
36+
POSTGRES_DB=timetracker
37+
POSTGRES_USER=timetracker
38+
POSTGRES_PASSWORD=please-change-me
39+
POSTGRES_HOST=db
40+
POSTGRES_PORT=5432
41+
42+
# ---- Host port -------------------------------------------------------
43+
# Port on the docker host that maps to Apache:80 inside the container.
44+
WEB_PORT=8080
45+
46+
# ---- Timezone --------------------------------------------------------
47+
TZ=UTC
48+
49+
# ---- One-shot superuser bootstrap (optional, FIRST start only) -------
50+
# Recommended workflow:
51+
# 1) Set the three variables below and DJANGO_AUTO_CREATE_SUPERUSER=true
52+
# 2) docker compose up -d --build
53+
# 3) Log in, then set DJANGO_AUTO_CREATE_SUPERUSER=false (or remove the vars)
54+
# 4) Change your password via the UI (top-right menu → "Change password")
55+
#
56+
# Or skip the env vars entirely and run:
57+
# docker compose exec web python manage.py createsuperuser
58+
DJANGO_AUTO_CREATE_SUPERUSER=false
59+
DJANGO_SUPERUSER_USERNAME=
60+
DJANGO_SUPERUSER_PASSWORD=
61+
DJANGO_SUPERUSER_EMAIL=
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
name: Bug report
3+
about: Report a problem so we can fix it
4+
labels: bug
5+
---
6+
7+
**What happened?**
8+
A clear description of the bug.
9+
10+
**What did you expect to happen?**
11+
What you thought would happen instead.
12+
13+
**Steps to reproduce**
14+
1.
15+
2.
16+
3.
17+
18+
**Environment**
19+
- Time Tracker version / commit:
20+
- Docker version: `docker --version`
21+
- Host OS:
22+
- Browser:
23+
24+
**Relevant logs**
25+
```
26+
docker compose logs --tail=200 web
27+
```
28+
29+
**Additional context**
30+
Anything else worth mentioning (screenshots, config snippets — redact secrets!).
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
name: Feature request
3+
about: Suggest an enhancement
4+
labels: enhancement
5+
---
6+
7+
**Use case**
8+
What problem would this solve? Who would benefit?
9+
10+
**Proposed solution**
11+
How might it work? (Optional — the use case is more important.)
12+
13+
**Alternatives considered**
14+
Other ways to solve the same problem, if any.
15+
16+
**Additional context**
17+
Mock-ups, links to similar features elsewhere, etc.

.github/pull_request_template.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
## Summary
2+
3+
<!-- One or two sentences describing what this PR does and why. -->
4+
5+
## Changes
6+
7+
<!-- Bullet list of the actual changes. -->
8+
9+
-
10+
-
11+
-
12+
13+
## Related issues
14+
15+
<!-- e.g. Closes #42 -->
16+
17+
## Testing
18+
19+
<!-- How did you verify it works? -->
20+
21+
- [ ] `python manage.py check` passes
22+
- [ ] `python manage.py test tracker` passes
23+
- [ ] Tested manually in the browser
24+
25+
## Checklist
26+
27+
- [ ] My change preserves backward compatibility, or the breaking change is documented in CHANGELOG.md
28+
- [ ] New code paths are covered by tests
29+
- [ ] No secrets, credentials or personal data committed

.github/workflows/ci.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
test:
11+
name: Tests
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- name: Set up Python
17+
uses: actions/setup-python@v5
18+
with:
19+
python-version: "3.12"
20+
cache: pip
21+
22+
- name: Install WeasyPrint system dependencies
23+
run: |
24+
sudo apt-get update
25+
sudo apt-get install -y --no-install-recommends \
26+
libpango-1.0-0 libpangoft2-1.0-0 libharfbuzz0b \
27+
libcairo2 libgdk-pixbuf-2.0-0 libffi-dev \
28+
shared-mime-info fonts-dejavu fontconfig
29+
30+
- name: Install Python dependencies
31+
run: |
32+
python -m pip install --upgrade pip
33+
pip install -r requirements.txt
34+
35+
- name: Create test settings (SQLite override)
36+
run: |
37+
cat > test_settings.py <<'PY'
38+
from config.settings import *
39+
DATABASES = {"default": {"ENGINE": "django.db.backends.sqlite3", "NAME": ":memory:"}}
40+
PY
41+
42+
- name: Django system checks
43+
env:
44+
DJANGO_SECRET_KEY: ci-secret-key-for-checks-only
45+
DJANGO_DEBUG: "False"
46+
run: |
47+
python manage.py check --settings=test_settings
48+
49+
- name: Run test suite
50+
env:
51+
DJANGO_SECRET_KEY: ci-secret-key-for-tests-only
52+
DJANGO_DEBUG: "True"
53+
run: |
54+
python manage.py test tracker --settings=test_settings -v 2

.gitignore

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Python
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
*.egg-info/
6+
.eggs/
7+
build/
8+
dist/
9+
10+
# Virtual envs
11+
.venv/
12+
venv/
13+
env/
14+
.python-version
15+
16+
# Environment / secrets
17+
.env
18+
.env.*
19+
!.env.example
20+
21+
# Django
22+
*.sqlite3
23+
*.sqlite3-journal
24+
staticfiles/
25+
media/
26+
db.sqlite3
27+
test_settings.py
28+
29+
# Coverage / pytest
30+
.coverage
31+
.coverage.*
32+
htmlcov/
33+
.pytest_cache/
34+
.tox/
35+
36+
# IDEs / editors
37+
.idea/
38+
.vscode/
39+
*.swp
40+
*.swo
41+
.DS_Store
42+
43+
# Logs
44+
*.log
45+
46+
# OS
47+
Thumbs.db

AUTHORS

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
Time Tracker — Authors
2+
======================
3+
4+
The following people have contributed to Time Tracker:
5+
6+
* c4pt4in <https://github.com/cpt-kernel-afk>
7+
* Claude (Anthropic AI assistant) — initial scaffold and implementation,
8+
assisting c4pt4in
9+
10+
Listed in roughly chronological order of first contribution.

CHANGELOG.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file. The
4+
format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
5+
and this project adheres to [Semantic Versioning](https://semver.org/).
6+
7+
## [Unreleased]
8+
9+
## [0.1.0] - Initial release
10+
11+
### Added
12+
- Project CRUD (name, description, color, optional hourly rate, archive flag).
13+
- Time entry CRUD with auto-calculated duration.
14+
- Live timer with single-concurrent-timer policy and live JS counter.
15+
- Dashboard with today / week / month totals per project.
16+
- PDF report (WeasyPrint) with date range filter, project filter, optional
17+
cost calculation, per-project subtotals and a grand total.
18+
- CSV export of the same report data.
19+
- Built-in Django admin interface.
20+
- Authentication required on every endpoint; built-in login / logout /
21+
password-change views.
22+
- Apache + Gunicorn + supervisord container, PostgreSQL 16, docker compose.
23+
- Bootstrap 5 and Bootstrap Icons bundled locally (no CDN).
24+
- Test suite covering models, auth gating, timer flow, redirect safety, and
25+
report generation.
26+
27+
[Unreleased]: https://github.com/c4pt4in/timetracker/compare/v0.1.0...HEAD
28+
[0.1.0]: https://github.com/c4pt4in/timetracker/releases/tag/v0.1.0

0 commit comments

Comments
 (0)