Expert Systems Research with a touch of Software Engineering with Go and React.
Will be used for a research paper like my previous projects: building management system, and NDFA methodology to build cereal vending machines (Bahasa Indonesia).
- Docker (if you want to containerize)
- Go 1.16+
- Node.js 16+
- Yarn 1.22+
- Shell that supports
curl
,make
, andsh
. WSL / Ubuntu / OS X should be able to do this without much configuration (Bash version 3.0+).
To develop further, you just need to do the following steps.
- Clone this repository.
git clone git@github.com:lauslim12/expert-systems.git
- Switch to this repository.
cd expert-systems
- Spawn another terminal, as you need two terminals: one to run Go, one to run the React application. Make sure to run the Go application first to prevent 'fail to proxy' error in React (development only).
# terminal 1
make start
# terminal 2
cd web
yarn --frozen-lockfile
yarn start
-
You're good to go! Remember that the Go application does not hot-reload, while the React application does!
-
Keep in mind that CI exists in order to make the code in proper standards. However, it's always nice to run the following before committing:
# for Go application
make format
# for React application
yarn lint
There are two ways to run this application for production: first is to run with Docker, second is to run this manually. The recommended way is to run this with Docker.
- Clone this repository.
git clone git@github.com:lauslim12/expert-systems.git
- Switch to this repository.
cd expert-systems
- Run unit tests first if you want.
make test
- If you want to run this manually, please build React application first.
cd web && yarn --frozen-lockfile && yarn build
- Build the Go application. Don't forget to return to the main repository by using
cd ..
, assuming you are inweb
folder.
make build
- Start the application!
./expert-systems
- Look at e2e or integration tests while the application is running. You might need to use another terminal.
make e2e
- If running with Docker, do the following commands and after that, please open
localhost:8080
in your browser or run the provided integration tests withmake e2e
.
# Build and start
docker build . -t expert-systems:latest # choose either this or the below one
docker build . -t expert-systems:latest --build-arg GO_ENV=production # if you want HTTPS with 'X-Forwarded-Proto' header, some services like Heroku use this for HTTPS
docker run --name expert-systems -d -p 8080:8080 expert-systems:latest
# Remove image for cleanup
docker stop expert-systems
docker rm expert-systems
docker image rm expert-systems:latest