Setup
Getting Started
To start developing on the backend, you must clone the repository from GitHub.
Installing Rust
Double-check that both the
rustc
andcargo
executables are available on your preferred shell'sPATH
environment.
Cloning the Repository
Open your preferred terminal application and navigate to the directory you want to store the MySK API repository on your system.
Clone the MySK API repository from GitHub by running the following:
$ git clone https://github.com/suankularb-wittayalai-school/mysk-api.git
Environment Variables
Environment files are used to store sensitive information such as secrets, database URLs, and other important configuration parameters. These files should never be pushed to the repository and are to be kept private.
Navigate into the
mysk-api
directory. There should be a file called.env.example
present and should contain the following:
DATABASE_URL=
GOOGLE_OAUTH_CLIENT_ID=
GOOGLE_OAUTH_CLIENT_SECRET=
HOST=
PORT=
ROOT_URI=
TOKEN_MAXAGE=
TOKEN_SECRET=
Copy the contents from the
.env.example
file and put it into a new file. Name the new file as.env
and put it in the root of the repository.A senior member of the backend team should have provided you with the environment variables that are secretive, and you can fill out the rest for yourself.
Running MySK API
Make sure you have your environment variables configured before following the steps below!
Open your preferred terminal application in the root of the repository, and run the following command to start the MySK API server in debug/development mode:
$ cargo run
After taking a few minutes to compile, the server should be up and running smoothly!
Last updated