feat(v2): complete v2 reimplementation
This commit is contained in:
@@ -4,7 +4,7 @@ A modern backup management application with a FastAPI backend and React frontend
|
||||
|
||||
## Features
|
||||
|
||||
- **Multiple Source Types**: Local filesystem, SSH/SFTP, and database (PostgreSQL, MySQL)
|
||||
- **Source Type**: Local filesystem
|
||||
- **Backup Strategies**: Full and incremental backups
|
||||
- **Scheduled Backups**: Cron-based scheduling with APScheduler
|
||||
- **Retention Policies**: Count-based and days-based backup retention
|
||||
@@ -22,7 +22,7 @@ backup-tool/
|
||||
│ │ ├── schemas.py # Pydantic schemas
|
||||
│ │ └── main.py # Application entry point
|
||||
│ ├── backup/ # Backup engine
|
||||
│ │ ├── adapters/ # Source adapters (local, SSH, database)
|
||||
│ │ ├── adapters/ # Local source adapter
|
||||
│ │ ├── engine.py # Backup execution engine
|
||||
│ │ ├── scheduler.py # Job scheduler
|
||||
│ │ └── retention.py # Retention policies
|
||||
@@ -51,9 +51,10 @@ docker compose --profile dev up -d
|
||||
```
|
||||
|
||||
Access the application:
|
||||
- Backend API: http://localhost:8000
|
||||
- Frontend: http://localhost:3000
|
||||
- API Docs: http://localhost:8000/docs
|
||||
|
||||
- Backend API: <http://localhost:8000>
|
||||
- Frontend: <http://localhost:3000>
|
||||
- API Docs: <http://localhost:8000/docs>
|
||||
|
||||
### Option 2: Manual Setup
|
||||
|
||||
@@ -96,15 +97,16 @@ 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
|
||||
|
||||
- Swagger UI: <http://localhost:8000/docs>
|
||||
- ReDoc: <http://localhost:8000/redoc>
|
||||
|
||||
## Configuration
|
||||
|
||||
### Environment Variables
|
||||
|
||||
| Variable | Description | Default |
|
||||
|----------|-------------|---------|
|
||||
| ---------- | ------------- | --------- |
|
||||
| `DATABASE_URL` | Database connection string | `sqlite+aiosqlite:///./backup_tool.db` |
|
||||
| `CORS_ORIGINS` | Comma-separated allowed CORS origins | `http://localhost:3000` |
|
||||
| `SQL_ECHO` | Enable SQL query logging | `false` |
|
||||
@@ -113,17 +115,20 @@ Once the backend is running, visit:
|
||||
### Docker-Specific Configuration
|
||||
|
||||
When running with Docker Compose, the following volumes are mounted:
|
||||
|
||||
- `backup-data`: Persisted SQLite database at `/app/data`
|
||||
- `backup-storage`: Backup files at `/app/backups`
|
||||
|
||||
### Development vs Production
|
||||
|
||||
**Development Mode** (`docker compose --profile dev up -d`):
|
||||
|
||||
- Backend hot reload enabled
|
||||
- Frontend Vite dev server with HMR
|
||||
- Source code mounted as volumes
|
||||
|
||||
**Production Mode** (`docker compose --profile prod up -d`):
|
||||
|
||||
- Optimized frontend build served via nginx
|
||||
- Backend without reload
|
||||
- Static assets compiled
|
||||
@@ -133,6 +138,7 @@ When running with Docker Compose, the following volumes are mounted:
|
||||
### Docker Issues
|
||||
|
||||
**Port already in use**
|
||||
|
||||
```bash
|
||||
# Check what's using port 8000
|
||||
lsof -i :8000
|
||||
@@ -141,6 +147,7 @@ lsof -i :8000
|
||||
```
|
||||
|
||||
**Container fails to start**
|
||||
|
||||
```bash
|
||||
# Check logs
|
||||
docker logs backup-tool-backend
|
||||
@@ -150,6 +157,7 @@ docker compose build --no-cache
|
||||
```
|
||||
|
||||
**Permission denied on data directory**
|
||||
|
||||
```bash
|
||||
# Fix permissions
|
||||
docker compose exec backend chown -R backup-tool:backup-tool /app/data
|
||||
@@ -157,6 +165,7 @@ docker compose exec backend chown -R backup-tool:backup-tool /app/data
|
||||
|
||||
**Tests fail in Docker**
|
||||
Tests require development dependencies. Install with:
|
||||
|
||||
```bash
|
||||
docker compose exec backend pip install -e ".[dev]"
|
||||
```
|
||||
@@ -165,11 +174,13 @@ docker compose exec backend pip install -e ".[dev]"
|
||||
|
||||
**Python version incompatibility**
|
||||
Ensure Python 3.11+ is installed:
|
||||
|
||||
```bash
|
||||
python --version
|
||||
```
|
||||
|
||||
**Node modules conflicts**
|
||||
|
||||
```bash
|
||||
cd frontend
|
||||
rm -rf node_modules package-lock.json
|
||||
@@ -182,7 +193,7 @@ npm install
|
||||
|
||||
1. Clone the repository
|
||||
2. Run `docker compose --profile prod up -d`
|
||||
3. Access at http://localhost:3000
|
||||
3. Access at <http://localhost:3000>
|
||||
|
||||
### Manual Deployment
|
||||
|
||||
|
||||
Reference in New Issue
Block a user