10 Commits

Author SHA1 Message Date
dfee02629d optimize release build
All checks were successful
Backend Actions / check (push) Successful in 1m21s
Frontend Actions / check (push) Successful in 1m33s
Backend Actions / build (push) Successful in 3m33s
Frontend Actions / build (push) Successful in 1m27s
Frontend Actions / test (push) Successful in 1m10s
Backend Actions / test (push) Successful in 5m28s
2025-08-04 09:49:52 +01:00
2914abbcd0 fix frontend lints
Some checks failed
Backend Actions / check (push) Successful in 2m27s
Backend Actions / test (push) Failing after 2m37s
Backend Actions / build (push) Successful in 3m46s
Frontend Actions / check (push) Successful in 1m24s
Frontend Actions / build (push) Successful in 1m22s
Frontend Actions / test (push) Successful in 46s
2025-08-01 16:15:31 +01:00
70334ea0ae add prepared sqlx files
Some checks failed
Backend Actions / check (push) Has started running
Backend Actions / build (push) Has started running
Backend Actions / test (push) Has been cancelled
Frontend Actions / build (push) Has been cancelled
Frontend Actions / test (push) Has been cancelled
Frontend Actions / check (push) Has been cancelled
2025-08-01 16:14:33 +01:00
c96b2adada fix tests and properly intgrate sqlx
Some checks failed
Backend Actions / check (push) Failing after 3m26s
Frontend Actions / check (push) Failing after 3m17s
Backend Actions / test (push) Failing after 3m20s
Frontend Actions / test (push) Successful in 51s
Frontend Actions / build (push) Successful in 56s
Backend Actions / build (push) Failing after 10m57s
2025-08-01 15:21:39 +01:00
6ec6aa2aa7 add database url for sqlx
All checks were successful
Backend Actions / check (push) Successful in 38s
Backend Actions / build (push) Successful in 1m11s
Frontend Actions / check (push) Successful in 1m36s
Backend Actions / test (push) Successful in 2m22s
Frontend Actions / build (push) Successful in 1m28s
Frontend Actions / test (push) Successful in 46s
2025-07-28 02:01:47 +01:00
46cb354c9a run in container
All checks were successful
Backend Actions / build (push) Successful in 1m8s
Backend Actions / check (push) Successful in 1m34s
Frontend Actions / check (push) Successful in 1m37s
Frontend Actions / build (push) Successful in 1m33s
Backend Actions / test (push) Successful in 3m41s
Frontend Actions / test (push) Successful in 1m5s
2025-07-28 01:57:13 +01:00
bfda9d3735 fix lints 2025-07-28 01:31:22 +01:00
84bbbab6ea add prepared sqlx files
Some checks failed
Backend Actions / build (push) Successful in 52s
Backend Actions / check (push) Failing after 1m7s
Frontend Actions / check (push) Successful in 1m35s
Frontend Actions / build (push) Successful in 1m36s
Backend Actions / test (push) Failing after 2m1s
Frontend Actions / test (push) Successful in 52s
2025-07-28 01:30:32 +01:00
8a6f8b5875 add database service to backend test
Some checks failed
Backend Actions / check (push) Failing after 2m15s
Backend Actions / build (push) Failing after 3m15s
Backend Actions / test (push) Failing after 3m22s
Frontend Actions / check (push) Successful in 1m16s
Frontend Actions / build (push) Has been cancelled
Frontend Actions / test (push) Has been cancelled
2025-07-28 01:01:08 +01:00
79e43f19df add database connection to backend 2025-07-28 00:56:41 +01:00
33 changed files with 2218 additions and 61 deletions

View File

@ -41,7 +41,22 @@ jobs:
run: cargo build --release --locked
test:
runs-on: rust-nextest
runs-on: ubuntu-latest
container: git.molloy.xyz/fergus-molloy/ubuntu:rust-nextest
services:
postgres:
image: postgres:17-alpine
ports:
- "5432:5432"
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DATABASE: nuchat_test
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
defaults:
run:
working-directory: ./backend
@ -59,6 +74,10 @@ jobs:
run: cargo build --locked --bin nuchat
- name: Run Tests
run: ./scripts/test.sh
env:
POSTGRES_URL: "postgresql://postgres:postgres@postgres:5432"
DATABASE_URL: "postgresql://postgres:postgres@postgres:5432"
SKIP_DOCKER: "1"
- name: Upload Test Logs
if: ${{ failure() }}
uses: actions/upload-artifact@v3

View File

@ -0,0 +1,23 @@
{
"db_name": "PostgreSQL",
"query": "INSERT INTO messages (id, contents, created_at) VALUES($1, $2, current_timestamp) RETURNING id",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "id",
"type_info": "Uuid"
}
],
"parameters": {
"Left": [
"Uuid",
"Text"
]
},
"nullable": [
false
]
},
"hash": "060e058f46bf96f6505fb8a1d1b305c062c5c8a7ada56b34d6c9c229de3b9b34"
}

View File

@ -0,0 +1,32 @@
{
"db_name": "PostgreSQL",
"query": "SELECT id, contents, created_at FROM messages",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "id",
"type_info": "Uuid"
},
{
"ordinal": 1,
"name": "contents",
"type_info": "Text"
},
{
"ordinal": 2,
"name": "created_at",
"type_info": "Timestamptz"
}
],
"parameters": {
"Left": []
},
"nullable": [
false,
false,
false
]
},
"hash": "5af6cb153161fced4a308b34b5c303f6907a9e06021bbeca31d41de236514589"
}

View File

@ -0,0 +1,22 @@
{
"db_name": "PostgreSQL",
"query": "select exists(SELECT datname FROM pg_catalog.pg_database WHERE datname = $1);",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "exists",
"type_info": "Bool"
}
],
"parameters": {
"Left": [
"Name"
]
},
"nullable": [
null
]
},
"hash": "6060467ee8046709f486ab35233e43eb849de082aa86c4d877b0c0818e27c104"
}

View File

@ -0,0 +1,34 @@
{
"db_name": "PostgreSQL",
"query": "SELECT id, name, created_at FROM servers WHERE id = $1",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "id",
"type_info": "Uuid"
},
{
"ordinal": 1,
"name": "name",
"type_info": "Text"
},
{
"ordinal": 2,
"name": "created_at",
"type_info": "Timestamptz"
}
],
"parameters": {
"Left": [
"Uuid"
]
},
"nullable": [
false,
false,
false
]
},
"hash": "66b1dcdcbc9eae32237b1f712c32498003efb42d843b5bb7d33668d5cc3199a7"
}

