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