Skip to content

Commit 64bb252

Browse files
committed
clean
1 parent 979315b commit 64bb252

File tree

8 files changed

+27
-1074
lines changed

8 files changed

+27
-1074
lines changed

DOCKER.md

Lines changed: 0 additions & 175 deletions
This file was deleted.

README.md

Lines changed: 0 additions & 139 deletions
Original file line numberDiff line numberDiff line change
@@ -2,142 +2,3 @@
22

33
Wiki statistics tracker and Archive.org backup status checker.
44

5-
## Features
6-
7-
- 📊 Track MediaWiki site statistics over time
8-
- 📦 Check Archive.org for existing backups
9-
- 🚀 Fast API built with FastAPI + httpx
10-
- 💾 MongoDB + Beanie ODM
11-
- 📝 Comprehensive logging with loguru
12-
- ⚡ Managed with uv for lightning-fast dependency management
13-
14-
## Quick Start
15-
16-
### Development
17-
18-
```bash
19-
# Install uv (if not already installed)
20-
curl -LsSf https://astral.sh/uv/install.sh | sh
21-
22-
# Install dependencies
23-
uv sync
24-
25-
# Copy environment file
26-
cp .env.example .env
27-
28-
# Start MongoDB (Docker)
29-
docker-compose up -d mongodb
30-
31-
# Run development server
32-
uv run python -m wikikeeper.app.main
33-
34-
# API will be available at http://localhost:8000
35-
# API docs at http://localhost:8000/docs
36-
```
37-
38-
### Production (Docker)
39-
40-
```bash
41-
# Build and start all services
42-
docker-compose up -d
43-
44-
# View logs
45-
docker-compose logs -f
46-
47-
# Stop services
48-
docker-compose down
49-
```
50-
51-
## Requirements
52-
53-
- Python 3.13+
54-
- MongoDB 8+
55-
- uv (package manager)
56-
57-
## API Endpoints
58-
59-
- `GET /` - API info
60-
- `GET /health` - Health check
61-
- `GET /api/wikis` - List wikis
62-
- `POST /api/wikis` - Add new wiki
63-
- `GET /api/wikis/{id}` - Get wiki details
64-
- `POST /api/wikis/{id}/check` - Trigger stats collection
65-
- `GET /api/wikis/{id}/stats` - Get historical stats
66-
- `GET /api/wikis/{id}/archives` - Get archive info
67-
- `POST /api/wikis/{id}/check-archive` - Check Archive.org
68-
- `GET /api/stats/summary` - Overall statistics
69-
70-
## Architecture
71-
72-
```
73-
wikikeeper/
74-
├── src/wikikeeper/
75-
│ ├── app/ # FastAPI application
76-
│ ├── core/ # Config, exceptions, logging
77-
│ ├── db/ # Database connection
78-
│ ├── models/ # Beanie ODM models
79-
│ └── services/ # Business logic
80-
│ ├── mediawiki.py # MediaWiki API client (httpx)
81-
│ ├── archive_checker.py # Archive.org checker
82-
│ └── collector.py # Data collector
83-
├── tests/ # Unit tests
84-
├── logs/ # Application logs
85-
└── docker-compose.yml
86-
```
87-
88-
## Implementation Notes
89-
90-
### MediaWiki API Client
91-
- Uses **httpx** (async) instead of requests
92-
- Fetches siteinfo (statistics + general info)
93-
- Reference: wikiteam3 implementation (not used as dependency)
94-
- API: https://www.mediawiki.org/wiki/API:Siteinfo
95-
96-
### Archive.org Checker
97-
- Uses **internetarchive** library for search
98-
- Uses **httpx** for metadata fetching
99-
- Reference: wikiapiary-wikiteam-bot (not used as dependency)
100-
- Docs: https://archive.org/help/aboutsearch.htm
101-
102-
### Database
103-
- MongoDB with Beanie ODM
104-
- Time-series data for statistics
105-
- Separate collection for Archive.org metadata
106-
107-
## Development
108-
109-
```bash
110-
# Install dependencies
111-
uv sync
112-
113-
# Run with dev dependencies
114-
uv sync --dev
115-
116-
# Run tests
117-
uv run pytest
118-
119-
# Run with coverage
120-
uv run pytest --cov=wikikeeper --cov-report=html
121-
122-
# Type checking
123-
uv run mypy src/
124-
125-
# Linting
126-
uv run ruff check src/
127-
128-
# Format code
129-
uv run ruff format src/
130-
```
131-
132-
## Migration from pdm
133-
134-
This project was migrated from pdm to uv for better performance and compatibility:
135-
136-
- Removed pdm.lock, .venv, and pdm-specific files
137-
- Updated build backend from pdm to hatchling
138-
- Updated Python version to 3.13
139-
- All commands now use `uv` instead of `pdm`
140-
141-
## License
142-
143-
AGPL-3.0-or-later

backend/go.mod

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ require (
88
github.com/labstack/echo/v4 v4.14.0
99
github.com/prometheus/client_golang v1.23.2
1010
github.com/stretchr/testify v1.11.1
11-
go.mongodb.org/mongo-driver v1.17.6
1211
gorm.io/driver/postgres v1.6.0
1312
gorm.io/driver/sqlite v1.6.0
1413
gorm.io/gorm v1.31.1
@@ -18,20 +17,17 @@ require (
1817
github.com/beorn7/perks v1.0.1 // indirect
1918
github.com/cespare/xxhash/v2 v2.3.0 // indirect
2019
github.com/davecgh/go-spew v1.1.1 // indirect
21-
github.com/golang/snappy v0.0.4 // indirect
2220
github.com/jackc/pgpassfile v1.0.0 // indirect
2321
github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 // indirect
2422
github.com/jackc/pgx/v5 v5.6.0 // indirect
2523
github.com/jackc/puddle/v2 v2.2.2 // indirect
2624
github.com/jinzhu/inflection v1.0.0 // indirect
2725
github.com/jinzhu/now v1.1.5 // indirect
28-
github.com/klauspost/compress v1.18.0 // indirect
2926
github.com/kr/text v0.2.0 // indirect
3027
github.com/labstack/gommon v0.4.2 // indirect
3128
github.com/mattn/go-colorable v0.1.14 // indirect
3229
github.com/mattn/go-isatty v0.0.20 // indirect
3330
github.com/mattn/go-sqlite3 v1.14.22 // indirect
34-
github.com/montanaflynn/stats v0.7.1 // indirect
3531
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
3632
github.com/pmezard/go-difflib v1.0.0 // indirect
3733
github.com/prometheus/client_model v0.6.2 // indirect
@@ -40,10 +36,6 @@ require (
4036
github.com/rogpeppe/go-internal v1.14.1 // indirect
4137
github.com/valyala/bytebufferpool v1.0.0 // indirect
4238
github.com/valyala/fasttemplate v1.2.2 // indirect
43-
github.com/xdg-go/pbkdf2 v1.0.0 // indirect
44-
github.com/xdg-go/scram v1.1.2 // indirect
45-
github.com/xdg-go/stringprep v1.0.4 // indirect
46-
github.com/youmark/pkcs8 v0.0.0-20240726163527-a2c0da244d78 // indirect
4739
go.yaml.in/yaml/v2 v2.4.2 // indirect
4840
golang.org/x/crypto v0.46.0 // indirect
4941
golang.org/x/net v0.48.0 // indirect

0 commit comments

Comments
 (0)