Famous people: admin page, own prompt, one photo, public pages
- Admin "Híres emberek": birth data, one photo (S3: DigitalOcean Spaces in production, RustFS in development), a face point that every crop keeps in view, publishing, and a detailed portrait written with its own `celebrity` prompt (third person, by name, from the chart alone). - The photo is stored once (upright JPEG, at most 2000 px, no metadata); next/image makes the sizes from it, so Cloudflare can cache those. - Public list and pages (/hires-emberek), in the sitemap, with a share image showing the face and the chart. - Share images: the wheel's glyphs and numbers are drawn with the card's fonts (inside the SVG image they came out as boxes, on every card). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012vLHzh5qUhFtmJhzkcTbXL
This commit is contained in:
@@ -10,6 +10,7 @@ mod admin;
|
||||
mod analyses;
|
||||
mod auth;
|
||||
mod calculator;
|
||||
mod celebrities;
|
||||
mod charts;
|
||||
mod errors;
|
||||
mod forecasts;
|
||||
@@ -30,7 +31,7 @@ pub use recalculate::run as recalculate;
|
||||
|
||||
use std::sync::Arc;
|
||||
|
||||
use axum::extract::{Path, State};
|
||||
use axum::extract::{DefaultBodyLimit, Path, State};
|
||||
use axum::http::{HeaderValue, Method, header};
|
||||
use axum::routing::{delete, get, patch, post};
|
||||
use axum::{Json, Router};
|
||||
@@ -129,6 +130,9 @@ pub fn router(state: Arc<AppState>) -> Router {
|
||||
.route("/v1/public/chart", post(calculator::chart))
|
||||
.route("/v1/public/geo/countries", get(calculator::countries))
|
||||
.route("/v1/public/geo/places", get(calculator::places))
|
||||
.route("/v1/public/celebrities", get(celebrities::public_list))
|
||||
.route("/v1/public/celebrities/{slug}", get(celebrities::public_view))
|
||||
.route("/v1/public/photos/{*key}", get(celebrities::photo))
|
||||
// administration
|
||||
.route("/v1/admin/users", get(admin::list_users))
|
||||
.route("/v1/admin/users/{id}", patch(admin::update_user))
|
||||
@@ -150,6 +154,18 @@ pub fn router(state: Arc<AppState>) -> Router {
|
||||
.route("/v1/admin/models/catalog", get(models::catalog))
|
||||
.route("/v1/admin/models/{kind}", axum::routing::put(models::save))
|
||||
.route("/v1/admin/analyses/{id}/regenerate", post(analyses::regenerate))
|
||||
.route("/v1/admin/celebrities", get(celebrities::list).post(celebrities::create))
|
||||
.route(
|
||||
"/v1/admin/celebrities/{id}",
|
||||
get(celebrities::get_one).patch(celebrities::update).delete(celebrities::remove),
|
||||
)
|
||||
.route("/v1/admin/celebrities/{id}/analysis", post(celebrities::request_analysis))
|
||||
.route(
|
||||
"/v1/admin/celebrities/{id}/photo",
|
||||
axum::routing::put(celebrities::upload_photo)
|
||||
.delete(celebrities::remove_photo)
|
||||
.layer(DefaultBodyLimit::max(crate::photo::MAX_UPLOAD + 1024)),
|
||||
)
|
||||
.route("/v1/admin/questions/{id}/regenerate", post(questions::regenerate))
|
||||
.layer(cors(&state.config.cors_allowed_origins))
|
||||
// The request log: masked paths, health checks only when they fail.
|
||||
|
||||
Reference in New Issue
Block a user