docs: add comprehensive README and update .gitignore

This commit is contained in:
2026-05-11 22:05:03 +02:00
parent 1978602da6
commit abeb64637e
2 changed files with 163 additions and 10 deletions
+105 -1
View File
@@ -1,2 +1,106 @@
# backup-tool
# Backup Tool
A modern backup management application with a FastAPI backend and React frontend.
## Features
- **Multiple Source Types**: Local filesystem, SSH/SFTP, and database (PostgreSQL, MySQL)
- **Backup Strategies**: Full and incremental backups
- **Scheduled Backups**: Cron-based scheduling with APScheduler
- **Retention Policies**: Count-based and days-based backup retention
- **Web Dashboard**: React-based UI for managing backups
- **REST API**: Full REST API for programmatic access
## Architecture
```
backup-tool/
├── backend/ # FastAPI backend
│ ├── app/ # FastAPI application
│ │ ├── routers/ # API endpoints
│ │ ├── models.py # SQLAlchemy models
│ │ ├── schemas.py # Pydantic schemas
│ │ └── main.py # Application entry point
│ ├── backup/ # Backup engine
│ │ ├── adapters/ # Source adapters (local, SSH, database)
│ │ ├── engine.py # Backup execution engine
│ │ ├── scheduler.py # Job scheduler
│ │ └── retention.py # Retention policies
│ └── requirements.txt # Python dependencies
├── frontend/ # React frontend
│ ├── src/ # Source code
│ └── package.json # Node dependencies
└── docs/ # Documentation
```
## Quick Start
### Prerequisites
- Python 3.11+
- Node.js 18+
- PostgreSQL or MySQL (for database backups)
### Backend Setup
```bash
cd backend
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -r requirements.txt
# Run the server
uvicorn app.main:app --reload --port 8000
```
### Frontend Setup
```bash
cd frontend
npm install
npm run dev
```
### Production Build
```bash
cd frontend
npm run build
cd ../backend
uvicorn app.main:app --host 0.0.0.0 --port 8000
```
## API Documentation
Once the backend is running, visit:
- Swagger UI: http://localhost:8000/docs
- ReDoc: http://localhost:8000/redoc
## Configuration
Environment variables:
- `DATABASE_URL`: Database connection string (default: sqlite+aiosqlite:///./backup_tool.db)
- `CORS_ORIGINS`: Comma-separated list of allowed CORS origins
- `SQL_ECHO`: Enable SQL query logging (true/false)
## Development
### Running Tests
```bash
cd backend
pytest
```
### Database Migrations
```bash
cd backend
alembic revision --autogenerate -m "Description"
alembic upgrade head
```
## License
MIT