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;;
25 if [ "$init_db_final" = 1 ]
27 source ./server/db-init.sh
28 read -n 1 -s -r -p "Press ANY KEY to continue execution of this script, press CTRL+C to quit..."
31 # Build the web client
36 # Build and run the backend
40 # For live coding, where both the front and back end, automagically reload on any save, do:
42 # cd server && cargo watch -x run