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