Server | Port |
---|---|
Web (Typescript) | 8000 |
Api gateway (Golang) | 8010 |
Py API (Python) | 8020 |
Biz-v1 (NodeJs) | 8030 |
Biz API (Golang) | 8040 |
FS server (Golang) | - |
DGraph server (Golang) | - |
Auth server (Rust) | 8050 |
Data server (Rust) | 8051 |
-
Flask Web framework
-
SqlAlchemy Database ORM
-
Pandas Data Analysis Library
-
[Mux]
-
[Mongo]
-
Typescript Typed JavaScript
-
NestJS NodeJS framework
-
Typeorm Database ORM
-
React JavaScript library
-
Ant design pro UI solution
Use PostgreSql as default project database (storing config etc.)
-
PostgreSql = 10.0, docker commands:
-
cd docker/docker-database
-
bash start.sh
-
bash create_database.sh
-
Use MongoDB for default non-schema data persistence
-
MongoDB, docker commands:
-
cd docker-mongodb
-
bash start.sh
-
bash create_unique_index.sh
-
versions:
- Python >= 3.8
commands:
cd server
pip install -r requirements.txt
versions:
- Node >= 12.13
- npm >= 6.12
- yarn >= 1.22
commands:
cd web
npm i
oryarn
In resources
folder, new config.json
(see config.template.json).
In resources
folder, new go.env
(see go.template.env.
In resources
folder, if mongodb is running in another machine, new mongo.connection.env
(see mongo.connection.template.env.
If you haven't initialized the submodule before, run make submodule-init
.
Otherwise, update submodule by running make submodule-update
.
Then, config the lura.json
and ua.auth.env
based on ua.auth.template.env
(you can simply copy template and rename it).
In ua.auth.env
, Make sure DATABASE_URL
is your database connection string. If the database is also running in docker and share the same network with auth-server container, rename the hostname to database's container name. Make sure INVITATION_PAGE
is the link of cyberbrick frontend link (hostname is localhost in dev mode and the ip-address of server in production mode).
In lura.json
, rename the endpoints-backends host to the real ip-address.
todo
todo
Please cd server-py
first then run the following commands.
-
development:
-
python wsgi.py
debug mode -
python wsgi.py debug=false
no-debug mode
-
-
production:
python wsgi.py --env=prod
-
production (docker):
-
setup python image, only for the first time:
cd docker/docker-python bash setup.sh
-
setup dependencies installed image, rerun if dependencies updated:
cd docker/docker-base-server bash setup.sh
-
setup built app image and start a container:
cd docker/docker-app-server bash setup.sh bash start.sh
-
Please cd server-go
first then run the following commands.
-
development:
-
go mod tidy
download deps -
go run .
start server
-
-
production (docker):
- make sure you have a running
mongoDB
and have executed the bash filecreate_unique_index.sh
inside docker-mongodb; a base image built fromdocker-go
, aresources/go.env
file with config similar togo.template.env
; and aresources/mongo.connection.env
file with similar config asmongo.connection.template.env
. - You can simply run
make docker-biz-server-setup
and thenmake docker-biz-server-start
or:- cd docker/docker-biz-server
- ./setup.sh
- ./start.sh
- make sure you have a running
Please cd web
first then do the following commands.
-
development:
yarn serve:dev
for server side then in another terminalyarn dev
for frontend
-
production:
yarn build
thenyarn serve
-
production (docker):
-
setup node image, only for the first time:
cd docker/docker-node bash setup.sh
-
setup dependencies installed image, rerun if dependencies updated:
cd docker/docker-base-web bash setup.sh
-
setup built app image and start a container:
cd docker/docker-app-web bash setup.sh bash start.sh
-
yarn build:backend
&yarn build:frontend
building up web's server & client respectively
-
TODO: updating...