
Features implemented: - User authentication with JWT tokens and role-based access (developer/buyer) - Blockchain wallet linking and management with Ethereum integration - Carbon project creation and management for developers - Marketplace for browsing and purchasing carbon offsets - Transaction tracking with blockchain integration - Database models for users, projects, offsets, and transactions - Comprehensive API with authentication, wallet, project, and trading endpoints - Health check endpoint and platform information - SQLite database with Alembic migrations - Full API documentation with OpenAPI/Swagger Technical stack: - FastAPI with Python - SQLAlchemy ORM with SQLite - Web3.py for blockchain integration - JWT authentication with bcrypt - CORS enabled for frontend integration - Comprehensive error handling and validation Environment variables required: - SECRET_KEY (JWT secret) - BLOCKCHAIN_RPC_URL (optional, defaults to localhost)
59 lines
1.7 KiB
JSON
59 lines
1.7 KiB
JSON
{
|
|
"openapi": "3.1.0",
|
|
"info": {
|
|
"title": "Carbon Offset Trading Platform API",
|
|
"description": "A blockchain-enabled platform for trading carbon offsets between project developers and buyers",
|
|
"version": "1.0.0"
|
|
},
|
|
"paths": {
|
|
"/": {
|
|
"get": {
|
|
"summary": "Root endpoint",
|
|
"description": "Returns platform information and available endpoints",
|
|
"responses": {
|
|
"200": {
|
|
"description": "Platform information",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"title": {"type": "string"},
|
|
"description": {"type": "string"},
|
|
"version": {"type": "string"},
|
|
"documentation": {"type": "string"},
|
|
"health_check": {"type": "string"}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/health": {
|
|
"get": {
|
|
"summary": "Health check endpoint",
|
|
"description": "Returns the health status of the application and its dependencies",
|
|
"responses": {
|
|
"200": {
|
|
"description": "Health status information",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"status": {"type": "string"},
|
|
"database": {"type": "string"},
|
|
"environment": {"type": "string"},
|
|
"version": {"type": "string"}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} |