936641c1653d0a8b04eee0d5801406f9d18d1f23
[vchess.git] / INSTALL_INSTRUCTIONS
1 ### DOWNLOAD REPO ###
2
3 git clone git@github.com:yagu0/vchess.git
4 # or https version: git clone https://github.com/yagu0/vchess.git
5 cd vchess
6
7 ### INSTALL TOOLS ###
8
9 # You need to install sqlite3, nodejs and npm (example for Ubuntu).
10 # wget & rsync help too, they are generally installed by default.
11 apt install sqlite3 nodejs npm
12
13 ### SERVER ###
14
15 cd server/db
16 sqlite3 vchess.sqlite
17 # And then within sqlite invite command:
18 .read create.sql
19 .read populate.sql
20 # Then exit sqlite (\q works)
21 # Rename dbconnect.py.dist --> dbconnect.py and edit DB path on line 7
22 # Then synchronize the GameStat table:
23 ./sync_gamestat.py
24
25 cd ../config
26 # Rename and edit parameters.js.dist --> parameters.js
27 # Rename and edit discord.json.dist --> discord.json
28 # NOTE: token *must be empty* locally in dev mode
29
30 cd ..
31 npm i
32 npm start
33
34 ### CLIENT ###
35
36 cd client/src
37 # Rename and edit parameters.js.dist --> parameters.js
38 # NOTE: parameters here and in server/config should be intuitive enough.
39 # if not, ask me or check in code :)
40
41 # Next step is just "git fat init && git fat pull" if I have your ssh key.
42 # NOTE: you should use your own strategy then, for binary files.
43 wget -r --no-parent https://xogo.fr/images/pieces/Eightpieces/tmp_png/
44 wget -r --no-parent https://xogo.fr/images/pieces/Otage/
45 wget -r --no-parent https://xogo.fr/images/pieces/Pacosako/
46 wget -r --no-parent https://xogo.fr/images/pieces/Titan/
47 rsync -a --exclude=index.html xogo.fr/images/ public/images/
48 wget -r --no-parent https://xogo.fr/variants/Empire/
49 wget -r --no-parent https://xogo.fr/variants/Orda/
50 wget -r --no-parent https://xogo.fr/variants/Xiangqi/
51 rsync -a --exclude=index.html xogo.fr/variants/ public/variants/
52 wget -r --no-parent https://xogo.fr/sounds/
53 rsync -a --exclude=index.html xogo.fr/sounds/ public/sounds/
54 rm -rf xogo.fr
55 wget -O public/favicon.ico https://xogo.fr/favicon.ico
56
57 # Generate Emergo + Avalam pieces
58 cd public/images/pieces/Emergo
59 ./generateSVG_simple.py
60 ./generateSVG_composite.py
61 cd ../Avalam
62 ./generateSVG.py
63
64 cd ../../../../
65 npm i
66 npm run serve
67 # In production, use 'npm run build' and serve dist/ folder
68 # NOTE: this dist/ folder is symlinked as server/static.