mirror of
https://github.com/Xevion/xevion.dev.git
synced 2026-01-31 00:26:31 -06:00
add tag colors to seed data and reverse tag order in project cards
- Add color parameter to seed tags (Rust red, Python blue, etc.) - Reverse tag display order in ProjectCard (flex-row-reverse) - Enable release binary stripping in Cargo.toml - Increase Railway health check timeout to 120s - Remove backup favicon/icon files
This commit is contained in:
+4
-3
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"db_name": "PostgreSQL",
|
||||
"query": "\n INSERT INTO tags (slug, name, icon)\n VALUES ($1, $2, $3)\n RETURNING id\n ",
|
||||
"query": "\n INSERT INTO tags (slug, name, icon, color)\n VALUES ($1, $2, $3, $4)\n RETURNING id\n ",
|
||||
"describe": {
|
||||
"columns": [
|
||||
{
|
||||
@@ -13,12 +13,13 @@
|
||||
"Left": [
|
||||
"Text",
|
||||
"Text",
|
||||
"Text"
|
||||
"Text",
|
||||
"Varchar"
|
||||
]
|
||||
},
|
||||
"nullable": [
|
||||
false
|
||||
]
|
||||
},
|
||||
"hash": "1a6f4d858c200757c1d25c22279ef0a6eb8589bb6dff47afe1554850c1bead57"
|
||||
"hash": "907e578fc43797b82c254fa3db3d976597f6deb761837d616d50aa93e9caef60"
|
||||
}
|
||||
@@ -37,3 +37,6 @@ tracing-subscriber = { version = "0.3.22", features = ["env-filter", "json"] }
|
||||
ulid = { version = "1", features = ["serde"] }
|
||||
urlencoding = "2.1"
|
||||
uuid = { version = "1", features = ["serde", "v4"] }
|
||||
|
||||
[profile.release]
|
||||
strip = true
|
||||
|
||||
+2
-4
@@ -28,8 +28,7 @@ COPY src/ ./src/
|
||||
RUN mkdir -p web/build/client && \
|
||||
echo "placeholder" > web/build/client/.gitkeep
|
||||
|
||||
RUN cargo build --release && \
|
||||
strip target/release/xevion
|
||||
RUN cargo build --release
|
||||
|
||||
# ========== Stage 4: Frontend Builder ==========
|
||||
FROM oven/bun:1 AS frontend
|
||||
@@ -65,8 +64,7 @@ COPY --from=frontend /build/build/prerendered ./web/build/prerendered
|
||||
|
||||
# Build with real assets (use sqlx offline mode)
|
||||
ENV SQLX_OFFLINE=true
|
||||
RUN cargo build --release && \
|
||||
strip target/release/xevion
|
||||
RUN cargo build --release
|
||||
|
||||
# ========== Stage 6: Runtime ==========
|
||||
FROM oven/bun:1-alpine AS runtime
|
||||
|
||||
+1
-1
@@ -2,6 +2,6 @@
|
||||
"$schema": "https://railway.com/railway.schema.json",
|
||||
"deploy": {
|
||||
"healthcheckPath": "/api/health",
|
||||
"healthcheckTimeout": 30
|
||||
"healthcheckTimeout": 120
|
||||
}
|
||||
}
|
||||
|
||||
+32
-16
@@ -90,32 +90,48 @@ pub async fn run(pool: &PgPool) -> Result<(), Box<dyn std::error::Error>> {
|
||||
|
||||
// Seed tags
|
||||
let tags = vec![
|
||||
("rust", "Rust", "simple-icons:rust"),
|
||||
("python", "Python", "simple-icons:python"),
|
||||
("typescript", "TypeScript", "simple-icons:typescript"),
|
||||
("javascript", "JavaScript", "simple-icons:javascript"),
|
||||
("web", "Web", "lucide:globe"),
|
||||
("cli", "CLI", "lucide:terminal"),
|
||||
("library", "Library", "lucide:package"),
|
||||
("game", "Game", "lucide:gamepad-2"),
|
||||
("data-structures", "Data Structures", "lucide:database"),
|
||||
("algorithms", "Algorithms", "lucide:cpu"),
|
||||
("multiplayer", "Multiplayer", "lucide:users"),
|
||||
("config", "Config", "lucide:settings"),
|
||||
("rust", "Rust", "simple-icons:rust", "CE422B"),
|
||||
("python", "Python", "simple-icons:python", "3776AB"),
|
||||
(
|
||||
"typescript",
|
||||
"TypeScript",
|
||||
"simple-icons:typescript",
|
||||
"3178C6",
|
||||
),
|
||||
(
|
||||
"javascript",
|
||||
"JavaScript",
|
||||
"simple-icons:javascript",
|
||||
"EAB308",
|
||||
),
|
||||
("web", "Web", "lucide:globe", "2563EB"),
|
||||
("cli", "CLI", "lucide:terminal", "64748B"),
|
||||
("library", "Library", "lucide:package", "8B5CF6"),
|
||||
("game", "Game", "lucide:gamepad-2", "EC4899"),
|
||||
(
|
||||
"data-structures",
|
||||
"Data Structures",
|
||||
"lucide:database",
|
||||
"10B981",
|
||||
),
|
||||
("algorithms", "Algorithms", "lucide:cpu", "F59E0B"),
|
||||
("multiplayer", "Multiplayer", "lucide:users", "06B6D4"),
|
||||
("config", "Config", "lucide:settings", "6366F1"),
|
||||
];
|
||||
|
||||
let mut tag_ids = std::collections::HashMap::new();
|
||||
|
||||
for (slug, name, icon) in tags {
|
||||
for (slug, name, icon, color) in tags {
|
||||
let result = sqlx::query!(
|
||||
r#"
|
||||
INSERT INTO tags (slug, name, icon)
|
||||
VALUES ($1, $2, $3)
|
||||
INSERT INTO tags (slug, name, icon, color)
|
||||
VALUES ($1, $2, $3, $4)
|
||||
RETURNING id
|
||||
"#,
|
||||
slug,
|
||||
name,
|
||||
icon
|
||||
icon,
|
||||
color
|
||||
)
|
||||
.fetch_one(pool)
|
||||
.await?;
|
||||
|
||||
+2
-1
@@ -36,17 +36,18 @@ pub async fn create_pool(database_url: &str) -> Result<PgPool, sqlx::Error> {
|
||||
return Ok(pool);
|
||||
}
|
||||
Err(e) => {
|
||||
last_error = Some(e);
|
||||
if attempt < max_attempts {
|
||||
tracing::warn!(
|
||||
attempt,
|
||||
max_attempts,
|
||||
delay_secs = delay.as_secs(),
|
||||
error = %e,
|
||||
"Database connection failed, retrying..."
|
||||
);
|
||||
sleep(delay).await;
|
||||
delay = (delay * 2).min(max_delay);
|
||||
}
|
||||
last_error = Some(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -74,7 +74,7 @@
|
||||
</div>
|
||||
|
||||
<!-- TODO: Add link to project search with tag filtering -->
|
||||
<div class="mt-auto flex flex-wrap gap-1">
|
||||
<div class="mt-auto flex flex-row-reverse flex-wrap-reverse gap-1">
|
||||
{#each project.tags as tag (tag.name)}
|
||||
<TagChip name={tag.name} color={tag.color} iconSvg={tag.iconSvg} />
|
||||
{/each}
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 1.8 MiB |
File diff suppressed because one or more lines are too long
|
Before Width: | Height: | Size: 1.2 MiB |
@@ -8,7 +8,7 @@ const config = {
|
||||
kit: {
|
||||
adapter: adapter({
|
||||
out: "build",
|
||||
precompress: true,
|
||||
precompress: false,
|
||||
serveAssets: false,
|
||||
}),
|
||||
alias: {
|
||||
|
||||
Reference in New Issue
Block a user