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