Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nhachicha/rust-blog-engine
A demo blog post engine in Rust, using Rocket and MongoDB
https://github.com/nhachicha/rust-blog-engine
mongodb oauth2 rocket rust rust-lang tera
Last synced: 3 days ago
JSON representation
A demo blog post engine in Rust, using Rocket and MongoDB
- Host: GitHub
- URL: https://github.com/nhachicha/rust-blog-engine
- Owner: nhachicha
- Created: 2021-12-15T00:13:09.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2021-12-15T01:33:20.000Z (almost 3 years ago)
- Last Synced: 2023-03-24T05:51:10.954Z (over 1 year ago)
- Topics: mongodb, oauth2, rocket, rust, rust-lang, tera
- Language: Rust
- Homepage:
- Size: 2.87 MB
- Stars: 6
- Watchers: 2
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
A demo blog post engine written in Rust, using [Rocket](https://rocket.rs/) and [MongoDB](mongodb.com)
# Quick Start
- Setup a new MongoDB cluster https://cloud.mongodb.com/ create a new database and obtain the rust connection string (under Database/Connect)
example (`mongodb+srv://:@XXXX.mongodb.net/myFirstDatabase?retryWrites=true&w=majority`)- Create a database `rust_blog_engine`
- Add a collection `authorization` containing authorized users id (Google user id)
```Javascript
{
"_id": "116710526826489061000",
"email": "[email protected]",
"name": "Nabil Hachicha"
}
```- Add a collection `blogs` which will persist our blog posts entries.
- Setup a Google OAuth2 API and add the `client_id` and `client_secret` inside the [Rocket.toml](/Rocket.toml) file.
- Start the engine using `cargo run` and providing the MongoDB connection string
```Shell
MDB_URL="mongodb+srv://:@XXXX.mongodb.net/myFirstDatabase?retryWrites=true&w=majority" cargo run
```# Preview
### Home
### Login
### Admin
### New Blog
### Edit Blog