feat: initialize thoughts-frontend with Next.js, TypeScript, and ESLint

- Add ESLint configuration for Next.js and TypeScript support.
- Create Next.js configuration file with standalone output option.
- Initialize package.json with scripts for development, build, and linting.
- Set up PostCSS configuration for Tailwind CSS.
- Add SVG assets for UI components.
- Create TypeScript configuration for strict type checking and module resolution.
This commit is contained in:
2025-09-05 17:14:45 +02:00
parent 6bd06ff2c8
commit e5747eaaf3
104 changed files with 7484 additions and 0 deletions

View File

@@ -0,0 +1,24 @@
pub struct Config {
pub db_url: String,
pub host: String,
pub port: u32,
pub prefork: bool,
}
impl Config {
pub fn from_env() -> Config {
Config {
db_url: std::env::var("DATABASE_URL").expect("DATABASE_URL is not set in .env file"),
host: std::env::var("HOST").expect("HOST is not set in .env file"),
port: std::env::var("PORT")
.expect("PORT is not set in .env file")
.parse()
.expect("PORT is not a number"),
prefork: std::env::var("PREFORK").is_ok_and(|v| v == "1"),
}
}
pub fn get_server_url(&self) -> String {
format!("{}:{}", self.host, self.port)
}
}