Skip to content

Commit dc3c82a

Browse files
committed
update
1 parent 96f16cb commit dc3c82a

File tree

2 files changed

+43
-149
lines changed

2 files changed

+43
-149
lines changed

README.md

Lines changed: 43 additions & 149 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,20 @@
22

33
A real-time dashboard for analyzing Traefik logs with IP geolocation, status code analysis, and service metrics. Built with React (Shadcn UI) and Node.js.
44

5-
![Dashboard Preview](dashboard-preview.png)
5+
![Dashboard Preview](scripts/dashboard.png)
66

77
## Features
88

9-
- 📊 **Real-time Log Monitoring**: Live updates via WebSocket
10-
- 🌍 **IP Geolocation**: Track requests by country and city
11-
- 📈 **Comprehensive Analytics**:
9+
- **Real-time Log Monitoring**: Live updates via WebSocket
10+
- **IP Geolocation**: Track requests by country and city
11+
- **Comprehensive Analytics**:
1212
- Request rate and response times
1313
- Status code distribution
1414
- Service and router statistics
1515
- Error rate monitoring
16-
- 🎨 **Modern UI**: Built with Shadcn UI components
17-
- 🐳 **Containerized**: Easy deployment with Docker
18-
- 🔄 **Auto-refresh**: Stats update every 5 seconds
16+
- **Modern UI**: Built with Shadcn UI components
17+
- **Containerized**: Easy deployment with Docker
18+
- **Auto-refresh**: Stats update every 5 seconds
1919

2020
## Prerequisites
2121

@@ -190,114 +190,7 @@ Edit `frontend/src/index.css` to customize colors and styling.
190190
- Private IPs show as "Private Network"
191191
- Rate limits may apply for high-traffic sites
192192

193-
## Security Notes
194193

