Compare commits
2 commits
f066aafd6a
...
8c022d6eec
| Author | SHA1 | Date | |
|---|---|---|---|
| 8c022d6eec | |||
| 2d1efbc179 |
3 changed files with 51 additions and 5 deletions
36
schema.sql
Normal file
36
schema.sql
Normal file
|
|
@ -0,0 +1,36 @@
|
||||||
|
DO $$
|
||||||
|
BEGIN
|
||||||
|
CREATE TYPE link_type as ENUM ('article', 'blog');
|
||||||
|
EXCEPTION
|
||||||
|
WHEN duplicate_object THEN null;
|
||||||
|
END
|
||||||
|
$$;
|
||||||
|
|
||||||
|
CREATE TABLE IF NOT EXISTS articles (
|
||||||
|
reference varchar(20) not null,
|
||||||
|
title varchar(50) not null,
|
||||||
|
previous varchar(20),
|
||||||
|
next varchar(20),
|
||||||
|
description text,
|
||||||
|
content text not null,
|
||||||
|
date date not null,
|
||||||
|
id serial primary key);
|
||||||
|
|
||||||
|
CREATE TABLE IF NOT EXISTS links (
|
||||||
|
url varchar(100) not null,
|
||||||
|
date_added date not null,
|
||||||
|
description text,
|
||||||
|
title text not null,
|
||||||
|
author varchar(50) not null,
|
||||||
|
link_type link_type not null,
|
||||||
|
id serial primary key);
|
||||||
|
|
||||||
|
CREATE TABLE IF NOT EXISTS users (
|
||||||
|
id integer PRIMARY KEY GENERATED ALWAYS AS IDENTITY,
|
||||||
|
username text NOT NULL UNIQUE,
|
||||||
|
password text NOT NULL,
|
||||||
|
admin boolean NOT NULL);
|
||||||
|
|
||||||
|
CREATE TABLE IF NOT EXISTS sessions (
|
||||||
|
session_token BYTEA PRIMARY KEY,
|
||||||
|
user_id integer REFERENCES users (id) ON DELETE CASCADE NOT NULL);
|
||||||
12
src/lib.rs
12
src/lib.rs
|
|
@ -1,6 +1,6 @@
|
||||||
#![allow(async_fn_in_trait)]
|
#![allow(async_fn_in_trait)]
|
||||||
use crate::database::article::load_articles;
|
use crate::database::article::load_articles;
|
||||||
use sqlx::PgPool;
|
use sqlx::{Executor, PgPool};
|
||||||
use std::error::Error;
|
use std::error::Error;
|
||||||
use tracing::info;
|
use tracing::info;
|
||||||
use tracing_subscriber::{layer::SubscriberExt, util::SubscriberInitExt};
|
use tracing_subscriber::{layer::SubscriberExt, util::SubscriberInitExt};
|
||||||
|
|
@ -11,7 +11,10 @@ mod errors;
|
||||||
mod html;
|
mod html;
|
||||||
mod macros;
|
mod macros;
|
||||||
|
|
||||||
pub async fn run_server(pool: PgPool) -> std::io::Result<()> {
|
pub async fn run_server(pool: PgPool) -> Result<(), Box<dyn Error>> {
|
||||||
|
pool.execute(include_str!("../schema.sql"))
|
||||||
|
.await?;
|
||||||
|
|
||||||
tracing_subscriber::registry()
|
tracing_subscriber::registry()
|
||||||
.with(
|
.with(
|
||||||
tracing_subscriber::EnvFilter::try_from_default_env()
|
tracing_subscriber::EnvFilter::try_from_default_env()
|
||||||
|
|
@ -19,11 +22,13 @@ pub async fn run_server(pool: PgPool) -> std::io::Result<()> {
|
||||||
)
|
)
|
||||||
.with(tracing_subscriber::fmt::layer())
|
.with(tracing_subscriber::fmt::layer())
|
||||||
.init();
|
.init();
|
||||||
|
|
||||||
info!("initializing router...");
|
info!("initializing router...");
|
||||||
let port = 21212_u16;
|
let port = 21212_u16;
|
||||||
let addr = std::net::SocketAddr::from(([0, 0, 0, 0], port));
|
let addr = std::net::SocketAddr::from(([0, 0, 0, 0], port));
|
||||||
let router = html::root::get_router(pool);
|
let router = html::root::get_router(pool);
|
||||||
info!("router initialized, now listening on port {}", port);
|
info!("router initialized, now listening on port {}", port);
|
||||||
|
|
||||||
match axum::Server::bind(&addr)
|
match axum::Server::bind(&addr)
|
||||||
.serve(router.into_make_service())
|
.serve(router.into_make_service())
|
||||||
.await
|
.await
|
||||||
|
|
@ -35,6 +40,9 @@ pub async fn run_server(pool: PgPool) -> std::io::Result<()> {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub async fn run_load(pool: &PgPool) -> Result<(), Box<dyn Error>> {
|
pub async fn run_load(pool: &PgPool) -> Result<(), Box<dyn Error>> {
|
||||||
|
pool.execute(include_str!("../schema.sql"))
|
||||||
|
.await?;
|
||||||
|
|
||||||
load_articles(pool).await?;
|
load_articles(pool).await?;
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@
|
||||||
Fullstack software development engineer, self-hoster, tinkerer, lifelong student.
|
Fullstack software development engineer, self-hoster, tinkerer, lifelong student.
|
||||||
For work I build configuration automation and testing tools, from backend database interactions to frontend UI.
|
For work I build configuration automation and testing tools, from backend database interactions to frontend UI.
|
||||||
At home I manage my own server, spend time on side projects, and study/read a wide variety of subjects.
|
At home I manage my own server, spend time on side projects, and study/read a wide variety of subjects.
|
||||||
|
I am passionate about building, fixing, and improving tools to help people, and always strive to improve my capacity to do so through collaboration and study.
|
||||||
</p>
|
</p>
|
||||||
<h3>Work Experience</h3>
|
<h3>Work Experience</h3>
|
||||||
<p>
|
<p>
|
||||||
|
|
@ -18,7 +19,7 @@
|
||||||
</p>
|
</p>
|
||||||
<ul>
|
<ul>
|
||||||
<li>Designed and migrated our platform to modern infrastructure (AWS) using modern tooling (React, ECS, Lambdas)</li>
|
<li>Designed and migrated our platform to modern infrastructure (AWS) using modern tooling (React, ECS, Lambdas)</li>
|
||||||
<li>Led design and implementation to onboard a tier 1 worldwide service to our configuration management platform</li>
|
<li>Led design and implementation to onboard a tier 1 worldwide service to our configuration management platform, collaborating with service owners and clients to design the new interface to fit their use cases</li>
|
||||||
<li>Implemented testing improvements resulting in ~$10M/year savings by reducing labor requirements and increasing granularity of testing controls</li>
|
<li>Implemented testing improvements resulting in ~$10M/year savings by reducing labor requirements and increasing granularity of testing controls</li>
|
||||||
<li>Provided regular oncall support for high severity events, assisting site teams in diagnosing issues and implementing fixes</li>
|
<li>Provided regular oncall support for high severity events, assisting site teams in diagnosing issues and implementing fixes</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
@ -29,7 +30,7 @@
|
||||||
<ul>
|
<ul>
|
||||||
<li>Provided customer support, both live support of issues and asynchronously through tickets</li>
|
<li>Provided customer support, both live support of issues and asynchronously through tickets</li>
|
||||||
<li>Worked with the development team to find bugs and improve the software</li>
|
<li>Worked with the development team to find bugs and improve the software</li>
|
||||||
<li>Educated customers in the functionality and use of the software</li>
|
<li>Assisted customers in learning to use the software and smoothing out their workflows</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
|
|
@ -74,7 +75,8 @@
|
||||||
<li>Media streaming/hosting service</li>
|
<li>Media streaming/hosting service</li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
<li>Builder: furniture, electronics</li>
|
<li>Scientific thinking and problem solving</li>
|
||||||
|
<li>Building: woodworking, electronics</li>
|
||||||
<li>Competitive athlete: Brazillian Jiu Jitsu</li>
|
<li>Competitive athlete: Brazillian Jiu Jitsu</li>
|
||||||
<li>Languages: English (native), French</li>
|
<li>Languages: English (native), French</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue