-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add routes for tracking command usage via influxdb Add routes for getting analytics like cmd usage Update year in LICENSE Response code cleanup Make get post route work with slugs and only public/unlisted visibility Add new features to readme
- Loading branch information
1 parent
c702fc9
commit 6a04305
Showing
30 changed files
with
814 additions
and
271 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,15 @@ | ||
# Dustin API | ||
# dstn.to API | ||
|
||
There is probably a lot of better ways to do many of the things I've done here, but this is one of the first things I've done in rust, make suggestions if you see anything done weirdly! | ||
|
||
Built with actix-web, makes use of prisma to handle queries to a postgresql database and uses valkey/redis for storage of tokens and caching data. | ||
|
||
## Used for | ||
|
||
- Spotify History and Now Playing API / Queue Messages | ||
- File and Screenshot Uploads | ||
- Spotify History and Now Playing API / Provides realtime queue for [gateway](https://github.com/dustinrouillard/dustin-gateway) | ||
- File and Screenshot Uploads (Multipart uploads to an s3 bucket) | ||
- Github pinned repositories | ||
- Blog System for Personal Site | ||
- Blog System for [Personal Site](https://github.com/dustinrouillard/personal-site) | ||
- Local weather (This just proxies my [weather worker](https://github.com/dustinrouillard/weather-worker)) | ||
- Analytics tracking (commands per day, etc) | ||
- Prometheus metrics (API route and process metrics) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
use envconfig::Envconfig; | ||
use influxdb2::Client; | ||
|
||
use crate::config::Config; | ||
|
||
#[derive(Clone)] | ||
pub struct InfluxManager { | ||
pub client: Client, | ||
} | ||
|
||
impl InfluxManager { | ||
pub async fn new() -> Self { | ||
let config = Config::init_from_env().unwrap(); | ||
let client = influxdb2::Client::new( | ||
config.influxdb_host, | ||
config.influxdb_org, | ||
config.influxdb_token, | ||
); | ||
|
||
tracing::info!("Connected to influxdb"); | ||
Self { client } | ||
} | ||
} |
Oops, something went wrong.