View File

@ -0,0 +1,34 @@
{
"db_name": "PostgreSQL",
"query": "SELECT id, contents, created_at FROM messages WHERE id = $1",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "id",
"type_info": "Uuid"
},
{
"ordinal": 1,
"name": "contents",
"type_info": "Text"
},
{
"ordinal": 2,
"name": "created_at",
"type_info": "Timestamptz"
}
],
"parameters": {
"Left": [
"Uuid"
]
},
"nullable": [
false,
false,
false
]
},
"hash": "a86c7ef23b4f356ffccb0be2af40e6fbbde85dd57fd2a37b6654279c55d441e3"
}

View File

@ -0,0 +1,32 @@
{
"db_name": "PostgreSQL",
"query": "SELECT id, name, created_at FROM servers",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "id",
"type_info": "Uuid"
},
{
"ordinal": 1,
"name": "name",
"type_info": "Text"
},
{
"ordinal": 2,
"name": "created_at",
"type_info": "Timestamptz"
}
],
"parameters": {
"Left": []
},
"nullable": [
false,
false,
false
]
},
"hash": "cc8f315cf11481ed3ef0cf8f08c54fe508833afc74b18b4b47a7b7ee217a2439"
}

View File

@ -0,0 +1,23 @@
{
"db_name": "PostgreSQL",
"query": "INSERT INTO servers (id, name, created_at) VALUES($1, $2, current_timestamp) RETURNING id",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "id",
"type_info": "Uuid"
}
],
"parameters": {
"Left": [
"Uuid",
"Text"
]
},
"nullable": [
false
]
},
"hash": "d6d5a09a7a6849b4610269cdc1a121caedd1b8853f7de70b02a8ed5a9c5615aa"
}

1011
backend/Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -4,11 +4,15 @@ version = "0.1.0"
edition = "2024"
[dependencies]
axum = "0.8.4"
axum = { version = "0.8.4", features = [] }
chrono = { version = "0.4.41", features = ["serde"] }
clap = { version = "4.5.41", features = ["derive"] }
futures = "0.3.31"
http = "1.3.1"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0.141"
sqlx = { version = "0.8.6", features = ["postgres", "macros", "runtime-tokio", "uuid", "chrono"] }
tap = "1.0.1"
tokio = { version = "1.0", features = ["full"] }
tower = { version = "0.5.2", features = ["full"] }
tower-http = { version = "0.6.6", features = ["timeout", "trace", "auth", "request-id"] }
@ -31,3 +35,9 @@ name ="nuchat"
default = [ "shutdown" ]
all = ["shutdown"]
shutdown = []
[profile.release]
codegen-units = 1
lto = "fat"
panic = "abort"
strip = "symbols"

View File

@ -0,0 +1,7 @@
-- Add migration script here
CREATE TABLE servers (
id uuid NOT NULL,
PRIMARY KEY(id),
name TEXT NOT NULL,
created_at timestamptz NOT NULL
)

View File

@ -0,0 +1,7 @@
-- Add migration script here
CREATE TABLE messages (
id uuid NOT NULL,
PRIMARY KEY(id),
contents TEXT NOT NULL,
created_at timestamptz NOT NULL
)

View File

@ -1,11 +1,34 @@
#!/usr/bin/env bash
POSTGRES_URL=${POSTGRES_URL:-"postgresql://postgres:postgres@localhost:5432"}
if ! command -v cargo-nextest > /dev/null 2>&1; then
echo "Command not found cargo-nextest"
echo "Try installing with cargo install cargo-nextest"
exit 1
fi
if ! command -v sqlx > /dev/null 2>&1; then
echo "Command not found sqlx"
echo "Try installing with cargo install sqlx-cli"
exit 1
fi
export DATABASE_URL="$POSTGRES_URL/nuchat_dev"
if [ -z "$SKIP_DOCKER" ]; then
# force restart database so no connections
# prevent database from being dropped
docker compose -f ../docker-compose.yml down
docker compose -f ../docker-compose.yml up -d db
sleep 1
fi
# recreate database and tables
sqlx database drop -y
sqlx database create
sqlx migrate run
if [ ! -d logs ]; then
mkdir logs
fi
@ -14,7 +37,8 @@ fi
curl -s -X POST localhost:7001/admin/shutdown 2>&1 > /dev/null
# start server
cargo run -- --port 7001 2>&1 > logs/nuchat.log &
cargo run -- --port 7001 --postgres-url "$POSTGRES_URL" --database "nuchat_dev" 2>&1 > logs/nuchat.log &
sleep 1
# run tests
cargo nextest run --color=always 2>&1 | tee logs/test-output.log
cargo nextest run --color=always --no-fail-fast 2>&1 | tee logs/test-output.log

View File

@ -3,4 +3,6 @@ pub struct Config {
pub port: u32,
pub host: String,
pub admin_secret: Option<String>,
pub postgres_url: String,
pub database_name: String,
}

View File

@ -1,5 +1,7 @@
mod config;
mod router;
mod state;
pub use config::Config;
pub use router::app;
pub use state::{AppState, NuState};

View File

@ -1,8 +1,12 @@
use std::sync::mpsc;
use clap::Parser;
use nuchat::AppState;
use nuchat::Config;
use nuchat::NuState;
use nuchat::app;
use sqlx::Pool;
use sqlx::Postgres;
use tokio::net::TcpListener;
use tokio::signal;
use tracing::info;
@ -22,6 +26,14 @@ struct Args {
/// Admin secret to use, leave blank to disable
#[arg(long)]
admin_secret: Option<String>,
/// postgres base url, should container users and host info
#[arg(long, default_value = "postgres://postgres:postgres@localhost:5432")]
postgres_url: String,
/// name of database to use
#[arg(long, default_value = "nuchat_dev")]
database: String,
}
#[tokio::main]
@ -37,16 +49,26 @@ async fn main() {
.with(tracing_subscriber::fmt::layer().with_target(false))
.init();
let database_url = format!("{}/{}", config.0.postgres_url, config.0.database_name);
info!("Connecting to database: {database_url}");
let pool = Pool::<Postgres>::connect(&database_url)
.await
.expect("Could not connect to database");
let listener = TcpListener::bind(format!("{}:{}", config.0.host, config.0.port))
.await
.unwrap();
tracing::debug!("listening on {}", listener.local_addr().unwrap());
let (app, rx) = app(&config.0);
axum::serve(listener, app)
let state = AppState::new(NuState::new(pool.clone(), config.0));
let (app, rx) = app(&state);
axum::serve(listener, app.with_state(state))
.with_graceful_shutdown(shutdown_signal(rx))
.await
.unwrap();
pool.close().await;
info!("Server stopped");
}
@ -91,6 +113,8 @@ impl BinConfig {
port: args.port,
host: args.host,
admin_secret: args.admin_secret,
postgres_url: args.postgres_url,
database_name: args.database,
})
}
}

