Compare commits
3
Commits
055dd3b43b
...
aecc0731bc
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
aecc0731bc | ||
|
|
751af50e8a | ||
|
|
005ac8634f |
@@ -13,5 +13,7 @@ wheels/
|
||||
*.sqlite
|
||||
*.duckdb
|
||||
*.db
|
||||
*.log
|
||||
*.gz
|
||||
|
||||
.vscode/*
|
||||
@@ -0,0 +1,17 @@
|
||||
# Changelog
|
||||
|
||||
All notable changes to the Eurovision-25 backend will be documented in this file.
|
||||
|
||||
## [1.0rc1] - 2025-05-10
|
||||
|
||||
### First Release Candidate
|
||||
|
||||
This is the first release candidate for Eurovision-25 backend, featuring all core functionality:
|
||||
|
||||
- Authentication and user management
|
||||
- Song management and reviews
|
||||
- Results calculation and display
|
||||
- Admin functionality
|
||||
- Static file serving for avatars and country flags
|
||||
|
||||
The application is now feature complete, but may still contain bugs that will be addressed before the final 1.0.0 release.
|
||||
+2
-1
@@ -1,6 +1,6 @@
|
||||
[project]
|
||||
name = "Eurovision-25-backend"
|
||||
version = "0.1.0"
|
||||
version = "1.0rc1"
|
||||
description = "Backend for Eurovision 25"
|
||||
readme = "README.md"
|
||||
requires-python = ">=3.12"
|
||||
@@ -8,6 +8,7 @@ dependencies = [
|
||||
"aiofiles>=24.1.0",
|
||||
"duckdb>=1.2.2",
|
||||
"fastapi>=0.115.12",
|
||||
"loguru>=0.7.3",
|
||||
"pandas>=2.2.3",
|
||||
"passlib[bcrypt]>=1.7.4",
|
||||
"python-dotenv>=1.1.0",
|
||||
|
||||
+4
-1
@@ -5,13 +5,14 @@ from fastapi.staticfiles import StaticFiles
|
||||
# Import routers
|
||||
from routes import auth, admin, users, songs, reviews, results
|
||||
|
||||
from lib.logger import logger
|
||||
from lib.db import init_db
|
||||
|
||||
# Initialize FastAPI app
|
||||
app = FastAPI(
|
||||
title="Eurovision 25 Homereview API",
|
||||
description="Backend API for Eurovision 25 Homereview application",
|
||||
version="1.0.0",
|
||||
version="1.0rc1",
|
||||
)
|
||||
|
||||
# Add CORS middleware
|
||||
@@ -32,12 +33,14 @@ app.mount("/static/flags", StaticFiles(directory="static/flags"), name="flags")
|
||||
# Startup event to create database tables
|
||||
@app.on_event("startup")
|
||||
def on_startup():
|
||||
logger.info("Starting up...")
|
||||
init_db()
|
||||
|
||||
|
||||
# Health check endpoint
|
||||
@app.get("/")
|
||||
async def root():
|
||||
logger.debug("Root endpoint accessed")
|
||||
return {"status": "ok", "message": "Eurovision 25 Homereview API"}
|
||||
|
||||
|
||||
|
||||
+2
-4
@@ -75,12 +75,10 @@ def seed_db() -> None:
|
||||
|
||||
|
||||
def init_db():
|
||||
if Path(DB_PATH).exists():
|
||||
return
|
||||
with open(SQL_PATH, "r") as f:
|
||||
sql = f.read()
|
||||
with get_connection() as conn:
|
||||
conn.execute(sql)
|
||||
seed_db()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
init_db()
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
from loguru import logger
|
||||
from pathlib import Path
|
||||
import sys
|
||||
|
||||
LOG_PATH = Path("./data/logs/logs.log").absolute()
|
||||
ERROR_PATH = Path("./data/logs/errors.log").absolute()
|
||||
|
||||
logger.remove()
|
||||
logger.add(LOG_PATH, rotation="10 MB", compression="gz", level="INFO")
|
||||
logger.add(sys.stdout, level="INFO")
|
||||
|
||||
logger.add(ERROR_PATH, rotation="10 MB", compression="gz", level="ERROR")
|
||||
logger.add(sys.stderr, level="ERROR")
|
||||
logger.add(sys.stdout, level="DEBUG")
|
||||
|
||||
logger = logger
|
||||
@@ -137,6 +137,7 @@ dependencies = [
|
||||
{ name = "aiofiles" },
|
||||
{ name = "duckdb" },
|
||||
{ name = "fastapi" },
|
||||
{ name = "loguru" },
|
||||
{ name = "pandas" },
|
||||
{ name = "passlib", extra = ["bcrypt"] },
|
||||
{ name = "python-dotenv" },
|
||||
@@ -154,6 +155,7 @@ requires-dist = [
|
||||
{ name = "aiofiles", specifier = ">=24.1.0" },
|
||||
{ name = "duckdb", specifier = ">=1.2.2" },
|
||||
{ name = "fastapi", specifier = ">=0.115.12" },
|
||||
{ name = "loguru", specifier = ">=0.7.3" },
|
||||
{ name = "pandas", specifier = ">=2.2.3" },
|
||||
{ name = "passlib", extras = ["bcrypt"], specifier = ">=1.7.4" },
|
||||
{ name = "python-dotenv", specifier = ">=1.1.0" },
|
||||
@@ -218,6 +220,19 @@ wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/76/c6/c88e154df9c4e1a2a66ccf0005a88dfb2650c1dffb6f5ce603dfbd452ce3/idna-3.10-py3-none-any.whl", hash = "sha256:946d195a0d259cbba61165e88e65941f16e9b36ea6ddb97f00452bae8b1287d3", size = 70442, upload-time = "2024-09-15T18:07:37.964Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "loguru"
|
||||
version = "0.7.3"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
dependencies = [
|
||||
{ name = "colorama", marker = "sys_platform == 'win32'" },
|
||||
{ name = "win32-setctime", marker = "sys_platform == 'win32'" },
|
||||
]
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/3a/05/a1dae3dffd1116099471c643b8924f5aa6524411dc6c63fdae648c4f1aca/loguru-0.7.3.tar.gz", hash = "sha256:19480589e77d47b8d85b2c827ad95d49bf31b0dcde16593892eb51dd18706eb6", size = 63559, upload-time = "2024-12-06T11:20:56.608Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/0c/29/0348de65b8cc732daa3e33e67806420b2ae89bdce2b04af740289c5c6c8c/loguru-0.7.3-py3-none-any.whl", hash = "sha256:31a33c10c8e1e10422bfd431aeb5d351c7cf7fa671e3c4df004162264b28220c", size = 61595, upload-time = "2024-12-06T11:20:54.538Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "markdown-it-py"
|
||||
version = "3.0.0"
|
||||
@@ -639,3 +654,12 @@ wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/1b/6c/c65773d6cab416a64d191d6ee8a8b1c68a09970ea6909d16965d26bfed1e/websockets-15.0.1-cp313-cp313-win_amd64.whl", hash = "sha256:e09473f095a819042ecb2ab9465aee615bd9c2028e4ef7d933600a8401c79561", size = 176837, upload-time = "2025-03-05T20:02:55.237Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/fa/a8/5b41e0da817d64113292ab1f8247140aac61cbf6cfd085d6a0fa77f4984f/websockets-15.0.1-py3-none-any.whl", hash = "sha256:f7a866fbc1e97b5c617ee4116daaa09b722101d4a3c170c787450ba409f9736f", size = 169743, upload-time = "2025-03-05T20:03:39.41Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "win32-setctime"
|
||||
version = "1.2.0"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/b3/8f/705086c9d734d3b663af0e9bb3d4de6578d08f46b1b101c2442fd9aecaa2/win32_setctime-1.2.0.tar.gz", hash = "sha256:ae1fdf948f5640aae05c511ade119313fb6a30d7eabe25fef9764dca5873c4c0", size = 4867, upload-time = "2024-12-07T15:28:28.314Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/e1/07/c6fe3ad3e685340704d314d765b7912993bcb8dc198f0e7a89382d37974b/win32_setctime-1.2.0-py3-none-any.whl", hash = "sha256:95d644c4e708aba81dc3704a116d8cbc974d70b3bdb8be1d150e36be6e9d1390", size = 4083, upload-time = "2024-12-07T15:28:26.465Z" },
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user