-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
49 lines (39 loc) · 1010 Bytes
/
install.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/usr/bin/env bash
# exit on error
set -o errexit
echo "Starting app setup..."
### CLIENT SETUP
cd client
npm i --prefix
npm run build --prefix
cd ../server
touch .env
### DATABASE SETUP
echo "Enter your PostgreSQL host (default is localhost)":
read host
host=${host:="localhost"}
echo "DB_HOST = $host" >> .env
echo "Enter the port number (default is 5432)":
read port
port=${host:="5432"}
echo "DB_PORT = $port" >> .env
echo "Enter your PostgreSQL database name (default is postgres):"
read name
name=${name:="postgres"}
echo "DB_NAME = $name" >> .env
echo "Enter your PostgreSQL username (default is same as tablename)":
read username
username=${username:=$name}
echo "DB_USERNAME = $username" >> .env
while true; do
echo "Enter your PostgreSQL password:"
read password
test "$password" != "" && break
done
echo "DB_PASSWORD = $password" >> .env
### SERVER VIRTUAL ENVIRONMENT SETUP
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
### LAUNCH SERVER
python main.py