4 # Set the database variable to the default first.
5 # Don't forget to change this string to your actual database parameters
6 # if you don't plan to initialize the database in this script.
7 export LEMMY_DATABASE_URL=postgres://lemmy:password@localhost:5432/lemmy
9 # Set other environment variables
10 export JWT_SECRET=changeme
13 # Optionally initialize the database
16 while [ "$init_db_valid" == 0 ]
18 read -p "Initialize database (y/n)? " init_db
19 case "${init_db,,}" in
20 y|yes ) init_db_valid=1; init_db_final=1;;
21 n|no ) init_db_valid=1; init_db_final=0;;
22 * ) echo "Invalid input" 1>&2;;
26 if [ "$init_db_final" = 1 ]
28 source ./server/db-init.sh
29 read -n 1 -s -r -p "Press ANY KEY to continue execution of this script, press CTRL+C to quit..."
33 # Build the web client
38 # Build and run the backend
40 RUST_LOG=debug cargo run
42 # For live coding, where both the front and back end, automagically reload on any save, do:
44 # cd server && cargo watch -x run