A FastAPI application for Roasis blockchain project with XRPL wallet authentication.
- 🚀 FastAPI - Modern, fast web framework
- 🔐 XRPL Wallet Auth - Signature-based authentication
- 🗄️ PostgreSQL - Robust database with SQLAlchemy ORM
- 🐳 Docker - Containerized deployment
- 🔒 Nginx - Reverse proxy with SSL support
- 📝 Auto Documentation - Interactive API docs
- 🧹 Code Quality - Pre-commit hooks with linting
- Clone and start the application:
git clone [email protected]:roasis/backend.git
cd backend
docker-compose up- Access the application:
- API: http://localhost (via Nginx proxy)
- Direct API: http://localhost:8000
- API Documentation: http://localhost:8000/docs
- ReDoc: http://localhost:8000/redoc
- Python 3.12+
- uv package manager
- Docker & Docker Compose
- Install uv (if not already installed):
curl -LsSf https://astral.sh/uv/install.sh | sh- Install dependencies:
uv sync --dev- Set up pre-commit hooks:
uv run pre-commit install- GET
/- Welcome message - GET
/health- Health check with database status
# Create new migration
uv run alembic revision --autogenerate -m "Description"
# Apply migrations
uv run alembic upgrade head
# Rollback migration
uv run alembic downgrade -1Automatically run on every commit:
- Black - Code formatting
- isort - Import sorting
- flake8 - Linting
- mypy - Type checking
# Format code
uv run black .
uv run isort .
# Lint code
uv run flake8 .
uv run mypy .
# Run all pre-commit hooks
uv run pre-commit run --all-files# Deploy with Nginx, PostgreSQL, and SSL
./deploy.sh# Start all services
docker-compose up
# Start specific service
docker-compose up postgres
# View logs
docker-compose logs -f backendCopy .env.example to .env and configure:
cp .env.example .env
# Edit .env with your settings- FastAPI - Modern Python web framework
- SQLAlchemy - SQL toolkit and ORM
- PostgreSQL - Relational database
- Alembic - Database migration tool
- XRPL-py - XRP Ledger Python library
- PyJWT - JSON Web Token implementation
- Pydantic - Data validation using Python type hints
- Docker - Containerization
- Nginx - Web server and reverse proxy
- uv - Fast Python package manager
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Install dev dependencies:
uv sync --dev - Set up pre-commit:
uv run pre-commit install - Make your changes
- Run tests:
uv run pytest - Commit your changes:
git commit -m 'Add amazing feature' - Push to the branch:
git push origin feature/amazing-feature - Open a Pull Request
See LICENSE file for details.