About
This is my personal blog, and its also my first Rust project.
Why Rust
Well, I know there are a lot of alternatives to writing a blog, but I find other languages such as Java, Python, Javascript,Php, are not fancy enough ;-) Kidding, the truth is that I have learned Rust for more that a half years, but I still could not build real some stuff on Rust. Yes, I lack of idea or I not am skillful enough to fulfill my thought. Finally, I decided to rewrite my blog which was built on Github Page and Org-mode.
Getting Started
Requirement
Rust
Install Rust via shell script
curl https://sh.rustup.rs -sSf | sh
After installing, you might need to
source $HOME/.cargo/bin
Because this project is built on Rocket, and Rocket depends on Rust nightly, so you need change Rust environment to nightly
rustup default nightly
Diesel Cli
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
Postgresql
you need to install Postgresql database, and then configure postgresql by following document’s guide
Init database
After everything is done, it is time to create table in database for this project, just run
diesel migration run
Launch Rocket
Everything is ok, now, launch Rocket:
cargo run
And open your favourite browser, enter localhost:8000
If you want to login admin page, you could enter localhost:8000/admin/login
Email: admin@samray.xyz
Password: 123456