backend: initial commit
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
import { defineConfig } from "astro/config";
|
||||
import svelte from "@astrojs/svelte";
|
||||
import tailwind from "@astrojs/tailwind";
|
||||
|
||||
export default defineConfig({
|
||||
integrations: [svelte(), tailwind()],
|
||||
output: "static",
|
||||
// When hosting at a subdirectory (e.g. GitHub Pages project site), set:
|
||||
// base: "/repo-name",
|
||||
});
|
||||
@@ -0,0 +1,25 @@
|
||||
{
|
||||
"name": "bincio-site",
|
||||
"type": "module",
|
||||
"version": "0.1.0",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "astro dev",
|
||||
"build": "astro build",
|
||||
"preview": "astro preview",
|
||||
"astro": "astro"
|
||||
},
|
||||
"dependencies": {
|
||||
"@astrojs/svelte": "^7.0.0",
|
||||
"@astrojs/tailwind": "^5.1.0",
|
||||
"astro": "^5.0.0",
|
||||
"maplibre-gl": "^5.0.0",
|
||||
"@observablehq/plot": "^0.6.0",
|
||||
"svelte": "^5.0.0",
|
||||
"tailwindcss": "^3.4.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^22.0.0",
|
||||
"typescript": "^5.7.0"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
/** TypeScript types mirroring BAS v1.0 schema. */
|
||||
|
||||
export type Sport = "cycling" | "running" | "hiking" | "walking" | "swimming" | "other";
|
||||
export type SubSport = "road" | "mountain" | "gravel" | "indoor" | "trail" | "track" | null;
|
||||
export type Privacy = "public" | "blur_start" | "no_gps" | "private";
|
||||
|
||||
export interface ActivitySummary {
|
||||
id: string;
|
||||
title: string;
|
||||
sport: Sport;
|
||||
sub_sport: SubSport;
|
||||
started_at: string; // ISO 8601
|
||||
distance_m: number | null;
|
||||
duration_s: number | null;
|
||||
moving_time_s: number | null;
|
||||
elevation_gain_m: number | null;
|
||||
avg_speed_kmh: number | null;
|
||||
max_speed_kmh: number | null;
|
||||
avg_hr_bpm: number | null;
|
||||
max_hr_bpm: number | null;
|
||||
avg_cadence_rpm: number | null;
|
||||
avg_power_w: number | null;
|
||||
source: string | null;
|
||||
privacy: Privacy;
|
||||
detail_url: string | null;
|
||||
track_url: string | null;
|
||||
}
|
||||
|
||||
export interface BASIndex {
|
||||
bas_version: string;
|
||||
owner: { handle: string; display_name: string; avatar_url: string | null };
|
||||
generated_at: string;
|
||||
shards: Array<{ year: number; url: string; count: number }>;
|
||||
activities: ActivitySummary[];
|
||||
}
|
||||
|
||||
export interface Timeseries {
|
||||
t: number[];
|
||||
lat: number[] | null;
|
||||
lon: number[] | null;
|
||||
elevation_m: (number | null)[];
|
||||
speed_kmh: (number | null)[];
|
||||
hr_bpm: (number | null)[];
|
||||
cadence_rpm: (number | null)[];
|
||||
power_w: (number | null)[];
|
||||
temperature_c: (number | null)[];
|
||||
}
|
||||
|
||||
export interface ActivityDetail extends ActivitySummary {
|
||||
description: string | null;
|
||||
elevation_loss_m: number | null;
|
||||
max_power_w: number | null;
|
||||
gear: string | null;
|
||||
device: string | null;
|
||||
bbox: [number, number, number, number] | null;
|
||||
start_latlng: [number, number] | null;
|
||||
end_latlng: [number, number] | null;
|
||||
laps: Lap[];
|
||||
timeseries: Timeseries;
|
||||
strava_id: string | null;
|
||||
duplicate_of: string | null;
|
||||
custom: Record<string, unknown>;
|
||||
}
|
||||
|
||||
export interface Lap {
|
||||
index: number;
|
||||
started_at: string;
|
||||
duration_s: number | null;
|
||||
distance_m: number | null;
|
||||
elevation_gain_m: number | null;
|
||||
avg_speed_kmh: number | null;
|
||||
avg_hr_bpm: number | null;
|
||||
avg_power_w: number | null;
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
/** @type {import('tailwindcss').Config} */
|
||||
export default {
|
||||
content: ["./src/**/*.{astro,html,js,jsx,md,mdx,svelte,ts,tsx,vue}"],
|
||||
darkMode: "class",
|
||||
theme: {
|
||||
extend: {
|
||||
colors: {
|
||||
// BincioActivity accent — override via CSS variable in site_config
|
||||
accent: "var(--color-accent, #00c8ff)",
|
||||
},
|
||||
fontFamily: {
|
||||
sans: ["Inter", "system-ui", "sans-serif"],
|
||||
mono: ["JetBrains Mono", "monospace"],
|
||||
},
|
||||
},
|
||||
},
|
||||
plugins: [],
|
||||
};
|
||||
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"extends": "astro/tsconfigs/strict",
|
||||
"compilerOptions": {
|
||||
"baseUrl": ".",
|
||||
"paths": {
|
||||
"@lib/*": ["src/lib/*"],
|
||||
"@components/*": ["src/components/*"]
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user