Blame
|
1 | # Sales Tracker |
||||||
| 2 | ||||||||
|
3 | > A modern-as-hell, playful web application for tracking sales and wrangling analytics — with an interactive login that's almost too clever for its own good. |
||||||
|
4 | |||||||
|
5 |  |
||||||
| 6 |  |
|||||||
| 7 |  |
|||||||
| 8 |  |
|||||||
|
9 |  |
||||||
|
10 | |||||||
|
11 | <details> |
||||||
| 12 | <summary><i>Click to show screenshots</i></summary> |
|||||||
| 13 | ||||||||
|
14 | ## Screenshots |
||||||
|
15 |  |
||||||
|
16 | [](./Screenshot_2025-08-08_at_3.36.48_PM.png) |
||||||
| 17 | [](./Screenshot_2025-08-08_at_3.36.41_PM.png) |
|||||||
| 18 | [](./Screenshot_2025-08-08_at_3.36.30_PM.png) |
|||||||
| 19 | [](./Screenshot_2025-08-08_at_3.36.21_PM.png) |
|||||||
| 20 | [](./Screenshot_2025-08-08_at_3.35.43_PM.png) |
|||||||
|
21 | |||||||
|
22 | </details> |
||||||
| 23 | ||||||||
|
24 | ## Features |
||||||
| 25 | ||||||||
| 26 | - 📊 **Sales Analytics Dashboard** – Visualize sales like a data-driven badass |
|||||||
| 27 | - 👥 **User Management** – Multi-level permissions so your team doesn’t accidentally break stuff |
|||||||
| 28 | - 📈 **Data Entry & Export** – Input sales quickly and shoot that crap into Excel |
|||||||
| 29 | - 🎮 **Interactive Login** – Cursor-evasive Sign In button just to mess with people |
|||||||
| 30 | - 🔒 **Secure Authentication** – Password hashing that even your nosy-ass sysadmin can’t break |
|||||||
| 31 | - 📱 **Responsive Design** – Runs smooth on desktop, tablet, or that old phone you still won’t upgrade |
|||||||
| 32 | ||||||||
| 33 | ### Core Functionality |
|||||||
| 34 | ||||||||
| 35 | - **Employee Management** – Add/edit employees, their commissions, draws — the whole damn deal |
|||||||
| 36 | - **Sales Data Entry** – Do it by hand or slam in a CSV like a pro |
|||||||
| 37 | - **Analytics Dashboard** – Filter and graph until the numbers make sense or you rage-quit |
|||||||
| 38 | - **Admin Panel** – Wrapped in password protection, because duh |
|||||||
| 39 | ||||||||
| 40 | ### Database Schema |
|||||||
| 41 | ||||||||
| 42 | Your data’s not just dumped — we gave it structure like responsible grownups: |
|||||||
| 43 | ||||||||
| 44 | - **Employee Table**: Tracks the who, what, and when of your sales crew |
|||||||
| 45 | - **Sales Table**: Logs every dollar that rolls in |
|||||||
| 46 | - **Settings Table**: Keeps track of your system’s default working setup and toggles |
|||||||
| 47 | - **Goals Table**: Measure who's slaying and who's slacking |
|||||||
| 48 | ||||||||
| 49 | ### Three Main Pages |
|||||||
| 50 | ||||||||
| 51 | #### 1. Management Tab (Locked Behind a Password Wall) |
|||||||
| 52 | ||||||||
| 53 | - Admin login with proper credentials (no password123 crap) |
|||||||
| 54 | - Employee configuration panel |
|||||||
| 55 | - Settings for system behavior and admin updates |
|||||||
| 56 | - Switch how commissions & draws are shown — % or actual bucks |
|||||||
| 57 | - **Epic theme picker with 8 presets for maximum visual hell yeah** |
|||||||
| 58 | ||||||||
| 59 | #### 2. Analytics Page (Wide Frickin’ Open) |
|||||||
| 60 | ||||||||
| 61 | - Tracks Year-to-Date stats, or whatever time range floats your fancy |
|||||||
| 62 | - Uses Chart.js because facts deserve pretty pictures |
|||||||
| 63 | - Bar, pie, line charts — you name it |
|||||||
| 64 | - Filter time ranges and export data like an absolute legend |
|||||||
| 65 | - Adaptive UI responds to theme like a mood ring for business |
|||||||
| 66 | ||||||||
| 67 | #### 3. Data Entry Page (Wide Open Like Your Inbox) |
|||||||
| 68 | ||||||||
| 69 | - Manual sales input |
|||||||
| 70 | - Commissions calculated automatically (no more math headaches) |
|||||||
| 71 | - Draw payment tracking — keep it drama-free |
|||||||
| 72 | - Upload CSVs and watch it handle bulk data like a champ |
|||||||
| 73 | - Validates your entries because your future self will thank you |
|||||||
| 74 | - Keeps the recent entries right where you can see them |
|||||||
| 75 | ||||||||
| 76 | ## Technical Stack |
|||||||
| 77 | ||||||||
| 78 | Because building badass tools needs solid tech: |
|||||||
| 79 | ||||||||
| 80 | - 🧠 **Backend**: Flask + SQLAlchemy |
|||||||
| 81 | - 🐘 **Database**: SQLite, cause it just works |
|||||||
| 82 | - 🖋️ **Forms**: Flask-WTF with CSRF defense |
|||||||
| 83 | - 🔐 **Security**: Werk-f’ing-Zeug password hashing for locked-tight sessions |
|||||||
| 84 | - 💅 **Frontend**: Bootstrap 5, sexy in all screen sizes |
|||||||
| 85 | - 📊 **Charts**: Chart.js — clean, crisp, and fast AF |
|||||||
| 86 | - 🐳 **Deployment**: Dockerized and ready to ship |
|||||||
| 87 | ||||||||
| 88 | ## Installation & Setup |
|||||||
| 89 | ||||||||
| 90 | ### Quick Start with Docker (The Way Developers Actually Do It) |
|||||||
| 91 | ||||||||
| 92 | 1. Clone this bad boy: |
|||||||
| 93 | ```bash |
|||||||
| 94 | git clone <repository-url> |
|||||||
| 95 | cd sales-tracker |
|||||||
| 96 | chmod +x setup.sh |
|||||||
| 97 | ./setup.sh |
|||||||
| 98 | ``` |
|||||||
| 99 | ||||||||
| 100 | 2. Manual Docker Compose (for control freaks): |
|||||||
| 101 | ```bash |
|||||||
| 102 | docker-compose up --build |
|||||||
| 103 | ``` |
|||||||
| 104 | ||||||||
| 105 | 3. Launch that sucker: |
|||||||
| 106 | - Visit http://localhost:5000 |
|||||||
| 107 | - Admin credentials: `admin` / `admin` (you’ll wanna change that ASAP) |
|||||||
| 108 | ||||||||
| 109 | ### Setup Options |
|||||||
| 110 | ||||||||
| 111 | **Dev Mode** — a no-pressure playground: |
|||||||
| 112 | ```bash |
|||||||
| 113 | ./setup.sh --dev |
|||||||
| 114 | ``` |
|||||||
| 115 | ||||||||
| 116 | **Production Mode** — the serious stuff: |
|||||||
| 117 | ```bash |
|||||||
| 118 | ./setup.sh --production |
|||||||
| 119 | ``` |
|||||||
| 120 | ||||||||
| 121 | **Persistent Mode** — the one that doesn’t forget your data: |
|||||||
| 122 | ```bash |
|||||||
| 123 | ./setup.sh --persistent |
|||||||
| 124 | ``` |
|||||||
| 125 | ||||||||
| 126 | Gives access at http://localhost:5001 if you're following recipes correctly. |
|||||||
| 127 | ||||||||
| 128 | ### Got Database Problems? Let’s Kick Their Ass |
|||||||
| 129 | ||||||||
| 130 | 1. Use in-container magic: |
|||||||
| 131 | ```bash |
|||||||
| 132 | docker run -p 5000:5000 -e DATABASE_URL=sqlite:///sales_tracker.db sales-tracker |
|||||||
| 133 | ``` |
|||||||
| 134 | ||||||||
| 135 | 2. Fix crappy host permissions: |
|||||||
| 136 | ```bash |
|||||||
| 137 | mkdir -p data uploads |
|||||||
| 138 | chmod 755 data uploads |
|||||||
| 139 | ``` |
|||||||
| 140 | ||||||||
| 141 | 3. Or go full persistent mode: |
|||||||
| 142 | ```bash |
|||||||
| 143 | ./setup.sh --persistent |
|||||||
| 144 | ``` |
|||||||
| 145 | ||||||||
| 146 | ### Local Dev Setup |
|||||||
| 147 | ||||||||
| 148 | 1. Get your damn Python set up: |
|||||||
| 149 | ```bash |
|||||||
| 150 | python3 -m venv venv |
|||||||
| 151 | source venv/bin/activate |
|||||||
| 152 | pip install -r requirements.txt |
|||||||
| 153 | ``` |
|||||||
| 154 | ||||||||
| 155 | 2. Fire up the beast: |
|||||||
| 156 | ```bash |
|||||||
| 157 | python app.py |
|||||||
| 158 | ``` |
|||||||
| 159 | ||||||||
| 160 | 3. Open browser → http://localhost:5000 |
|||||||
| 161 | (Or don’t. Be a rebel.) |
|||||||
| 162 | ||||||||
| 163 | ## Configuration |
|||||||
| 164 | ||||||||
| 165 | ### Environment Sh*t You Shouldn’t Forget |
|||||||
| 166 | ||||||||
| 167 | - `SECRET_KEY` — don’t check this into Git, ya dingus |
|||||||
| 168 | - `FLASK_ENV` — development or production |
|||||||
| 169 | - `DATABASE_URL` — override the default if you like pain |
|||||||
| 170 | ||||||||
| 171 | ### Defaults |
|||||||
| 172 | ||||||||
| 173 | - Admin: `admin` |
|||||||
| 174 | - Password: `admin` (again, change it dammit) |
|||||||
| 175 | - Database: `sales_tracker.db` |
|||||||
| 176 | ||||||||
| 177 | ## Usage Guide |
|||||||
| 178 | ||||||||
| 179 | ### First-Time Dance |
|||||||
| 180 | ||||||||
| 181 | 1. Load up http://localhost:5000 |
|||||||
| 182 | 2. Smash that “Admin Login” button |
|||||||
| 183 | 3. Change the password — your organization’s honor depends on it |
|||||||
| 184 | 4. Add employees like a benevolent god |
|||||||
| 185 | ||||||||
| 186 | ### Logging Sales (a.k.a. The Reason This Sh*t Exists) |
|||||||
| 187 | ||||||||
| 188 | 1. Go to Data Entry |
|||||||
| 189 | 2. Type in details |
|||||||
| 190 | 3. Let auto-commission math do its thing |
|||||||
| 191 | 4. Or bulk upload a fancy-ass CSV |
|||||||
| 192 | ||||||||
| 193 | ### Viewing Analytics |
|||||||
| 194 | ||||||||
| 195 | 1. Hit Analytics |
|||||||
| 196 | 2. Filter stuff until it tells you something useful |
|||||||
| 197 | 3. Export if your boss wants proof |
|||||||
| 198 | ||||||||
| 199 | ### Managing the Team |
|||||||
| 200 | ||||||||
| 201 | 1. Admin login |
|||||||
| 202 | 2. Edit employees or set their goals |
|||||||
| 203 | 3. Toggle display settings — % or flat amounts |
|||||||
| 204 | 4. Yell at slackers (optional) |
|||||||
| 205 | ||||||||
| 206 | ### Theme Customization (Because Vibes Matter) |
|||||||
| 207 | ||||||||
| 208 | 1. Hit the palette icon in the navbar |
|||||||
| 209 | 2. Choose one of the 8 eye-popping themes |
|||||||
| 210 | 3. Watch the app change outfits instantly |
|||||||
| 211 | ||||||||
| 212 | Themes include: |
|||||||
| 213 | ||||||||
| 214 | - Default Blue |
|||||||
| 215 | - Dark Theme (work in the shadows, baby) |
|||||||
| 216 | - Nature Green (for tree-huggin’ teams) |
|||||||
| 217 | - Royal Purple (His Royal Freshness would approve) |
|||||||
| 218 | - Sunset Orange |
|||||||
| 219 | - Ocean Teal |
|||||||
| 220 | - Corporate Red (power tie vibes) |
|||||||
| 221 | - Modern Pink |
|||||||
| 222 | ||||||||
| 223 | Settings persist for admin; guests get localStorage (so they don’t ruin your vibe). |
|||||||
| 224 | ||||||||
| 225 | ## File Structure |
|||||||
| 226 | ||||||||
| 227 | ``` |
|||||||
| 228 | sales-tracker/ |
|||||||
| 229 | ├── app.py # Main Flask beast |
|||||||
| 230 | ├── requirements.txt # Python goodies |
|||||||
| 231 | ├── Dockerfile # So your app works on my damn machine too |
|||||||
| 232 | ├── docker-compose.yml # Stack orchestration magic |
|||||||
| 233 | … |
|||||||
| 234 | ``` |
|||||||
| 235 | ||||||||
| 236 | ## API Endpoints |
|||||||
| 237 | ||||||||
| 238 | - `GET /api/sales_data?period=YTD` — give us that chart data |
|||||||
| 239 | - `GET /api/trends_data` — how the bloody hell are we doing? |
|||||||
| 240 | - `POST /bulk_upload` — shove an entire CSV down its throat |
|||||||
| 241 | ||||||||
| 242 | ## Security Features |
|||||||
| 243 | ||||||||
| 244 | - Password hashing (locked tighter than grandma’s cookie jar) |
|||||||
| 245 | - CSRF protection — no cross-site BS allowed |
|||||||
| 246 | - Session-based ownership |
|||||||
| 247 | - Input validation so you don’t feed it junk |
|||||||
| 248 | - SQLAlchemy ORM to dodge SQL injection like Neo |
|||||||
| 249 | ||||||||
| 250 | ## Performance |
|||||||
| 251 | ||||||||
| 252 | Fast as hell. Optimized frontend, backend, and everything in between. Ready to scale... maybe. |
|||||||
| 253 | ||||||||
| 254 | ## Maintenance |
|||||||
| 255 | ||||||||
| 256 | ### Backup the Damn DB |
|||||||
| 257 | ||||||||
| 258 | ```bash |
|||||||
| 259 | docker exec sales-tracker-app sqlite3 /app/sales_tracker.db ".backup /app/data/backup.db" |
|||||||
| 260 | ``` |
|||||||
| 261 | ||||||||
| 262 | ### Update This Beautiful Bastard |
|||||||
| 263 | ||||||||
| 264 | ```bash |
|||||||
| 265 | docker-compose down |
|||||||
| 266 | docker-compose up --build |
|||||||
| 267 | ``` |
|||||||
| 268 | ||||||||
| 269 | ### Check Logs Like a Debugging Ninja |
|||||||
| 270 | ||||||||
| 271 | ```bash |
|||||||
| 272 | docker-compose logs -f sales-tracker |
|||||||
| 273 | ``` |
|||||||
| 274 | ||||||||
| 275 | ## Contributing |
|||||||
| 276 | ||||||||
| 277 | 1. Fork it |
|||||||
| 278 | 2. Branch it |
|||||||
| 279 | 3. Make it better |
|||||||
| 280 | 4. Pull request and bask in glory |
|||||||
| 281 | ||||||||
| 282 | ## Support |
|||||||
| 283 | ||||||||
| 284 | Issues? Questions? Praise-singing? |
|||||||
|
285 | File an issue on GitHub or yell at [teb](https://github.com/tebwritescode). |
||||||
|
286 | |||||||
| 287 | --- |
|||||||
|
288 | 👑 Created by: [tebbydog0605](https://github.com/tebwritescode) |
||||||
|
289 | 🐋 Docker Hub: [tebwritescode](https://hub.docker.com/u/tebwritescode) |
||||||
|
290 | 💻 Website: [teb.codes](https://teb.codes) |
||||||