This folder contains the documentation that and scripts that can be helpful if you try to install this app on your workstation.
It is to be noted that the setting up has only been made available for apt, rpm and pacman based distros. If you want your distro to be supported, I recommend to check the objectives and install the application on your end with your knowledge and then update the setup script.
- Ensure that all the following packages are installed : gcc, ssl tools in developer mode, rustup (includes cargo), npm
- Add the target
wasm32-unknown-unknown
from rustup - Install
trunk
and (recommended)cargo-watch
from cargo - Setting up the environment file
- Starting the database
- Running the application in developper mode
- Git is needed, if you didn't clone yet this repo, use
git clone https://github.com/nag763/tchatchers
, and then position yourself at the root of the project. - Make sure your distro and its packages are up to date
- Have cargo and rustup installed. Follow the official guide if needed.
- Install
docker
(guide here) and care about having rights with your user on dockerd if you are on linux (guide here).
Then you can either setup your environment by :
- Running the following command :
curl -ssl https://raw.githubusercontent.com/nag763/tchatchers/main/setup.sh | sh
- Or using
cargo-make
- Install cargo-make :
cargo install cargo-make
- Run the following :
cargo-make make install-native-pkgs
- Install cargo-make :
Now that all the prequesites have been installed, I recommend you to run the following before starting the app in either dev or prod mode
cargo-make make setup-env
If you want to set up a new environment, it is recommanded to first run the following command :
cargo-make make clear-symlink
So now, you most likely want to start the application as an observable process, meaning that both the front and the back will be running, and they will recompile everytime a change is performed.
For that run
cargo-make start-dev
And you should be all good to start the application locally. :happy:
If you access http://localhost:3000/ , you should see the login screen of the app.
It is recommended to create an administrator profile with the help of this command :
cargo r --bin tct user create
This tutorial is dedicated to users who would rather install the application on a production server.
Most of the ways to install dependencies or packages won't be rexplained here since it is installed on the developer section. Refer to it if needed.
- Creating an environment file exploitable by the end application.
- Setting up the nginx config.
- Starting the application.
- Have the project installed and be on the project workspace root path.
- (Prefered) Have
cargo-make
installed. - Being able to run the tct crate of this project, this should print the help :
cargo r --bin tct
. - Docker and Docker Compose being installed on the station.
You only need the docker-compose.yml file to start your production server as well as the .env
and nginx.conf
.
It is recommended to only transfer the docker-compose.yml file to the target server and then generate the .env
and nginx.conf
ones without transferring the source code.
You might want to generate a self signed certificate for HTTPs config, to do that, run the following with cargo-make :
cargo-make make generate-self-signed-certificate
Be aware that self signed certificates might not be suitable for public production usages.
Run the following for that, and follow the dialogs.
cargo r --bin tct env create -o .env
Be aware that for the HTTPs config, you need to precise all paths as relative './myfile' or absolute '/path/to/myfile/'.
Run the following command, and follow again the dialogs.
cargo r --bin tct env build-nginx-conf -o nginx.conf
Your config should now be ready for prod, run the following to start your server with the configuration you parametarized :
For first run, run the following :
docker-compose up --build
If no error is thrown, for subsequent stop/restarts, run the following to detach the process to the current shell
docker-compose up --build -d