diff --git a/.gitignore b/.gitignore index 8bd15663df..a6c235ffa0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,12 @@ # Generated by Cargo # will have compiled files and executables +# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries +# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html +# backend /target/ +./backend/.env +./backend/configuration/base.yaml +Cargo.lock # These are backup files generated by rustfmt **/*.rs.bk diff --git a/backend/.env.example b/backend/.env.example new file mode 100644 index 0000000000..8ee6c6b1d5 --- /dev/null +++ b/backend/.env.example @@ -0,0 +1 @@ +DATABASE_URL="postgres://postgres:password@localhost:5433/flowy" \ No newline at end of file diff --git a/backend/configuration/base.example.yaml b/backend/configuration/base.example.yaml new file mode 100644 index 0000000000..4b78eb1b42 --- /dev/null +++ b/backend/configuration/base.example.yaml @@ -0,0 +1,9 @@ +application: + port: 8000 + host: 0.0.0.0 +database: + host: "localhost" + port: 5433 + username: "postgres" + password: "password" + database_name: "flowy" diff --git a/doc/BUILD_ON_LINUX.md b/doc/BUILD_ON_LINUX.md index d95828aedb..98e0b20447 100644 --- a/doc/BUILD_ON_LINUX.md +++ b/doc/BUILD_ON_LINUX.md @@ -34,7 +34,15 @@ source $HOME/.cargo/env rustup toolchain install nightly rustup default nightly ``` -3. Install flutter according to https://docs.flutter.dev/get-started/install/linux + +3. env settings +``` shell +cp backend/configuration/base.example.yaml backend/configuration/base.yaml +cp backend/configuration/.env.example backend/configuration/.env +``` +modify those file + +4. Install flutter according to https://docs.flutter.dev/get-started/install/linux ```shell git clone https://github.com/flutter/flutter.git cd flutter @@ -43,28 +51,30 @@ export PATH="$PATH:`pwd`/bin" flutter channel dev flutter config --enable-linux-desktop ``` -4. Fix problem reported by flutter doctor +5. Fix problem reported by flutter doctor ```shell flutter doctor ``` -5. Install cargo make +6. Install cargo make ```shell cd appflowy/frontend cargo install --force cargo-make ``` -6. Install duckscript +7. Install duckscript ```shell cargo install --force duckscript_cli ``` -7. Check pre-request +8. Check pre-request ```shell cargo make flowy_dev ``` -8. [Optional] Generate protobuf for dart (optional, if you modify the shared-lib's entities) + +9. [Optional] Generate protobuf for dart (optional, if you modify the shared-lib's entities) ```shell cargo make -p development-linux-x86 pb ``` -9. [Optional] Build flowy-sdk-dev (dart-ffi), step 10 covers this step +10. [Optional] Build flowy-sdk-dev (dart-ffi), step 10 covers this step + ```shell # for development cargo make --profile development-linux-x86 flowy-sdk-dev @@ -72,7 +82,8 @@ cargo make --profile development-linux-x86 flowy-sdk-dev # for production cargo make --profile production-linux-x86 flowy-sdk-release ``` -10. Build app_flowy + +11. Build app_flowy ```shell # for development cargo make -p development-linux-x86 appflowy-linux-dev