A mobile app for listening to radio stations from around the globe
git clone git://soophie.de/verbal
7
package-lock.json8
Cargo.lock9
www/asset/css/style.css10
*.vim
8
app: null,9
tab: 'search',10
account: {11
username: 'typable',11
username: '',12
language: 'en'13
},14
station: {15
name: 'Liquid Trap',16
favicon: 'https://cdn-images.audioaddict.com/6/b/5/b/d/6/6b5bd66a99e46fa1258cb565d988ea7c.jpg',17
is_favorite: true18
}14
station: null15
};17
(async () => {
31
mounted() {32
document.body.style.display = '';33
state.app = this;34
this.init();35
},36
methods: {37
async init() {38
state.account = await http`get::/api/account`();39
}40
},41
template: `42
<div class="px-4 sm:px-10 pb-8 sm:pb-[100px] max-w-[800px] mx-auto flex flex-col">
55
/* provide app */56
app.at("/app").serve_dir("app/")?;58
app.at("/api/account")59
.get(|req: tide::Request<()>| async move {60
let account = req.ext::<model::Account>().unwrap();61
let data: data::Account = (*account).clone().into();62
Response::with(data)63
});65
app.at("/api/search")66
.get(|req: tide::Request<()>| async move {67
let search = match req.query::<Search>() {
1
use sqlx::FromRow;3
#[derive(Debug, FromRow)]3
#[derive(Debug, Clone, FromRow)]4
pub struct Account {5
pub id: i32,6
pub username: Option<String>,
8
pub is_playback_history: bool,9
}11
#[derive(Debug, FromRow)]11
#[derive(Debug, Clone, FromRow)]12
pub struct Device {13
pub id: i32,14
pub token: String,