Blame

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