mirror of
https://github.com/Xevion/xevion.dev.git
synced 2026-01-31 02:26:38 -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",
|
"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": {
|
"describe": {
|
||||||
"columns": [
|
"columns": [
|
||||||
{
|
{
|
||||||
@@ -13,12 +13,13 @@
|
|||||||
"Left": [
|
"Left": [
|
||||||
"Text",
|
"Text",
|
||||||
"Text",
|
"Text",
|
||||||
"Text"
|
"Text",
|
||||||
|
"Varchar"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"nullable": [
|
"nullable": [
|
||||||
false
|
false
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"hash": "1a6f4d858c200757c1d25c22279ef0a6eb8589bb6dff47afe1554850c1bead57"
|
"hash": "907e578fc43797b82c254fa3db3d976597f6deb761837d616d50aa93e9caef60"
|
||||||
}
|
}
|
||||||
@@ -37,3 +37,6 @@ tracing-subscriber = { version = "0.3.22", features = ["env-filter", "json"] }
|
|||||||
ulid = { version = "1", features = ["serde"] }
|
ulid = { version = "1", features = ["serde"] }
|
||||||
urlencoding = "2.1"
|
urlencoding = "2.1"
|
||||||
uuid = { version = "1", features = ["serde", "v4"] }
|
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 && \
|
RUN mkdir -p web/build/client && \
|
||||||
echo "placeholder" > web/build/client/.gitkeep
|
echo "placeholder" > web/build/client/.gitkeep
|
||||||
|
|
||||||
RUN cargo build --release && \
|
RUN cargo build --release
|
||||||
strip target/release/xevion
|
|
||||||
|
|
||||||
# ========== Stage 4: Frontend Builder ==========
|
# ========== Stage 4: Frontend Builder ==========
|
||||||
FROM oven/bun:1 AS frontend
|
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)
|
# Build with real assets (use sqlx offline mode)
|
||||||
ENV SQLX_OFFLINE=true
|
ENV SQLX_OFFLINE=true
|
||||||
RUN cargo build --release && \
|
RUN cargo build --release
|
||||||
strip target/release/xevion
|
|
||||||
|
|
||||||
# ========== Stage 6: Runtime ==========
|
# ========== Stage 6: Runtime ==========
|
||||||
FROM oven/bun:1-alpine AS runtime
|
FROM oven/bun:1-alpine AS runtime
|
||||||
|
|||||||
+1
-1
@@ -2,6 +2,6 @@
|
|||||||
"$schema": "https://railway.com/railway.schema.json",
|
"$schema": "https://railway.com/railway.schema.json",
|
||||||
"deploy": {
|
"deploy": {
|
||||||
"healthcheckPath": "/api/health",
|
"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
|
// Seed tags
|
||||||
let tags = vec![
|
let tags = vec![
|
||||||
("rust", "Rust", "simple-icons:rust"),
|
("rust", "Rust", "simple-icons:rust", "CE422B"),
|
||||||
("python", "Python", "simple-icons:python"),
|
("python", "Python", "simple-icons:python", "3776AB"),
|
||||||
("typescript", "TypeScript", "simple-icons:typescript"),
|
(
|
||||||
("javascript", "JavaScript", "simple-icons:javascript"),
|
"typescript",
|
||||||
("web", "Web", "lucide:globe"),
|
"TypeScript",
|
||||||
("cli", "CLI", "lucide:terminal"),
|
"simple-icons:typescript",
|
||||||
("library", "Library", "lucide:package"),
|
"3178C6",
|
||||||
("game", "Game", "lucide:gamepad-2"),
|
),
|
||||||
("data-structures", "Data Structures", "lucide:database"),
|
(
|
||||||
("algorithms", "Algorithms", "lucide:cpu"),
|
"javascript",
|
||||||
("multiplayer", "Multiplayer", "lucide:users"),
|
"JavaScript",
|
||||||
("config", "Config", "lucide:settings"),
|
"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();
|
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!(
|
let result = sqlx::query!(
|
||||||
r#"
|
r#"
|
||||||
INSERT INTO tags (slug, name, icon)
|
INSERT INTO tags (slug, name, icon, color)
|
||||||
VALUES ($1, $2, $3)
|
VALUES ($1, $2, $3, $4)
|
||||||
RETURNING id
|
RETURNING id
|
||||||
"#,
|
"#,
|
||||||
slug,
|
slug,
|
||||||
name,
|
name,
|
||||||
icon
|
icon,
|
||||||
|
color
|
||||||
)
|
)
|
||||||
.fetch_one(pool)
|
.fetch_one(pool)
|
||||||
.await?;
|
.await?;
|
||||||
|
|||||||
+2
-1
@@ -36,17 +36,18 @@ pub async fn create_pool(database_url: &str) -> Result<PgPool, sqlx::Error> {
|
|||||||
return Ok(pool);
|
return Ok(pool);
|
||||||
}
|
}
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
last_error = Some(e);
|
|
||||||
if attempt < max_attempts {
|
if attempt < max_attempts {
|
||||||
tracing::warn!(
|
tracing::warn!(
|
||||||
attempt,
|
attempt,
|
||||||
max_attempts,
|
max_attempts,
|
||||||
delay_secs = delay.as_secs(),
|
delay_secs = delay.as_secs(),
|
||||||
|
error = %e,
|
||||||
"Database connection failed, retrying..."
|
"Database connection failed, retrying..."
|
||||||
);
|
);
|
||||||
sleep(delay).await;
|
sleep(delay).await;
|
||||||
delay = (delay * 2).min(max_delay);
|
delay = (delay * 2).min(max_delay);
|
||||||
}
|
}
|
||||||
|
last_error = Some(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -74,7 +74,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- TODO: Add link to project search with tag filtering -->
|
<!-- 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)}
|
{#each project.tags as tag (tag.name)}
|
||||||
<TagChip name={tag.name} color={tag.color} iconSvg={tag.iconSvg} />
|
<TagChip name={tag.name} color={tag.color} iconSvg={tag.iconSvg} />
|
||||||
{/each}
|
{/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: {
|
kit: {
|
||||||
adapter: adapter({
|
adapter: adapter({
|
||||||
out: "build",
|
out: "build",
|
||||||
precompress: true,
|
precompress: false,
|
||||||
serveAssets: false,
|
serveAssets: false,
|
||||||
}),
|
}),
|
||||||
alias: {
|
alias: {
|
||||||
|
|||||||
Reference in New Issue
Block a user