4.3 KiB
4.3 KiB
Running Client Codebase
Appsmith's client (UI/frontend) uses the ReactJS library and Typescript. The application also uses libraries like react-redux and redux-saga for workflows. We use VS Code Editor as our primary editor
Pre-requisites:
On your development machine, please ensure that:
- You have
dockerinstalled in your system. If not, please visit: https://docs.docker.com/get-docker/ - You have
mkcertinstalled. Please visit: https://github.com/FiloSottile/mkcert#installation for details. Formkcertto work with Firefox you may require thenssutility to be installed. Details are in the link above. - You have
envsubstinstalled. usebrew install gettexton macOS. Linux machines usually have this installed. - You have cloned the repo in your local machine.
Create local HTTPS certificates:
- Run the following command from the project root.
cd app/client/docker && mkcert -install && mkcert "*.appsmith.com" && cd ../../..
This command will create 2 files in the docker/ directory:
_wildcard.appsmith.com-key.pem_wildcard.appsmith.com.pem
- Add the domain
dev.appsmith.comto/etc/hosts.
echo "127.0.0.1 dev.appsmith.com" | sudo tee -a /etc/hosts
- Run the script
start-https.shin order to start the nginx container that will proxy the frontend code on your local system.
cd app/client
./start-https.sh
WSL (Windows Subsystem for Linux)
- Because Docker Desktop for Windows does not support
hostnetwork mode (https://docs.docker.com/network/host/), to runstart-https.shin WSL, instart-https.sh, remove the--network hostoption from the call to thedockercommand, then inapp/client/docker/templates/nginx-linux.conf.template, replace all occurrences ofhttp://localhost:3000withhttp://host.docker.internal:3000. - If you are accessing
dev.appsmith.comfrom a browser in Windows, you will need to adddev.appsmith.comto Windows'C:\Windows\System32\drivers\etc\hostsinstead of/etc/hosts. Alternately, you can install a desktop environment in WSL to opendev.appsmithfrom a browser in WSL.
127.0.0.1 dev.appsmith.com
Steps to build & run the code:
- Run
yarn - Run
yarn start
🎉 Your Appsmith client is now running on https://dev.appsmith.com.
This URL must be opened with https and not have the port 3000 in it
Your client is pointing to the cloud staging server https://release-api.appsmith.com
If yarn start throws mismatch node version error
This error occurs because the node version is not compatible with the app environment. In this case Node version manager can be used which allows multiple node versions to be used in different projects. Check below for installation and usage details:
- Install a node version manager. For eg: check nvm or fnm.
- In the root of the project, run
nvm use 10.16.3orfnm use 10.16.3.
If you would like to hit a different Appsmith server:
- Change the API endpoint in the Nginx configuration files (
app/client/docker/templates/nginx-linux.conf.templateorapp/client/docker/templates/nginx-mac.conf.template). - Run
start-https.shscript again. - Run
REACT_APP_ENVIRONMENT=DEVELOPMENT HOST=dev.appsmith.com craco start
If you are unable to run docker:
- Make the values in
nginx-mac.conf.templateempty. None of those properties are required. proxy_passvalue must be changed fromhttp://host.docker.internal:3000tohttp://localhost:3000- Generate the certificates manually via
mkcert. Check the command instart-https-server.shfile. - Change the value of the certificate location for keys
ssl_certificate&ssl_certificate_keyto the place where these certificates were generated. - If you ran
./start-https, but containers failed to start (you have to check withdocker pssince it fails silently). Some Linux distros (Ubuntufor example) have installed and runningapache2webserver on port80. This can result inAddress already in useerror (you can check withdocker logs wildcard-nginx). Simple solution for this is simply turning it off temporarily withsudo systemctl stop apache2. After that just run./start-httpsagain.