Setup
Getting Started
To start developing on the backend, you must clone the repository from GitHub.
Installing Rust
Double-check that both the
rustcandcargoexecutables are available on your preferred shell'sPATHenvironment.
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.gitEnvironment 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-apidirectory. There should be a file called.env.examplepresent 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.examplefile and put it into a new file. Name the new file as.envand 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 runAfter taking a few minutes to compile, the server should be up and running smoothly!
Last updated