View File

@ -1,13 +1,15 @@
mod admin;
mod healthcheck;
mod messages;
mod servers;
use std::sync::mpsc;
use std::time::Duration;
use crate::config;
use crate::AppState;
use axum::extract::Request;
use axum::routing::get;
use axum::{Router, body::Body};
use http::HeaderName;
use http::{HeaderName, HeaderValue};
use tower::ServiceBuilder;
use tower_http::request_id::{MakeRequestId, RequestId, SetRequestIdLayer};
use tower_http::timeout::TimeoutLayer;
@ -26,13 +28,23 @@ impl MakeRequestId for RequestIdLayer {
}
}
pub fn app(config: &config::Config) -> (Router, mpsc::Receiver<bool>) {
pub fn app(state: &AppState) -> (Router<AppState>, mpsc::Receiver<bool>) {
let (tx, rx) = mpsc::channel();
(
Router::new()
.with_state(state.clone())
.route("/healthcheck", get(healthcheck::healthcheck))
.route("/forever", get(std::future::pending::<()>))
.nest("/admin", admin::router(tx, config))
.route(
"/servers",
get(servers::get_servers).post(servers::create_server),
)
.route("/servers/{id}", get(servers::get_server_by_id))
.route(
"/messages",
get(messages::get_messages).post(messages::create_message),
)
.route("/messages/{id}", get(messages::get_message_by_id))
.nest("/admin", admin::router(tx, state))
.layer(
ServiceBuilder::new()
.layer(SetRequestIdLayer::new(
@ -41,23 +53,15 @@ pub fn app(config: &config::Config) -> (Router, mpsc::Receiver<bool>) {
))
.layer(
TraceLayer::new_for_http().make_span_with(|req: &Request<Body>| {
if let Some(req_id) = req.headers().get("x-request-id") {
tracing::span!(
Level::DEBUG,
"request",
req_id = req_id.to_str().unwrap(),
method = format!("{}", req.method()),
uri = format!("{}", req.uri()),
)
} else {
tracing::span!(
Level::DEBUG,
"request",
req_id = "<missing>",
method = format!("{}", req.method()),
uri = format!("{}", req.uri()),
)
}
let default = HeaderValue::from_static("<missing>");
let req_id = req.headers().get("x-request-id").unwrap_or(&default);
tracing::span!(
Level::DEBUG,
"request",
req_id = req_id.to_str().unwrap(),
method = format!("{}", req.method()),
uri = format!("{}", req.uri()),
)
}),
)
.layer(TimeoutLayer::new(Duration::from_secs(10))),

View File

@ -7,13 +7,17 @@ use http::StatusCode;
use tower_http::validate_request::ValidateRequestHeaderLayer;
use tracing::{info, warn};
pub fn router(tx: mpsc::Sender<bool>, config: &crate::Config) -> Router {
let r = Router::new().route("/", get(async || StatusCode::OK));
use crate::AppState;
pub fn router(tx: mpsc::Sender<bool>, state: &AppState) -> Router<AppState> {
let r = Router::new()
.with_state(state.clone())
.route("/", get(async || StatusCode::OK));
let r = add_shutdown_endpoint(r, tx);
if let Some(secret) = config.admin_secret.clone() {
if let Some(secret) = &state.config.admin_secret {
info!("Enabled admin authorization");
r.layer(ValidateRequestHeaderLayer::bearer(&secret))
r.layer(ValidateRequestHeaderLayer::bearer(secret))
} else {
warn!("Admin authorization disabled");
r
@ -21,7 +25,7 @@ pub fn router(tx: mpsc::Sender<bool>, config: &crate::Config) -> Router {
}
#[cfg(feature = "shutdown")]
fn add_shutdown_endpoint(r: Router, tx: mpsc::Sender<bool>) -> Router {
fn add_shutdown_endpoint(r: Router<AppState>, tx: mpsc::Sender<bool>) -> Router<AppState> {
r.route(
"/shutdown",
post(async move || {
@ -44,17 +48,21 @@ fn add_shutdown_endpoint(r: Router, _: mpsc::Sender<bool>) -> Router {
mod test {
use axum::{body::Body, http::Request};
use http::header;
use sqlx::PgPool;
use tower::ServiceExt;
use crate::config;
use crate::{config, state::NuState};
use super::*;
#[tokio::test]
async fn test_authorization_disables_when_no_secret_set() {
#[sqlx::test]
async fn test_authorization_disables_when_no_secret_set(pool: PgPool) {
let (tx, _) = mpsc::channel();
let resp = router(tx, &config::Config::default())
let state = AppState::new(NuState::new(pool, config::Config::default()));
let resp = router(tx, &state)
.with_state(state)
.oneshot(Request::builder().uri("/").body(Body::empty()).unwrap())
.await
.unwrap();
@ -62,8 +70,8 @@ mod test {
assert_eq!(resp.status(), StatusCode::OK);
}
#[tokio::test]
async fn test_authorization_unauthorized_no_bearer_token() {
#[sqlx::test]
async fn test_authorization_unauthorized_no_bearer_token(pool: PgPool) {
let (tx, _) = mpsc::channel();
let conf = config::Config {
@ -71,7 +79,10 @@ mod test {
..Default::default()
};
let resp = router(tx, &conf)
let state = AppState::new(NuState::new(pool, conf));
let resp = router(tx, &state)
.with_state(state)
.oneshot(Request::builder().uri("/").body(Body::empty()).unwrap())
.await
.unwrap();
@ -79,8 +90,8 @@ mod test {
assert_eq!(resp.status(), StatusCode::UNAUTHORIZED);
}
#[tokio::test]
async fn test_authorization_unauthorized_invalid_bearer_token() {
#[sqlx::test]
async fn test_authorization_unauthorized_invalid_bearer_token(pool: PgPool) {
let (tx, _) = mpsc::channel();
let conf = config::Config {
@ -88,7 +99,10 @@ mod test {
..Default::default()
};
let resp = router(tx, &conf)
let state = AppState::new(NuState::new(pool, conf));
let resp = router(tx, &state)
.with_state(state)
.oneshot(
Request::builder()
.uri("/")
@ -102,8 +116,8 @@ mod test {
assert_eq!(resp.status(), StatusCode::UNAUTHORIZED);
}
#[tokio::test]
async fn test_authorization_authorized_valid_bearer_token() {
#[sqlx::test]
async fn test_authorization_authorized_valid_bearer_token(pool: PgPool) {
let (tx, _) = mpsc::channel();
let conf = config::Config {
@ -111,7 +125,10 @@ mod test {
..Default::default()
};
let resp = router(tx, &conf)
let state = AppState::new(NuState::new(pool, conf));
let resp = router(tx, &state)
.with_state(state)
.oneshot(
Request::builder()
.uri("/")

View File

@ -1,6 +1,78 @@
use axum::extract::{self, State};
use axum::response::Json;
use http::StatusCode;
use serde_json::{Value, json};
use tracing::error;
pub async fn healthcheck() -> Json<Value> {
Json(json!({"healthy": true}))
use crate::AppState;
pub async fn healthcheck(State(s): extract::State<AppState>) -> Result<Json<Value>, StatusCode> {
sqlx::query!(
"select exists(SELECT datname FROM pg_catalog.pg_database WHERE datname = $1);",
s.config.database_name
)
.fetch_one(&s.db)
.await
.and_then(|x| x.exists.ok_or(sqlx::Error::RowNotFound))
.and_then(|db| {
if db {
Ok(Json(json!({"healthy": db})))
} else {
error!("Could not find configured database in postgres");
Err(sqlx::Error::RowNotFound)
}
})
.map_err(|_| StatusCode::INTERNAL_SERVER_ERROR)
}
#[cfg(test)]
mod test {
use axum::{Router, body::Body, routing::get};
use http::Request;
use sqlx::PgPool;
use tower::ServiceExt;
use crate::{Config, NuState};
use super::*;
#[sqlx::test]
async fn healthcheck_passes_with_db_connection(pool: PgPool) {
let state = AppState::new(NuState::new(
pool,
Config {
database_name: String::from("nuchat_dev"),
..Config::default()
},
));
let resp = Router::new()
.route("/", get(healthcheck))
.with_state(state)
.oneshot(Request::builder().uri("/").body(Body::empty()).unwrap())
.await
.unwrap();
assert_eq!(resp.status(), StatusCode::OK);
}
#[sqlx::test]
async fn healthcheck_fails_db_doesnt_exist(pool: PgPool) {
let state = AppState::new(NuState::new(
pool,
Config {
database_name: String::from("asdfasdfasdf"),
..Config::default()
},
));
let resp = Router::new()
.route("/", get(healthcheck))
.with_state(state)
.oneshot(Request::builder().uri("/").body(Body::empty()).unwrap())
.await
.unwrap();
assert_eq!(resp.status(), StatusCode::INTERNAL_SERVER_ERROR);
}
}

View File

@ -0,0 +1,68 @@
use axum::{
Form, Json,
body::Body,
extract::{Path, State},
response::{IntoResponse, Response},
};
use http::StatusCode;
use sqlx::types::chrono;
use tracing::info;
use uuid::Uuid;
use crate::AppState;
#[derive(serde::Deserialize, serde::Serialize, Debug)]
pub struct Message {
pub contents: String,
pub id: Uuid,
pub created_at: chrono::DateTime<chrono::Utc>,
}
#[derive(serde::Deserialize)]
pub struct CreateMessage {
pub contents: String,
}
pub async fn get_messages(State(s): State<AppState>) -> Result<Json<Vec<Message>>, StatusCode> {
sqlx::query_as!(Message, r#"SELECT id, contents, created_at FROM messages"#)
.fetch_all(&s.db)
.await
.map(Json)
.map_err(|_| StatusCode::INTERNAL_SERVER_ERROR)
}
pub async fn create_message(
State(s): State<AppState>,
Form(message): Form<CreateMessage>,
) -> Result<Response<Body>, StatusCode> {
info!("Creating new message with name: {}", message.contents);
let id = Uuid::now_v7();
sqlx::query!(
r"INSERT INTO messages (id, contents, created_at) VALUES($1, $2, current_timestamp) RETURNING id",
id,
message.contents
).fetch_one(&s.db).await
.map(|row| {
let mut resp = Json(row.id).into_response();
let status = resp.status_mut();
*status = StatusCode::CREATED;
info!("Successfully created message Message[{}, {}]", row.id, message.contents);
resp
}).map_err(|_| StatusCode::INTERNAL_SERVER_ERROR)
}
pub async fn get_message_by_id(
Path(id): Path<Uuid>,
State(s): State<AppState>,
) -> Result<Json<Message>, StatusCode> {
sqlx::query_as!(
Message,
r#"SELECT id, contents, created_at FROM messages WHERE id = $1"#,
id
)
.fetch_optional(&s.db)
.await
.map_err(|_| StatusCode::INTERNAL_SERVER_ERROR)
.and_then(|mayber_message| mayber_message.map(Json).ok_or(StatusCode::NOT_FOUND))
}

View File

@ -0,0 +1,68 @@
use axum::{
Form, Json,
body::Body,
extract::{Path, State},
response::{IntoResponse, Response},
};
use http::StatusCode;
use sqlx::types::chrono;
use tracing::info;
use uuid::Uuid;
use crate::AppState;
#[derive(serde::Deserialize, serde::Serialize, Debug)]
pub struct Server {
pub name: String,
pub id: Uuid,
pub created_at: chrono::DateTime<chrono::Utc>,
}
#[derive(serde::Deserialize)]
pub struct CreateServer {
pub name: String,
}
pub async fn get_servers(State(s): State<AppState>) -> Result<Json<Vec<Server>>, StatusCode> {
sqlx::query_as!(Server, r#"SELECT id, name, created_at FROM servers"#)
.fetch_all(&s.db)
.await
.map(Json)
.map_err(|_| StatusCode::INTERNAL_SERVER_ERROR)
}
pub async fn create_server(
State(s): State<AppState>,
Form(server): Form<CreateServer>,
) -> Result<Response<Body>, StatusCode> {
info!("Creating new server with name: {}", server.name);
let id = Uuid::now_v7();
sqlx::query!(
r"INSERT INTO servers (id, name, created_at) VALUES($1, $2, current_timestamp) RETURNING id",
id,
server.name
).fetch_one(&s.db).await
.map(|row| {
let mut resp = Json(row.id).into_response();
let status = resp.status_mut();
*status = StatusCode::CREATED;
info!("Successfully created server Server[{}, {}]", row.id, server.name);
resp
}).map_err(|_| StatusCode::INTERNAL_SERVER_ERROR)
}
pub async fn get_server_by_id(
Path(id): Path<Uuid>,
State(s): State<AppState>,
) -> Result<Json<Server>, StatusCode> {
sqlx::query_as!(
Server,
r#"SELECT id, name, created_at FROM servers WHERE id = $1"#,
id
)
.fetch_optional(&s.db)
.await
.map_err(|_| StatusCode::INTERNAL_SERVER_ERROR)
.and_then(|mayber_server| mayber_server.map(Json).ok_or(StatusCode::NOT_FOUND))
}

19
backend/src/state.rs Normal file
View File

@ -0,0 +1,19 @@
use std::sync::Arc;
use sqlx::PgPool;
use crate::Config;
pub type AppState = Arc<NuState>;
#[derive(Clone)]
pub struct NuState {
pub db: sqlx::PgPool,
pub config: Config,
}
impl NuState {
#[must_use]
pub fn new(db: PgPool, config: Config) -> Self {
Self { db, config }
}
}

View File

@ -20,6 +20,6 @@ services:
environment:
POSTGRES_USER: $POSTGRES_USER
POSTGRES_PASSWORD: $POSTGRES_PASSWORD
POSTGRES_DB: nuchat
POSTGRES_DB: nuchat_dev
ports:
- "5432:5432"

View File

@ -1,6 +1,8 @@
<template>
<div>
<NuxtRouteAnnouncer />
<NuxtPage />
<NuxtLayout>
<NuxtPage />
</NuxtLayout>
</div>
</template>

View File

@ -0,0 +1 @@
@import "tailwindcss";

View File

@ -0,0 +1,7 @@
<template>
<div class="bg-sky-900 text-white p-4 mt-auto">
<div class="text-center text-sm opacity-75">
© 2025 NuChat. All rights reserved.
</div>
</div>
</template>

View File

@ -0,0 +1,5 @@
<template>
<div class="text-2xl bold bg-sky-900 text-white p-2">
<NuxtLink to="/">NuChat</NuxtLink>
</div>
</template>

View File

@ -0,0 +1,14 @@
<template>
<RouterLink
:to="`/servers/${id}`"
class="block p-3 hover:bg-sky-100 rounded-lg transition-colors duration-200 border border-transparent hover:border-sky-300"
>
<slot />
</RouterLink>
</template>
<script setup lang="ts">
defineProps<{
id: string | number;
}>();
</script>

View File

@ -0,0 +1,38 @@
<template>
<div class="h-full border-2 border-sky-300 flex flex-col p-4 bg-gray-50">
<h2 class="text-lg font-semibold text-gray-800 mb-4">Servers</h2>
<div class="space-y-2">
<ServerLink
v-for="server in serversWithFallback"
:id="server.id"
:key="server.id"
class="text-gray-700 hover:text-sky-800"
>
{{ server.name }}
</ServerLink>
</div>
</div>
</template>
<script setup lang="ts">
interface Server {
id: string;
name: string;
}
const { data: servers, error } = await useFetch<Server[]>("/api/servers");
if (error.value) {
console.error("Failed to fetch servers:", error.value);
}
const serversWithFallback = computed(() => {
return (
servers.value || [
{ id: "1", name: "General" },
{ id: "2", name: "Gaming" },
{ id: "3", name: "Tech Talk" },
]
);
});
</script>

View File

@ -0,0 +1,12 @@
<template>
<div>
<AppHeader />
<div class="grid grid-cols-12">
<ServerSidebar class="col-span-2" />
<div class="col-span-10">
<slot />
</div>
</div>
<AppFooter />
</div>
</template>

View File

@ -1,3 +1,5 @@
import tailwindcss from "@tailwindcss/vite";
// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
compatibilityDate: "2025-07-15",
@ -8,6 +10,10 @@ export default defineNuxtConfig({
"@nuxt/test-utils",
"@nuxt/test-utils/module",
],
css: ["~/assets/css/main.css"],
vite: {
plugins: [tailwindcss()],
},
nitro: {
preset: "node-server",
},

538
ui/package-lock.json generated
View File

@ -9,7 +9,9 @@
"dependencies": {
"@nuxt/eslint": "1.6.0",
"@nuxt/icon": "^1.15.0",
"@tailwindcss/vite": "^4.1.11",
"nuxt": "^4.0.1",
"tailwindcss": "^4.1.11",
"vue": "^3.5.17",
"vue-router": "^4.5.1"
},
@ -4518,6 +4520,277 @@
"eslint": ">=9.0.0"
}
},
"node_modules/@tailwindcss/node": {
"version": "4.1.11",
"resolved": "https://registry.npmjs.org/@tailwindcss/node/-/node-4.1.11.tgz",
"integrity": "sha512-yzhzuGRmv5QyU9qLNg4GTlYI6STedBWRE7NjxP45CsFYYq9taI0zJXZBMqIC/c8fViNLhmrbpSFS57EoxUmD6Q==",
"license": "MIT",
"dependencies": {
"@ampproject/remapping": "^2.3.0",
"enhanced-resolve": "^5.18.1",
"jiti": "^2.4.2",
"lightningcss": "1.30.1",
"magic-string": "^0.30.17",
"source-map-js": "^1.2.1",
"tailwindcss": "4.1.11"
}
},
"node_modules/@tailwindcss/oxide": {
"version": "4.1.11",
"resolved": "https://registry.npmjs.org/@tailwindcss/oxide/-/oxide-4.1.11.tgz",
"integrity": "sha512-Q69XzrtAhuyfHo+5/HMgr1lAiPP/G40OMFAnws7xcFEYqcypZmdW8eGXaOUIeOl1dzPJBPENXgbjsOyhg2nkrg==",
"hasInstallScript": true,
"license": "MIT",
"dependencies": {
"detect-libc": "^2.0.4",
"tar": "^7.4.3"
},
"engines": {
"node": ">= 10"
},
"optionalDependencies": {
"@tailwindcss/oxide-android-arm64": "4.1.11",
"@tailwindcss/oxide-darwin-arm64": "4.1.11",
"@tailwindcss/oxide-darwin-x64": "4.1.11",
"@tailwindcss/oxide-freebsd-x64": "4.1.11",
"@tailwindcss/oxide-linux-arm-gnueabihf": "4.1.11",
"@tailwindcss/oxide-linux-arm64-gnu": "4.1.11",
"@tailwindcss/oxide-linux-arm64-musl": "4.1.11",
"@tailwindcss/oxide-linux-x64-gnu": "4.1.11",
"@tailwindcss/oxide-linux-x64-musl": "4.1.11",
"@tailwindcss/oxide-wasm32-wasi": "4.1.11",
"@tailwindcss/oxide-win32-arm64-msvc": "4.1.11",
"@tailwindcss/oxide-win32-x64-msvc": "4.1.11"
}
},
"node_modules/@tailwindcss/oxide-android-arm64": {
"version": "4.1.11",
"resolved": "https://registry.npmjs.org/@tailwindcss/oxide-android-arm64/-/oxide-android-arm64-4.1.11.tgz",
"integrity": "sha512-3IfFuATVRUMZZprEIx9OGDjG3Ou3jG4xQzNTvjDoKmU9JdmoCohQJ83MYd0GPnQIu89YoJqvMM0G3uqLRFtetg==",
"cpu": [
"arm64"
],
"license": "MIT",
"optional": true,
"os": [
"android"
],
"engines": {
"node": ">= 10"
}
},
"node_modules/@tailwindcss/oxide-darwin-arm64": {
"version": "4.1.11",
"resolved": "https://registry.npmjs.org/@tailwindcss/oxide-darwin-arm64/-/oxide-darwin-arm64-4.1.11.tgz",
"integrity": "sha512-ESgStEOEsyg8J5YcMb1xl8WFOXfeBmrhAwGsFxxB2CxY9evy63+AtpbDLAyRkJnxLy2WsD1qF13E97uQyP1lfQ==",
"cpu": [
"arm64"
],
"license": "MIT",
"optional": true,
"os": [
"darwin"
],
"engines": {
"node": ">= 10"
}
},
"node_modules/@tailwindcss/oxide-darwin-x64": {
"version": "4.1.11",
"resolved": "https://registry.npmjs.org/@tailwindcss/oxide-darwin-x64/-/oxide-darwin-x64-4.1.11.tgz",
"integrity": "sha512-EgnK8kRchgmgzG6jE10UQNaH9Mwi2n+yw1jWmof9Vyg2lpKNX2ioe7CJdf9M5f8V9uaQxInenZkOxnTVL3fhAw==",
"cpu": [
"x64"
],
"license": "MIT",
"optional": true,
"os": [
"darwin"
],
"engines": {
"node": ">= 10"
}
},
"node_modules/@tailwindcss/oxide-freebsd-x64": {
"version": "4.1.11",
"resolved": "https://registry.npmjs.org/@tailwindcss/oxide-freebsd-x64/-/oxide-freebsd-x64-4.1.11.tgz",
"integrity": "sha512-xdqKtbpHs7pQhIKmqVpxStnY1skuNh4CtbcyOHeX1YBE0hArj2romsFGb6yUmzkq/6M24nkxDqU8GYrKrz+UcA==",
"cpu": [
"x64"
],
"license": "MIT",
"optional": true,
"os": [
"freebsd"
],
"engines": {
"node": ">= 10"
}
},
"node_modules/@tailwindcss/oxide-linux-arm-gnueabihf": {
"version": "4.1.11",
"resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-arm-gnueabihf/-/oxide-linux-arm-gnueabihf-4.1.11.tgz",
"integrity": "sha512-ryHQK2eyDYYMwB5wZL46uoxz2zzDZsFBwfjssgB7pzytAeCCa6glsiJGjhTEddq/4OsIjsLNMAiMlHNYnkEEeg==",
"cpu": [
"arm"
],
"license": "MIT",
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">= 10"
}
},
"node_modules/@tailwindcss/oxide-linux-arm64-gnu": {
"version": "4.1.11",
"resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-arm64-gnu/-/oxide-linux-arm64-gnu-4.1.11.tgz",
"integrity": "sha512-mYwqheq4BXF83j/w75ewkPJmPZIqqP1nhoghS9D57CLjsh3Nfq0m4ftTotRYtGnZd3eCztgbSPJ9QhfC91gDZQ==",
"cpu": [
"arm64"
],
"license": "MIT",
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">= 10"
}
},
"node_modules/@tailwindcss/oxide-linux-arm64-musl": {
"version": "4.1.11",
"resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-arm64-musl/-/oxide-linux-arm64-musl-4.1.11.tgz",
"integrity": "sha512-m/NVRFNGlEHJrNVk3O6I9ggVuNjXHIPoD6bqay/pubtYC9QIdAMpS+cswZQPBLvVvEF6GtSNONbDkZrjWZXYNQ==",
"cpu": [
"arm64"
],
"license": "MIT",
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">= 10"
}
},
"node_modules/@tailwindcss/oxide-linux-x64-gnu": {
"version": "4.1.11",
"resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-x64-gnu/-/oxide-linux-x64-gnu-4.1.11.tgz",
"integrity": "sha512-YW6sblI7xukSD2TdbbaeQVDysIm/UPJtObHJHKxDEcW2exAtY47j52f8jZXkqE1krdnkhCMGqP3dbniu1Te2Fg==",
"cpu": [
"x64"
],
"license": "MIT",
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">= 10"
}
},
"node_modules/@tailwindcss/oxide-linux-x64-musl": {
"version": "4.1.11",
"resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-x64-musl/-/oxide-linux-x64-musl-4.1.11.tgz",
"integrity": "sha512-e3C/RRhGunWYNC3aSF7exsQkdXzQ/M+aYuZHKnw4U7KQwTJotnWsGOIVih0s2qQzmEzOFIJ3+xt7iq67K/p56Q==",
"cpu": [
"x64"
],
"license": "MIT",
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">= 10"
}
},
"node_modules/@tailwindcss/oxide-wasm32-wasi": {
"version": "4.1.11",
"resolved": "https://registry.npmjs.org/@tailwindcss/oxide-wasm32-wasi/-/oxide-wasm32-wasi-4.1.11.tgz",
"integrity": "sha512-Xo1+/GU0JEN/C/dvcammKHzeM6NqKovG+6921MR6oadee5XPBaKOumrJCXvopJ/Qb5TH7LX/UAywbqrP4lax0g==",
"bundleDependencies": [
"@napi-rs/wasm-runtime",
"@emnapi/core",
"@emnapi/runtime",
"@tybys/wasm-util",
"@emnapi/wasi-threads",
"tslib"
],
"cpu": [
"wasm32"
],
"license": "MIT",
"optional": true,
"dependencies": {
"@emnapi/core": "^1.4.3",
"@emnapi/runtime": "^1.4.3",
"@emnapi/wasi-threads": "^1.0.2",
"@napi-rs/wasm-runtime": "^0.2.11",
"@tybys/wasm-util": "^0.9.0",
"tslib": "^2.8.0"
},
"engines": {
"node": ">=14.0.0"
}
},
"node_modules/@tailwindcss/oxide-win32-arm64-msvc": {
"version": "4.1.11",
"resolved": "https://registry.npmjs.org/@tailwindcss/oxide-win32-arm64-msvc/-/oxide-win32-arm64-msvc-4.1.11.tgz",
"integrity": "sha512-UgKYx5PwEKrac3GPNPf6HVMNhUIGuUh4wlDFR2jYYdkX6pL/rn73zTq/4pzUm8fOjAn5L8zDeHp9iXmUGOXZ+w==",
"cpu": [
"arm64"
],
"license": "MIT",
"optional": true,
"os": [
"win32"
],
"engines": {
"node": ">= 10"
}
},
"node_modules/@tailwindcss/oxide-win32-x64-msvc": {
"version": "4.1.11",
"resolved": "https://registry.npmjs.org/@tailwindcss/oxide-win32-x64-msvc/-/oxide-win32-x64-msvc-4.1.11.tgz",
"integrity": "sha512-YfHoggn1j0LK7wR82TOucWc5LDCguHnoS879idHekmmiR7g9HUtMw9MI0NHatS28u/Xlkfi9w5RJWgz2Dl+5Qg==",
"cpu": [
"x64"
],
"license": "MIT",
"optional": true,
"os": [
"win32"
],
"engines": {
"node": ">= 10"
}
},
"node_modules/@tailwindcss/oxide/node_modules/detect-libc": {
"version": "2.0.4",
"resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.4.tgz",
"integrity": "sha512-3UDv+G9CsCKO1WKMGw9fwq/SWJYbI0c5Y7LU1AXYoDdbhE2AHQ6N6Nb34sG8Fj7T5APy8qXDCKuuIHd1BR0tVA==",
"license": "Apache-2.0",
"engines": {
"node": ">=8"
}
},
"node_modules/@tailwindcss/vite": {
"version": "4.1.11",
"resolved": "https://registry.npmjs.org/@tailwindcss/vite/-/vite-4.1.11.tgz",
"integrity": "sha512-RHYhrR3hku0MJFRV+fN2gNbDNEh3dwKvY8XJvTxCSXeMOsCRSr+uKvDWQcbizrHgjML6ZmTE5OwMrl5wKcujCw==",
"license": "MIT",
"dependencies": {
"@tailwindcss/node": "4.1.11",
"@tailwindcss/oxide": "4.1.11",
"tailwindcss": "4.1.11"
},
"peerDependencies": {
"vite": "^5.2.0 || ^6 || ^7"
}
},
"node_modules/@tybys/wasm-util": {
"version": "0.10.0",
"resolved": "https://registry.npmjs.org/@tybys/wasm-util/-/wasm-util-0.10.0.tgz",
@ -7498,6 +7771,19 @@
"once": "^1.4.0"
}
},
"node_modules/enhanced-resolve": {
"version": "5.18.2",
"resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.18.2.tgz",
"integrity": "sha512-6Jw4sE1maoRJo3q8MsSIn2onJFbLTOjY9hlx4DZXmOKvLRd1Ok2kXmAGXaafL2+ijsJZ1ClYbl/pmqr9+k4iUQ==",
"license": "MIT",
"dependencies": {
"graceful-fs": "^4.2.4",
"tapable": "^2.2.0"
},
"engines": {
"node": ">=10.13.0"
}
},
"node_modules/entities": {
"version": "4.5.0",
"resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz",
@ -9893,6 +10179,243 @@
"node": ">= 0.8.0"
}
},
"node_modules/lightningcss": {
"version": "1.30.1",
"resolved": "https://registry.npmjs.org/lightningcss/-/lightningcss-1.30.1.tgz",
"integrity": "sha512-xi6IyHML+c9+Q3W0S4fCQJOym42pyurFiJUHEcEyHS0CeKzia4yZDEsLlqOFykxOdHpNy0NmvVO31vcSqAxJCg==",
"license": "MPL-2.0",
"dependencies": {
"detect-libc": "^2.0.3"
},
"engines": {
"node": ">= 12.0.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/parcel"
},
"optionalDependencies": {
"lightningcss-darwin-arm64": "1.30.1",
"lightningcss-darwin-x64": "1.30.1",
"lightningcss-freebsd-x64": "1.30.1",
"lightningcss-linux-arm-gnueabihf": "1.30.1",
"lightningcss-linux-arm64-gnu": "1.30.1",
"lightningcss-linux-arm64-musl": "1.30.1",
"lightningcss-linux-x64-gnu": "1.30.1",
"lightningcss-linux-x64-musl": "1.30.1",
"lightningcss-win32-arm64-msvc": "1.30.1",
"lightningcss-win32-x64-msvc": "1.30.1"
}
},
"node_modules/lightningcss-darwin-arm64": {
"version": "1.30.1",
"resolved": "https://registry.npmjs.org/lightningcss-darwin-arm64/-/lightningcss-darwin-arm64-1.30.1.tgz",
"integrity": "sha512-c8JK7hyE65X1MHMN+Viq9n11RRC7hgin3HhYKhrMyaXflk5GVplZ60IxyoVtzILeKr+xAJwg6zK6sjTBJ0FKYQ==",
"cpu": [
"arm64"
],
"license": "MPL-2.0",
"optional": true,
"os": [
"darwin"
],
"engines": {
"node": ">= 12.0.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/parcel"
}
},
"node_modules/lightningcss-darwin-x64": {
"version": "1.30.1",
"resolved": "https://registry.npmjs.org/lightningcss-darwin-x64/-/lightningcss-darwin-x64-1.30.1.tgz",
"integrity": "sha512-k1EvjakfumAQoTfcXUcHQZhSpLlkAuEkdMBsI/ivWw9hL+7FtilQc0Cy3hrx0AAQrVtQAbMI7YjCgYgvn37PzA==",
"cpu": [
"x64"
],
"license": "MPL-2.0",
"optional": true,
"os": [
"darwin"
],
"engines": {
"node": ">= 12.0.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/parcel"
}
},
"node_modules/lightningcss-freebsd-x64": {
"version": "1.30.1",
"resolved": "https://registry.npmjs.org/lightningcss-freebsd-x64/-/lightningcss-freebsd-x64-1.30.1.tgz",
"integrity": "sha512-kmW6UGCGg2PcyUE59K5r0kWfKPAVy4SltVeut+umLCFoJ53RdCUWxcRDzO1eTaxf/7Q2H7LTquFHPL5R+Gjyig==",
"cpu": [
"x64"
],
"license": "MPL-2.0",
"optional": true,
"os": [
"freebsd"
],
"engines": {
"node": ">= 12.0.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/parcel"
}
},
"node_modules/lightningcss-linux-arm-gnueabihf": {
"version": "1.30.1",
"resolved": "https://registry.npmjs.org/lightningcss-linux-arm-gnueabihf/-/lightningcss-linux-arm-gnueabihf-1.30.1.tgz",
"integrity": "sha512-MjxUShl1v8pit+6D/zSPq9S9dQ2NPFSQwGvxBCYaBYLPlCWuPh9/t1MRS8iUaR8i+a6w7aps+B4N0S1TYP/R+Q==",
"cpu": [
"arm"
],
"license": "MPL-2.0",
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">= 12.0.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/parcel"
}
},
"node_modules/lightningcss-linux-arm64-gnu": {
"version": "1.30.1",
"resolved": "https://registry.npmjs.org/lightningcss-linux-arm64-gnu/-/lightningcss-linux-arm64-gnu-1.30.1.tgz",
"integrity": "sha512-gB72maP8rmrKsnKYy8XUuXi/4OctJiuQjcuqWNlJQ6jZiWqtPvqFziskH3hnajfvKB27ynbVCucKSm2rkQp4Bw==",
"cpu": [
"arm64"
],
"license": "MPL-2.0",
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">= 12.0.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/parcel"
}
},
"node_modules/lightningcss-linux-arm64-musl": {
"version": "1.30.1",
"resolved": "https://registry.npmjs.org/lightningcss-linux-arm64-musl/-/lightningcss-linux-arm64-musl-1.30.1.tgz",
"integrity": "sha512-jmUQVx4331m6LIX+0wUhBbmMX7TCfjF5FoOH6SD1CttzuYlGNVpA7QnrmLxrsub43ClTINfGSYyHe2HWeLl5CQ==",
"cpu": [
"arm64"
],
"license": "MPL-2.0",
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">= 12.0.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/parcel"
}
},
"node_modules/lightningcss-linux-x64-gnu": {
"version": "1.30.1",
"resolved": "https://registry.npmjs.org/lightningcss-linux-x64-gnu/-/lightningcss-linux-x64-gnu-1.30.1.tgz",
"integrity": "sha512-piWx3z4wN8J8z3+O5kO74+yr6ze/dKmPnI7vLqfSqI8bccaTGY5xiSGVIJBDd5K5BHlvVLpUB3S2YCfelyJ1bw==",
"cpu": [
"x64"
],
"license": "MPL-2.0",
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">= 12.0.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/parcel"
}
},
"node_modules/lightningcss-linux-x64-musl": {
"version": "1.30.1",
"resolved": "https://registry.npmjs.org/lightningcss-linux-x64-musl/-/lightningcss-linux-x64-musl-1.30.1.tgz",
"integrity": "sha512-rRomAK7eIkL+tHY0YPxbc5Dra2gXlI63HL+v1Pdi1a3sC+tJTcFrHX+E86sulgAXeI7rSzDYhPSeHHjqFhqfeQ==",
"cpu": [
"x64"
],
"license": "MPL-2.0",
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">= 12.0.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/parcel"
}
},
"node_modules/lightningcss-win32-arm64-msvc": {
"version": "1.30.1",
"resolved": "https://registry.npmjs.org/lightningcss-win32-arm64-msvc/-/lightningcss-win32-arm64-msvc-1.30.1.tgz",
"integrity": "sha512-mSL4rqPi4iXq5YVqzSsJgMVFENoa4nGTT/GjO2c0Yl9OuQfPsIfncvLrEW6RbbB24WtZ3xP/2CCmI3tNkNV4oA==",
"cpu": [
"arm64"
],
"license": "MPL-2.0",
"optional": true,
"os": [
"win32"
],
"engines": {
"node": ">= 12.0.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/parcel"
}
},
"node_modules/lightningcss-win32-x64-msvc": {
"version": "1.30.1",
"resolved": "https://registry.npmjs.org/lightningcss-win32-x64-msvc/-/lightningcss-win32-x64-msvc-1.30.1.tgz",
"integrity": "sha512-PVqXh48wh4T53F/1CCu8PIPCxLzWyCnn/9T5W1Jpmdy5h9Cwd+0YQS6/LwhHXSafuc61/xg9Lv5OrCby6a++jg==",
"cpu": [
"x64"
],
"license": "MPL-2.0",
"optional": true,
"os": [
"win32"
],
"engines": {
"node": ">= 12.0.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/parcel"
}
},
"node_modules/lightningcss/node_modules/detect-libc": {
"version": "2.0.4",
"resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.4.tgz",
"integrity": "sha512-3UDv+G9CsCKO1WKMGw9fwq/SWJYbI0c5Y7LU1AXYoDdbhE2AHQ6N6Nb34sG8Fj7T5APy8qXDCKuuIHd1BR0tVA==",
"license": "Apache-2.0",
"engines": {
"node": ">=8"
}
},
"node_modules/lilconfig": {
"version": "3.1.3",
"resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-3.1.3.tgz",
@ -13216,6 +13739,21 @@
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/tailwindcss": {
"version": "4.1.11",
"resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-4.1.11.tgz",
"integrity": "sha512-2E9TBm6MDD/xKYe+dvJZAmg3yxIEDNRc0jwlNyDg/4Fil2QcSLjFKGVff0lAf1jjeaArlG/M75Ey/EYr/OJtBA==",
"license": "MIT"
},
"node_modules/tapable": {
"version": "2.2.2",
"resolved": "https://registry.npmjs.org/tapable/-/tapable-2.2.2.tgz",
"integrity": "sha512-Re10+NauLTMCudc7T5WLFLAwDhQ0JWdrMK+9B2M8zR5hRExKmsRDCBA7/aV/pNJFltmBFO5BAMlQFi/vq3nKOg==",
"license": "MIT",
"engines": {
"node": ">=6"
}
},
"node_modules/tar": {
"version": "7.4.3",
"resolved": "https://registry.npmjs.org/tar/-/tar-7.4.3.tgz",

View File

@ -16,7 +16,9 @@
"dependencies": {
"@nuxt/eslint": "1.6.0",
"@nuxt/icon": "^1.15.0",
"@tailwindcss/vite": "^4.1.11",
"nuxt": "^4.0.1",
"tailwindcss": "^4.1.11",
"vue": "^3.5.17",
"vue-router": "^4.5.1"
},