50 lines
1.0 KiB
Rust
50 lines
1.0 KiB
Rust
mod database;
|
|
mod helpers;
|
|
mod model;
|
|
mod servek;
|
|
mod svc;
|
|
|
|
use database::db::DB;
|
|
use serde::{Deserialize, Serialize};
|
|
use servek::servek::Server;
|
|
use svc::profiles::Profiler;
|
|
|
|
#[derive(Clone, Copy, Serialize, Deserialize)]
|
|
pub enum ActivityKind {
|
|
Create,
|
|
Like,
|
|
Note,
|
|
}
|
|
|
|
#[derive(Clone, Serialize, Deserialize)]
|
|
pub struct ActivityLD {
|
|
pub context_uri: String,
|
|
pub kind: ActivityKind,
|
|
pub actor_uri: String,
|
|
pub to_uris: Vec<String>,
|
|
pub object: Option<ObjectLD>,
|
|
}
|
|
|
|
#[derive(Clone, Serialize, Deserialize)]
|
|
pub struct ObjectLD {
|
|
pub context_uri: String,
|
|
pub id: Option<String>,
|
|
pub kind: Option<ActivityKind>,
|
|
pub attributed_to: Option<String>,
|
|
pub published: Option<String>,
|
|
pub content: Option<String>,
|
|
}
|
|
|
|
#[tokio::main]
|
|
async fn main() -> Result<(), anyhow::Error> {
|
|
let db = DB::new(
|
|
"localhost".to_owned(),
|
|
"flabk".to_owned(),
|
|
"flabk".to_owned(),
|
|
)
|
|
.await?;
|
|
let profiler = Profiler::new(db.users());
|
|
Server::new(profiler).listen_and_serve(8008).await;
|
|
Ok(())
|
|
}
|