Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

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