docs: add comprehensive README and update .gitignore
This commit is contained in:
+58
-9
@@ -1,18 +1,67 @@
|
|||||||
# Dependencies
|
# Python
|
||||||
frontend/node_modules/
|
__pycache__/
|
||||||
frontend/package-lock.json
|
*.py[cod]
|
||||||
|
*$py.class
|
||||||
|
*.so
|
||||||
|
.Python
|
||||||
|
build/
|
||||||
|
develop-eggs/
|
||||||
|
dist/
|
||||||
|
downloads/
|
||||||
|
eggs/
|
||||||
|
.eggs/
|
||||||
|
lib/
|
||||||
|
lib64/
|
||||||
|
parts/
|
||||||
|
sdist/
|
||||||
|
var/
|
||||||
|
wheels/
|
||||||
|
*.egg-info/
|
||||||
|
.installed.cfg
|
||||||
|
*.egg
|
||||||
|
|
||||||
# Build output
|
# Virtual environments
|
||||||
frontend/dist/
|
venv/
|
||||||
|
.venv/
|
||||||
# Environment files
|
env/
|
||||||
.env
|
ENV/
|
||||||
.env.local
|
|
||||||
|
|
||||||
# IDE
|
# IDE
|
||||||
.vscode/
|
.vscode/
|
||||||
.idea/
|
.idea/
|
||||||
|
*.swp
|
||||||
|
*.swo
|
||||||
|
*~
|
||||||
|
|
||||||
# OS
|
# OS
|
||||||
.DS_Store
|
.DS_Store
|
||||||
Thumbs.db
|
Thumbs.db
|
||||||
|
|
||||||
|
# Environment files
|
||||||
|
.env
|
||||||
|
.env.local
|
||||||
|
.env.*.local
|
||||||
|
|
||||||
|
# Database
|
||||||
|
*.db
|
||||||
|
*.sqlite
|
||||||
|
*.sqlite3
|
||||||
|
|
||||||
|
# Frontend
|
||||||
|
frontend/node_modules/
|
||||||
|
frontend/dist/
|
||||||
|
frontend/package-lock.json
|
||||||
|
frontend/yarn.lock
|
||||||
|
frontend/pnpm-lock.yaml
|
||||||
|
|
||||||
|
# Logs
|
||||||
|
*.log
|
||||||
|
logs/
|
||||||
|
|
||||||
|
# Testing
|
||||||
|
.pytest_cache/
|
||||||
|
.coverage
|
||||||
|
htmlcov/
|
||||||
|
|
||||||
|
# Backup tool specific
|
||||||
|
backups/
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user