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: 9 months 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 (over 4 years ago)
- Default Branch: master
- Last Pushed: 2021-12-15T01:33:20.000Z (over 4 years ago)
- Last Synced: 2025-04-07T02:11:58.485Z (about 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": "nabil.hachicha@gmail.com",
"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
