iPersona / blog

blog written by rust with actix

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

About

This is my personal blog.

Architecture

img

Dependences

  • Redis
  • Postgresql

Getting Started

$ curl https://sh.rustup.rs -sSf | sh

This project use Diesel as Orm framework, so you need to install its command line tool via Rust package manager(eg, Cargo)

$ cargo install diesel_cli --no-default-features --features postgres

you need to install Postgresql database, and then configure postgresql by following document’s guide

Install the corresponding version of contrib

$ yum install postgresql96-contrib

init database

$ ./init.sh # press 3 to init database
$ diesel migration run # this will renew schema.rs without view created in create_tags/up.sql

Diesel.rs Trick: Treat View as Table

nginx has been used in the development of the time

config:
server {
        listen       8880;
        server_name  127.0.0.1;

        location / {
            proxy_pass http://127.0.0.1:8080;
            proxy_redirect off;
            proxy_set_header Host $host;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        }

        location /api/v1/ {
            proxy_pass http://127.0.0.1:8888/;
            proxy_redirect off;
            proxy_set_header Host $host;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        }

Ref: Accessing host machine from within docker container Docker Desktop for Mac docker

blog

$ cargo run --bin blog_web // listen on 127.0.0.1:8080

$ cargo run --bin blog_api // listen on 127.0.0.1:8888

if you want to login admin, the account is admin, password is admin

About

blog written by rust with actix

License:MIT License


Languages

Language:Rust 37.5%Language:HTML 19.7%Language:Vue 19.6%Language:JavaScript 18.2%Language:CSS 3.9%Language:PLpgSQL 0.7%Language:Shell 0.4%Language:Lua 0.1%