195-
- Log files are mounted read-only
196-
- No authentication is included (add reverse proxy with auth for production)
197-
- Consider IP anonymization for GDPR compliance
198-
199-
## Contributing
200-
201-
1. Fork the repository
202-
2. Create a feature branch
203-
3. Commit your changes
204-
4. Push to the branch
205-
5. Create a Pull Request
206-
207-
## License
208-
209-
MIT License - see LICENSE file for details
210-
211-
## Acknowledgments
212-
213-
- Built with [Shadcn UI](https://ui.shadcn.com/)
214-
- IP Geolocation by [ip-api.com](http://ip-api.com/)
215-
- Icons by [Lucide](https://lucide.dev/)
216-
217-
# Complete Traefik Log Dashboard Setup Guide
218-
219-
## 🚀 Quick Start (5 minutes)
220-
221-
```bash
222-
# 1. Clone or create the project
223-
git clone https://github.com/yourusername/traefik-log-dashboard.git
224-
cd traefik-log-dashboard
225-
226-
# 2. Make setup script executable
227-
chmod +x setup.sh
228-
229-
# 3. Run setup
230-
./setup.sh
231-
232-
# 4. Access dashboard
233-
open http://localhost:3000
234-
```
235-
236-
## 📁 Complete File Structure
237-
238-
```
239-
traefik-log-dashboard/
240-
├── backend/
241-
│ ├── src/
242-
│ │ ├── index.js # Main backend server
243-
│ │ ├── logParser.js # Log parsing logic
244-
│ │ ├── geoLocation.js # IP geolocation
245-
│ │ └── websocket.js # WebSocket handler
246-
│ ├── package.json
247-
│ ├── Dockerfile
248-
│ └── Dockerfile.dev
249-
├── frontend/
250-
│ ├── src/
251-
│ │ ├── components/
252-
│ │ │ ├── Dashboard.tsx
253-
│ │ │ ├── LogTable.tsx
254-
│ │ │ ├── StatsCards.tsx
255-
│ │ │ ├── GeoMap.tsx
256-
│ │ │ └── ui/
257-
│ │ │ ├── badge.tsx
258-
│ │ │ ├── card.tsx
259-
│ │ │ └── table.tsx
260-
│ │ ├── hooks/
261-
│ │ │ └── useWebSocket.ts
262-
│ │ ├── lib/
263-
│ │ │ └── utils.ts
264-
│ │ ├── App.tsx
265-
│ │ ├── main.tsx
266-
│ │ └── index.css
267-
│ ├── package.json
268-
│ ├── tsconfig.json
269-
│ ├── tsconfig.node.json
270-
│ ├── vite.config.ts
271-
│ ├── tailwind.config.js
272-
│ ├── postcss.config.js
273-
│ ├── components.json
274-
│ ├── index.html
275-
│ ├── nginx.conf
276-
│ ├── Dockerfile
277-
│ └── Dockerfile.dev
278-
├── monitoring/
279-
│ ├── prometheus.yml
280-
│ └── grafana/
281-
├── scripts/
282-
│ └── generate-sample-logs.js
283-
├── .github/
284-
│ └── workflows/
285-
│ └── build-and-push.yml
286-
├── docker-compose.yml
287-
├── docker-compose.dev.yml
288-
├── docker-compose.prod.yml
289-
├── docker-compose.monitoring.yml
290-
├── Makefile
291-
├── setup.sh
292-
├── .env.example
293-
├── .gitignore
294-
├── traefik-sample.yml
295-
├── README.md
296-
├── DEPLOYMENT.md
297-
└── COMPLETE_SETUP_GUIDE.md
298-
```
299-
300-
## 🛠️ Manual Setup (if setup.sh doesn't work)
301194

302195
### Step 1: Create all directories
303196

@@ -329,7 +222,7 @@ docker-compose build
329222
docker-compose up -d
330223
```
331224

332-
## 🔧 Configuration Options
225+
## Configuration Options
333226

334227
### Environment Variables
335228

@@ -351,7 +244,7 @@ accessLog:
351244
format: json
352245
```
353246
354-
## 📊 Features Overview
247+
## Features Overview
355248
356249
### Real-time Monitoring
357250
- Live log streaming via WebSocket
@@ -373,7 +266,7 @@ accessLog:
373266
- Response time color coding
374267
- Request method badges
375268
376-
## 🐳 Docker Deployment Options
269+
## Docker Deployment Options
377270
378271
### Basic Deployment
379272
```bash
@@ -395,7 +288,7 @@ docker-compose -f docker-compose.yml -f docker-compose.prod.yml up -d
395288
docker-compose -f docker-compose.yml -f docker-compose.monitoring.yml up -d
396289
```
397290

398-
## 🧪 Testing
291+
## Testing
399292

400293
### Generate Sample Logs
401294
```bash
@@ -415,7 +308,7 @@ curl http://localhost:3001/health
415308
curl http://localhost:3000
416309
```
417310

418-
## 🔍 Troubleshooting
311+
## Troubleshooting
419312

420313
### Dashboard shows "No logs found"
421314

@@ -446,7 +339,7 @@ curl http://localhost:3000
446339
2. Add memory limits in `docker-compose.prod.yml`
447340
3. Enable log rotation in Traefik
448341

449-
## 🚀 Production Deployment
342+
## Production Deployment
450343

451344
### With SSL/TLS
452345

@@ -480,7 +373,7 @@ Access monitoring tools:
480373
- Prometheus: http://localhost:9090
481374
- Grafana: http://localhost:3001 (admin/admin)
482375
483-
## 📚 API Reference
376+
## API Reference
484377
485378
### REST Endpoints
486379
@@ -508,35 +401,14 @@ Connect to `ws://localhost:3001` and receive:
508401
- `stats` - Updated statistics
509402
- `logs` - Batch of logs
510403

511-
## 🤝 Contributing
512-
513-
1. Fork the repository
514-
2. Create feature branch: `git checkout -b feature/amazing-feature`
515-
3. Commit changes: `git commit -m 'Add amazing feature'`
516-
4. Push to branch: `git push origin feature/amazing-feature`
517-
5. Open Pull Request
518-
519-
## 📄 License
520-
521-
MIT License - feel free to use in personal and commercial projects.
522-
523-
## 🙏 Credits
524-
525-
- Built with React + TypeScript
526-
- UI components from Shadcn UI
527-
- Charts by Recharts
528-
- IP geolocation by ip-api.com
529-
- Icons by Lucide
530-
531-
---
532404

533405
For more help, create an issue on GitHub or check the logs:
534406
```bash
535407
docker-compose logs -f --tail=100
536408
```
537409
# Traefik Log Dashboard - Quick Reference
538410

539-
## 🚀 Quick Commands
411+
## Quick Commands
540412

541413
```bash
542414
# Start
@@ -585,7 +457,7 @@ curl http://localhost:3001/api/stats | jq .
585457
curl http://localhost:3001/api/logs?limit=10 | jq .
586458
```
587459

588-
## 🐳 Docker Commands
460+
## Docker Commands
589461

590462
```bash
591463
# View running containers
@@ -604,20 +476,20 @@ docker stats
604476
docker-compose down -v --rmi all
605477
```
606478

607-
## 📁 Important Files
479+
## Important Files
608480

609481
- `.env` - Configuration
610482
- `docker-compose.yml` - Service definitions
611483
- `backend/src/logParser.js` - Log parsing logic
612484
- `frontend/src/components/Dashboard.tsx` - Main UI
613485

614-
## 🌐 URLs
486+
## URLs
615487

616488
- Dashboard: http://localhost:3000
617489
- Backend API: http://localhost:3001
618490
- Health Check: http://localhost:3001/health
619491

620-
## 🛠️ Development
492+
## Development
621493

622494
```bash
623495
# Start dev mode with hot reload
@@ -630,7 +502,7 @@ node scripts/generate-sample-logs.js logs/traefik.log 100
630502
node scripts/generate-sample-logs.js logs/traefik.log 0 --continuous
631503
```
632504

633-
## 📈 Monitoring (Optional)
505+
## Monitoring (Optional)
634506

635507
```bash
636508
# Start with monitoring
@@ -642,4 +514,26 @@ docker-compose -f docker-compose.yml -f docker-compose.monitoring.yml up -d
642514
```
643515

644516
---
645-
Need help? Check logs first: `docker-compose logs -f`
517+
Need help? Check logs first: `docker-compose logs -f`
518+
519+
## Contributing
520+
521+
1. Fork the repository
522+
2. Create feature branch: `git checkout -b feature/amazing-feature`
523+
3. Commit changes: `git commit -m 'Add amazing feature'`
524+
4. Push to branch: `git push origin feature/amazing-feature`
525+
5. Open Pull Request
526+
527+
## License
528+
529+
MIT License - feel free to use in personal and commercial projects.
530+
531+
## Credits
532+
533+
- Built with React + TypeScript
534+
- UI components from Shadcn UI
535+
- Charts by Recharts
536+
- IP geolocation by ip-api.com
537+
- Icons by Lucide
538+
539+
---

scripts/dashboard.png

815 KB
Loading

0 commit comments

Comments
 (0)