Zero To Production In Rust는 Rust를 사용한 백엔드 개발에 관한 주관적인 소개이다.
이 저장소는 이 책의 보충 자료로 제공된다. 책 전체에서 설명하는 이메일 뉴스레터 프로젝트의 코드 베이스 스냅샷을 담고 있다.
main
브랜치는 책 마지막의 프로젝트를 나타낸다.
각 장 마지막의 프로젝트는 개별 브랜치를 전환해서 확인할 수 있다:
- 3장, Part 0
- 3장, Part 1
- 4장
- 5장
- 6장, Part 0
- 6장, Part 1
- 7장, Part 0
- 7장, Part 1
- 7장, Part 2
- 8장
- 9장
- 10장, Part 0
- 10장, Part 1
- 10장, Part 2
- 10장, Part 3
- 11장
다음을 설치해야 한다:
다음은 OS별 요구 사항이다.
cargo install -f cargo-binutils
rustup component add llvm-tools-preview
cargo install --version="~0.6" sqlx-cli --no-default-features --features rustls,postgres
# Ubuntu
sudo apt-get install lld clang libssl-dev postgresql-client
# Arch
sudo pacman -S lld clang postgresql
cargo install --version="~0.6" sqlx-cli --no-default-features --features rustls,postgres
brew install michaeleisel/zld/zld
cargo install --version="~0.6" sqlx-cli --no-default-features --features rustls,postgres
도커를 경유해서 (마이그레이트 된) Postgres 데이터베이스를 기동한다:
./scripts/init_db.sh
도커를 경유해서 Reids 인스턴스를 기동한다:
./scripts/init_redis.sh
cargo
를 기동한다:
cargo build
cargo run
을 사용해서 웹 서버를 기동한 뒤, 브라우저에서 http://127.0.0.1:8000/login에
접근할 수 있다.
기본 admin
계정의 비밀번호는 everythinghastostartsomewhere
이며, 접근할 수 있는
엔드포인트들은 src/startup.rs에 리스팅되어 있다.
도커를 경유해서 (마이그레이트 된) Postgres 데이터베이스를 기동한다:
./scripts/init_db.sh
도커를 경유해서 Redis 인스턴스를 기동한다:
./scripts/init_redis.sh
Launch cargo
:
cargo test
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.