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