Blame

28a846 Tebby Dog 2025-08-08 19:55:24
init
1
# πŸ“Š Employee Hour Tracker
2
ccec28 Tebby Dog 2025-08-08 20:00:53
wording
3
> A badass web app to monitor employees entering their time, serve up real-time analytics, and automate your backups β€” so you can stop worrying and focus on getting sh*t done.
28a846 Tebby Dog 2025-08-08 19:55:24
init
4
5
![Node.js](https://img.shields.io/badge/Node.js-18%2B-green)
6
![Express](https://img.shields.io/badge/Express-4.18-blue)
7
![SQLite](https://img.shields.io/badge/SQLite-3-orange)
8
![Docker](https://img.shields.io/badge/Docker-Ready-blue)
9
f29811 Tebby Dog 2025-08-08 20:07:53
screens
10
---
11
12
## Screenshots
13
![Table View](./Screenshot_2025-08-08_at_4.03.27_PM.png)
14
[![Table View](./Screenshot_2025-08-08_at_4.03.27_PM.png?thumbnail)](./Screenshot_2025-08-08_at_4.03.27_PM.png)
15
[![Management](./Screenshot_2025-08-08_at_4.03.54_PM.png?thumbnail)](./Screenshot_2025-08-08_at_4.03.54_PM.png)
16
[![Analytics](./Screenshot_2025-08-08_at_4.05.46_PM.png?thumbnail)](./Screenshot_2025-08-08_at_4.05.46_PM.png)
17
18
ccec28 Tebby Dog 2025-08-08 20:00:53
wording
19
---
20
28a846 Tebby Dog 2025-08-08 19:55:24
init
21
## ✨ Features
22
ccec28 Tebby Dog 2025-08-08 20:00:53
wording
23
### πŸ“… **Time Tracking (A.K.A. Keeping Tabs on Your Squad)**
24
25
- Weekly grid interface sharp enough to make spreadsheets cry
26
- Click once? Log it. Twice? Flag it. Thrice? Fix-it mode, baby
27
- Built-in calendar picker so you don't fat-finger the wrong week
28
- Default week your way β€” past, present, or hell, even the future
29
- No β€œSave” button needed β€” everything saves itself like grown-up software
28a846 Tebby Dog 2025-08-08 19:55:24
init
30
31
### πŸ“ˆ **Analytics Dashboard**
ccec28 Tebby Dog 2025-08-08 20:00:53
wording
32
33
- Sexy-ass charts courtesy of Chart.js
34
- Date ranges? Yep. Choose from Last Week, Month, 90 Days, or freestyle
35
- Pie charts of shame: See who's not entered a damn thing
36
- Employee comparisons so you know who’s crushing it
37
- Summary stats that slap you with truths at a glance
28a846 Tebby Dog 2025-08-08 19:55:24
init
38
39
### πŸ‘₯ **Employee Management**
ccec28 Tebby Dog 2025-08-08 20:00:53
wording
40
41
- Add, edit, and yeet employees in or out with full control
42
- Inline editing β€” because popups can get bent
43
- Confirmation dialogs keep you from rage-deleting poor Jim by mistake
44
- Secure, session-based login β€” no freeloaders allowed
28a846 Tebby Dog 2025-08-08 19:55:24
init
45
46
### πŸ’Ύ **Data Export & Backup**
ccec28 Tebby Dog 2025-08-08 20:00:53
wording
47
48
- Export in:
49
- Colored Excel (preserves all that green/yellow/red goodness)
50
- JSON (for the nerds and the APIs)
51
- CSV (because boring as hell = universal)
52
- Auto-backups so you can sleep like a baby β€” configurable too
53
54
### 🎨 **Beautiful AF UI**
55
56
- Responsive as heck β€” use it on a tablet, a phone, or a potato
57
- A glorious purple gradient worth showing off to design nerds
58
- Smooth transitions that don’t make you nauseous
59
- Touch support that'll make any mobile user say β€œdamn that’s clean”
60
- You might actually enjoy navigating this one
61
62
---
28a846 Tebby Dog 2025-08-08 19:55:24
init
63
64
## πŸš€ Quick Start
65
ccec28 Tebby Dog 2025-08-08 20:00:53
wording
66
### Prerequisites (Don’t Skip This, Ya Animal)
28a846 Tebby Dog 2025-08-08 19:55:24
init
67
ccec28 Tebby Dog 2025-08-08 20:00:53
wording
68
- Node.js 18+
69
- OR Docker & Docker Compose (we’re fancy)
28a846 Tebby Dog 2025-08-08 19:55:24
init
70
ccec28 Tebby Dog 2025-08-08 20:00:53
wording
71
---
28a846 Tebby Dog 2025-08-08 19:55:24
init
72
ccec28 Tebby Dog 2025-08-08 20:00:53
wording
73
### πŸ§ͺ Option 1: Raw Node.js
28a846 Tebby Dog 2025-08-08 19:55:24
init
74
```bash
75
git clone https://github.com/tebwritescode/employee-hour-tracker.git
76
cd employee-hour-tracker
77
npm install
ccec28 Tebby Dog 2025-08-08 20:00:53
wording
78
npm start # Start like a regular ol' app
79
npm run dev # If you want auto-reload magic
28a846 Tebby Dog 2025-08-08 19:55:24
init
80
```
81
ccec28 Tebby Dog 2025-08-08 20:00:53
wording
82
---
83
84
### 🐳 Option 2: Docker Compose (Recommended as Hell)
28a846 Tebby Dog 2025-08-08 19:55:24
init
85
86
```bash
87
git clone https://github.com/tebwritescode/employee-hour-tracker.git
88
cd employee-hour-tracker
89
docker-compose up -d
ccec28 Tebby Dog 2025-08-08 20:00:53
wording
90
docker-compose logs -f # Because watching logs is oddly satisfying
91
docker-compose down # When it’s time to kill it
28a846 Tebby Dog 2025-08-08 19:55:24
init
92
```
93
ccec28 Tebby Dog 2025-08-08 20:00:53
wording
94
---
95
96
### πŸ”¨ Option 3: Docker CLI (For Hardcore Terminal Nerds)
28a846 Tebby Dog 2025-08-08 19:55:24
init
97
98
```bash
99
docker build -t employee-hour-tracker .
100
docker run -d \
101
--name employee-tracker \
102
-p 3000:3000 \
103
-v employee-tracker-data:/app/data \
104
employee-hour-tracker
105
```
106
ccec28 Tebby Dog 2025-08-08 20:00:53
wording
107
App launches at `http://localhost:3000`
108
Go ahead, open it. We dare you.
28a846 Tebby Dog 2025-08-08 19:55:24
init
109
ccec28 Tebby Dog 2025-08-08 20:00:53
wording
110
---
28a846 Tebby Dog 2025-08-08 19:55:24
init
111
ccec28 Tebby Dog 2025-08-08 20:00:53
wording
112
## πŸ”§ Configuration (Don't Screw These Up)
28a846 Tebby Dog 2025-08-08 19:55:24
init
113
114
| Variable | Default | Description |
115
|----------|---------|-------------|
ccec28 Tebby Dog 2025-08-08 20:00:53
wording
116
| `PORT` | `3000` | Where the hell the server listens |
117
| `NODE_ENV` | `development` | Pick your poison: `development` vs `production` |
118
| `DB_PATH` | `./employee_tracker.db` | Where your crucial time data lives |
119
| `SESSION_SECRET` | `employee-tracker-secret-key` | Hide this like it’s your banking password |
120
| `DEFAULT_ADMIN_USERNAME` | `admin` | The overlord’s default login |
121
| `DEFAULT_ADMIN_PASSWORD` | `admin123` | CHANGE THIS ASAP πŸ”₯ |
122
| `BACKUP_ENABLED` | `true` | Yeah, you want this on |
123
| `BACKUP_INTERVAL` | `86400000` | How often to save your backside (MS) |
124
| `BACKUP_RETENTION_DAYS` | `30` | How long to keep your safety net |
125
126
---
127
128
### πŸ‹ Docker Compose Config
28a846 Tebby Dog 2025-08-08 19:55:24
init
129
130
```yaml
131
version: '3.8'
132
services:
133
app:
134
image: employee-hour-tracker
135
environment:
136
- NODE_ENV=production
137
- SESSION_SECRET=your-secure-secret-here
138
- DEFAULT_ADMIN_USERNAME=admin
139
- DEFAULT_ADMIN_PASSWORD=change-this-password
140
ports:
141
- "3000:3000"
142
volumes:
143
- ./data:/app/data
144
- ./backups:/app/backups
145
```
146
ccec28 Tebby Dog 2025-08-08 20:00:53
wording
147
---
148
28a846 Tebby Dog 2025-08-08 19:55:24
init
149
## πŸ“– Usage Guide
150
ccec28 Tebby Dog 2025-08-08 20:00:53
wording
151
### ⏱️ Time Tracking `/tracking`
152
153
1. Pick your week and start clicking grid cells like a god
154
2. Cycle statuses like a boss
155
3. Sit back β€” auto-save’s doing the work for you
156
4. Use arrows & selectors if you like jumping through time
157
158
### πŸ“Š Analytics `/analytics`
28a846 Tebby Dog 2025-08-08 19:55:24
init
159
ccec28 Tebby Dog 2025-08-08 20:00:53
wording
160
1. Choose your dates
161
2. Interpret shame-slices in the pie chart
162
3. Compare your team’s hustle in bar form
163
4. Click Export and flex on your boss with pretty data
28a846 Tebby Dog 2025-08-08 19:55:24
init
164
ccec28 Tebby Dog 2025-08-08 20:00:53
wording
165
### πŸ‘¨β€πŸ’Ό Admin Stuff `/management`
166
167
1. Log in as admin (`admin` / `admin123`) β€” seriously, change that
168
2. Add new employees like it’s HR day
169
3. Click to edit names (typos won’t fix themselves)
170
4. Boot off old names thoughtfully (confirmation included)
171
5. Global settings & data export tools right at your manicured fingertips
172
173
---
28a846 Tebby Dog 2025-08-08 19:55:24
init
174
ccec28 Tebby Dog 2025-08-08 20:00:53
wording
175
## πŸ—οΈ Project Architecture
28a846 Tebby Dog 2025-08-08 19:55:24
init
176
177
```
178
employee-hour-tracker/
ccec28 Tebby Dog 2025-08-08 20:00:53
wording
179
β”œβ”€β”€ πŸ“„ server.js # RESTful backend engine of doom
180
β”œβ”€β”€ πŸ“„ backup.js # Makes sure your data doesn’t go *poof*
181
β”œβ”€β”€ πŸ“„ package.json # Clearly you’ve heard of this
182
β”œβ”€β”€ πŸ“„ docker-compose.yml # Container boyband orchestration
183
β”œβ”€β”€ πŸ“„ Dockerfile # Turns your app into deployable magic
184
β”œβ”€β”€ πŸ“ public/ # Frontend good stuff
185
β”‚ β”œβ”€β”€ index.html # Your glorious entry point
186
β”‚ β”œβ”€β”€ style.css # Sharp purple swagger
187
β”‚ β”œβ”€β”€ script.js # Grid logic + admin finesse
188
β”‚ └── chart.js # Analytics eye-candy
189
β”œβ”€β”€ πŸ“ backups/ # This folder saves asses
190
└── πŸ“— employee_tracker.db # Don't delete this... seriously
28a846 Tebby Dog 2025-08-08 19:55:24
init
191
```
192
ccec28 Tebby Dog 2025-08-08 20:00:53
wording
193
---
194
195
### βš™οΈ Tech Stack
196
197
- **Backend**: Node.js + Express
198
- **Database**: SQLite3 + better-sqlite3 (the better part matters)
199
- **Frontend**: Raw Vanilla JS (no extra calories) + Chart.js
200
- **Auth**: express-session + bcryptjs (like a bouncer for your admin area)
201
- **Containerization**: Docker & Docker Compose
202
203
---
28a846 Tebby Dog 2025-08-08 19:55:24
init
204
205
## πŸ” Security
206
ccec28 Tebby Dog 2025-08-08 20:00:53
wording
207
- Hashed passwords (get rekt plain text)
208
- Session-based login β€” no silly tokens
209
- CORS-tight so outsiders can’t jack your data
210
- SQL injection-proof β€” parameterized 'cause we’re not amateurs
211
- Secrets optional but highly encouraged (you’ve been warned)
28a846 Tebby Dog 2025-08-08 19:55:24
init
212
ccec28 Tebby Dog 2025-08-08 20:00:53
wording
213
---
28a846 Tebby Dog 2025-08-08 19:55:24
init
214
ccec28 Tebby Dog 2025-08-08 20:00:53
wording
215
## πŸ”§ Dev Life
28a846 Tebby Dog 2025-08-08 19:55:24
init
216
217
```bash
ccec28 Tebby Dog 2025-08-08 20:00:53
wording
218
npm run dev # Hot reload fixups
219
npm start # Serious prod mode
220
npm run install-deps # Just in case you skipped setup like a rebel
221
```
28a846 Tebby Dog 2025-08-08 19:55:24
init
222
ccec28 Tebby Dog 2025-08-08 20:00:53
wording
223
---
28a846 Tebby Dog 2025-08-08 19:55:24
init
224
ccec28 Tebby Dog 2025-08-08 20:00:53
wording
225
### πŸ”Œ API Endpoints
226
227
| Method | URL | What-It-Does | Auth |
228
|--------|-----|--------------|------|
229
| GET | `/api/employees` | Fetch worker list | ❌ |
230
| POST | `/api/employees` | Add a badass | βœ… |
231
| PUT | `/api/employees/:id` | Update someone’s stuff | βœ… |
232
| DELETE | `/api/employees/:id`| Boot 'em | βœ… |
233
| GET | `/api/time-entries` | Fetch time logs | ❌ |
234
| POST | `/api/time-entries` | Save/correct logs | ❌ |
235
| GET | `/api/analytics` | Data candy | ❌ |
236
| POST | `/api/login` | Get in | ❌ |
237
| POST | `/api/logout` | Peace out | βœ… |
238
| GET | `/api/export/:format` | Download your victory proof | βœ… |
28a846 Tebby Dog 2025-08-08 19:55:24
init
239
ccec28 Tebby Dog 2025-08-08 20:00:53
wording
240
---
28a846 Tebby Dog 2025-08-08 19:55:24
init
241
ccec28 Tebby Dog 2025-08-08 20:00:53
wording
242
## 🐞 Known WTFs
28a846 Tebby Dog 2025-08-08 19:55:24
init
243
ccec28 Tebby Dog 2025-08-08 20:00:53
wording
244
- Week nav is a little moody if you click like a caffeinated squirrel
245
- In rare cases, the status marker’s a lazy bastard and doesn’t update instantly
28a846 Tebby Dog 2025-08-08 19:55:24
init
246
ccec28 Tebby Dog 2025-08-08 20:00:53
wording
247
(Fix coming soon. Or yell at us, that works too.)
248
249
---
28a846 Tebby Dog 2025-08-08 19:55:24
init
250
251
## πŸ“ License
252
ccec28 Tebby Dog 2025-08-08 20:00:53
wording
253
MIT License β€” do whatever the hell you want, just don't sue us.
28a846 Tebby Dog 2025-08-08 19:55:24
init
254
ccec28 Tebby Dog 2025-08-08 20:00:53
wording
255
---
28a846 Tebby Dog 2025-08-08 19:55:24
init
256
ccec28 Tebby Dog 2025-08-08 20:00:53
wording
257
## 🀝 Contributions
28a846 Tebby Dog 2025-08-08 19:55:24
init
258
ccec28 Tebby Dog 2025-08-08 20:00:53
wording
259
Pull requests welcome! The more brains, the better.
260
261
```bash
262
git checkout -b feature/CoolSh*t
263
git commit -m 'Add wild feature'
264
git push origin feature/CoolSh*t
265
```
266
267
Then make that PR and take your place in README glory.
268
269
---
28a846 Tebby Dog 2025-08-08 19:55:24
init
270
ccec28 Tebby Dog 2025-08-08 20:00:53
wording
271
## πŸ“§ Need Help?
28a846 Tebby Dog 2025-08-08 19:55:24
init
272
ccec28 Tebby Dog 2025-08-08 20:00:53
wording
273
Open an issue [on the repo](https://github.com/tebwritescode/employee-hour-tracker/issues), or @ us like you're summoning Gandalf.
28a846 Tebby Dog 2025-08-08 19:55:24
init
274
275
---
276
ccec28 Tebby Dog 2025-08-08 20:00:53
wording
277
<p align="center">
278
Made with ❀️, coffee, and not enough sleep by <a href="https://github.com/tebwritescode">tebwritescode</a>
279
</p>