Run the following command on your server to clone the repository.
git clone https://github.com/mdgspace/domain-forge.gitThis step involves the configuration of three .env files:
- Docker env:
As suggested in the.env.samplepresent at thedocker/directory, create a file named.envand copy the contents as shown, replacing "XXXX" by the frontend and backend ports you want your application to run on.PORT_BACKEND=XXXX PORT_FRONTEND=XXXX - Backend env:
As suggested in the.env.samplepresent at thesrc/backenddirectory, create a file named.envand copy the contents as shown, replacing "..." with the respective values for your registered github oauth application's GITHUB_OAUTH_CLIENT_ID and GITHUB_OAUTH_CLIENT_SECRET. Fill in the MONGO_API_KEY and MONGO_APP_ID you obtain upon creating a cluster in MongoDB Atlas. Also fill in SENTRY_DSN.GITHUB_OAUTH_CLIENT_ID=... GITHUB_OAUTH_CLIENT_SECRET=... MONGO_API_KEY=... MONGO_APP_ID=... SENTRY_DSN=... - Frontend env:
As suggested in the.env.samplepresent at thesrc/frontenddirectory, create a file named.envand copy the contents as shown, replacing "..." with the respective values for your registered github oauth application's VITE_APP_GITHUB_OAUTH_CLIENT_ID and VITE_APP_GITHUB_OAUTH_CLIENT_SECRET. For the VITE_APP_GITHUB_OAUTH_REDIRECT_URL enter the public url of the application's/loginroute. (Example:https://domains.mdgspace.org/login). Also, add the port at which your backend is running in place of "XXXX".VITE_APP_GITHUB_OAUTH_CLIENT_ID=... VITE_APP_GITHUB_OAUTH_CLIENT_SECRET=... VITE_APP_GITHUB_OAUTH_REDIRECT_URL=... VITE_APP_BACKEND_PORT=XXXX
If you do not have docker installed on your system, visit this.
Navigate to the docker directory and build the images in the background using the following command.
cd docker/
docker compose up --build -dCreate a pipe in the docker/named_pipe directory by executing mkfifo docker/named_pipe/pipe.
Navigate to the docker/named_pipe directory and execute the listen.sh script to allow the application to run commands on the host.
cd docker/named_pipe
./listen.shMake sure to check the permissions of the
listen.shfile. You can change them using thechmodcommand. You can also add this tocrontabto execute script on reboot of your server.
Install NGINX on your server from here.
Refer to this to configure NGINX to serve your application.
Refer to this to add DNS records for domains.yourorgname.com and also a wildcard DNS record for *.domains.yourorgname.com
You can use letsencrypt to issue SSL certificates for domains.yourorgname.com and a wildcard SSL certificate for *.domains.yourorgname.com.