diff --git a/AGENT.md b/AGENT.md index c8682f6b..5ee040d3 100644 --- a/AGENT.md +++ b/AGENT.md @@ -60,3 +60,7 @@ bloop/ ts-rs allows you to derive TypeScript types from Rust structs/enums. By annotating your Rust types with #[derive(TS)] and related macros, ts-rs will generate .ts declaration files for those types. When making changes to the types, you can regenerate them using `npm run generate-types` Do not manually edit shared/types.ts + +# Process + +When working on any task that involves changes to the backend and the frontend, start with the backend. If any shared types need to be regenerated, regenerate them before starting the frontend changes. diff --git a/backend/src/auth.rs b/backend/src/auth.rs index c47b08ad..61a7426d 100644 --- a/backend/src/auth.rs +++ b/backend/src/auth.rs @@ -1,8 +1,7 @@ use axum::{ async_trait, extract::FromRequestParts, - http::{request::Parts, StatusCode, HeaderMap}, - RequestPartsExt, + http::{request::Parts, StatusCode}, }; use jsonwebtoken::{decode, encode, DecodingKey, EncodingKey, Header, Validation}; use serde::{Deserialize, Serialize}; diff --git a/backend/src/bin/generate_types.rs b/backend/src/bin/generate_types.rs index 8b4dcea9..e6d06f13 100644 --- a/backend/src/bin/generate_types.rs +++ b/backend/src/bin/generate_types.rs @@ -3,10 +3,6 @@ use std::path::Path; use ts_rs::TS; // Import all the types we want to export using the library crate -use bloop_backend::models::{ - ApiResponse, CreateProject, CreateUser, LoginRequest, LoginResponse, Project, UpdateProject, - UpdateUser, UserResponse, -}; fn main() { let shared_path = Path::new("../shared"); diff --git a/backend/src/main.rs b/backend/src/main.rs index 49565727..a6ed175c 100644 --- a/backend/src/main.rs +++ b/backend/src/main.rs @@ -7,7 +7,6 @@ use axum::{ use sqlx::postgres::PgPoolOptions; use std::env; use tower_http::cors::CorsLayer; -use tracing_subscriber; mod auth; mod models; diff --git a/backend/src/models/mod.rs b/backend/src/models/mod.rs index c990fdb2..d6f6240f 100644 --- a/backend/src/models/mod.rs +++ b/backend/src/models/mod.rs @@ -1,9 +1,6 @@ -pub mod user; +pub mod api_response; pub mod project; pub mod task; -pub mod api_response; +pub mod user; -pub use user::{User, CreateUser, UpdateUser, LoginRequest, LoginResponse, UserResponse}; -pub use project::{Project, CreateProject, UpdateProject}; -pub use task::{Task, TaskStatus}; pub use api_response::ApiResponse; diff --git a/backend/src/routes/projects.rs b/backend/src/routes/projects.rs index 51c06f1c..a8113873 100644 --- a/backend/src/routes/projects.rs +++ b/backend/src/routes/projects.rs @@ -1,5 +1,5 @@ use axum::{ - routing::{get, post, put, delete}, + routing::get, Router, Json, response::Json as ResponseJson, diff --git a/backend/src/routes/users.rs b/backend/src/routes/users.rs index c964bd6e..d1fd82dc 100644 --- a/backend/src/routes/users.rs +++ b/backend/src/routes/users.rs @@ -1,5 +1,5 @@ use axum::{ - routing::{get, post, put, delete}, + routing::{get, post}, Router, Json, response::Json as ResponseJson,