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 | ## Screenshots |
|||||||
| 13 |  |
|||||||
| 14 | [](./Screenshot_2025-08-08_at_4.03.27_PM.png) |
|||||||
| 15 | [](./Screenshot_2025-08-08_at_4.03.54_PM.png) |
|||||||
| 16 | [](./Screenshot_2025-08-08_at_4.05.46_PM.png) |
|||||||
| 17 | ||||||||
| 18 | ||||||||
|
19 | --- |
||||||
| 20 | ||||||||
|
21 | ## β¨ Features |
||||||
| 22 | ||||||||
|
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 |
|||||||
|
30 | |||||||
| 31 | ### π **Analytics Dashboard** |
|||||||
|
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 |
|||||||
|
38 | |||||||
| 39 | ### π₯ **Employee Management** |
|||||||
|
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 |
|||||||
|
45 | |||||||
| 46 | ### πΎ **Data Export & Backup** |
|||||||
|
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 | --- |
|||||||
|
63 | |||||||
| 64 | ## π Quick Start |
|||||||
| 65 | ||||||||
|
66 | ### Prerequisites (Donβt Skip This, Ya Animal) |
||||||
|
67 | |||||||
|
68 | - Node.js 18+ |
||||||
| 69 | - OR Docker & Docker Compose (weβre fancy) |
|||||||
|
70 | |||||||
|
71 | --- |
||||||
|
72 | |||||||
|
73 | ### π§ͺ Option 1: Raw Node.js |
||||||
|
74 | ```bash |
||||||
| 75 | git clone https://github.com/tebwritescode/employee-hour-tracker.git |
|||||||
| 76 | cd employee-hour-tracker |
|||||||
| 77 | npm install |
|||||||
|
78 | npm start # Start like a regular ol' app |
||||||
| 79 | npm run dev # If you want auto-reload magic |
|||||||
|
80 | ``` |
||||||
| 81 | ||||||||
|
82 | --- |
||||||
| 83 | ||||||||
| 84 | ### π³ Option 2: Docker Compose (Recommended as Hell) |
|||||||
|
85 | |||||||
| 86 | ```bash |
|||||||
| 87 | git clone https://github.com/tebwritescode/employee-hour-tracker.git |
|||||||
| 88 | cd employee-hour-tracker |
|||||||
| 89 | docker-compose up -d |
|||||||
|
90 | docker-compose logs -f # Because watching logs is oddly satisfying |
||||||
| 91 | docker-compose down # When itβs time to kill it |
|||||||
|
92 | ``` |
||||||
| 93 | ||||||||
|
94 | --- |
||||||
| 95 | ||||||||
| 96 | ### π¨ Option 3: Docker CLI (For Hardcore Terminal Nerds) |
|||||||
|
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 | ||||||||
|
107 | App launches at `http://localhost:3000` |
||||||
| 108 | Go ahead, open it. We dare you. |
|||||||
|
109 | |||||||
|
110 | --- |
||||||
|
111 | |||||||
|
112 | ## π§ Configuration (Don't Screw These Up) |
||||||
|
113 | |||||||
| 114 | | Variable | Default | Description | |
|||||||
| 115 | |----------|---------|-------------| |
|||||||
|
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 |
|||||||
|
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 | ||||||||
|
147 | --- |
||||||
| 148 | ||||||||
|
149 | ## π Usage Guide |
||||||
| 150 | ||||||||
|
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` |
|||||||
|
159 | |||||||
|
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 |
|||||||
|
164 | |||||||
|
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 | --- |
|||||||
|
174 | |||||||
|
175 | ## ποΈ Project Architecture |
||||||
|
176 | |||||||
| 177 | ``` |
|||||||
| 178 | employee-hour-tracker/ |
|||||||
|
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 |
|||||||
|
191 | ``` |
||||||
| 192 | ||||||||
|
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 | --- |
|||||||
|
204 | |||||||
| 205 | ## π Security |
|||||||
| 206 | ||||||||
|
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) |
|||||||
|
212 | |||||||
|
213 | --- |
||||||
|
214 | |||||||
|
215 | ## π§ Dev Life |
||||||
|
216 | |||||||
| 217 | ```bash |
|||||||
|
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 | ``` |
|||||||
|
222 | |||||||
|
223 | --- |
||||||
|
224 | |||||||
|
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 | β
| |
|||||||
|
239 | |||||||
|
240 | --- |
||||||
|
241 | |||||||
|
242 | ## π Known WTFs |
||||||
|
243 | |||||||
|
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 |
|||||||
|
246 | |||||||
|
247 | (Fix coming soon. Or yell at us, that works too.) |
||||||
| 248 | ||||||||
| 249 | --- |
|||||||
|
250 | |||||||
| 251 | ## π License |
|||||||
| 252 | ||||||||
|
253 | MIT License β do whatever the hell you want, just don't sue us. |
||||||
|
254 | |||||||
|
255 | --- |
||||||
|
256 | |||||||
|
257 | ## π€ Contributions |
||||||
|
258 | |||||||
|
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 | --- |
|||||||
|
270 | |||||||
|
271 | ## π§ Need Help? |
||||||
|
272 | |||||||
|
273 | Open an issue [on the repo](https://github.com/tebwritescode/employee-hour-tracker/issues), or @ us like you're summoning Gandalf. |
||||||
|
274 | |||||||
| 275 | --- |
|||||||
| 276 | ||||||||
|
277 | <p align="center"> |
||||||
| 278 | Made with β€οΈ, coffee, and not enough sleep by <a href="https://github.com/tebwritescode">tebwritescode</a> |
|||||||
| 279 | </p> |
|||||||