Installation - lypitech/area GitHub Wiki

Installation

  1. Clone the project
git clone [email protected]:lypitech/area.git area
  1. Go in the cloned project
cd area/
  1. Setting up the environment files

[!NOTE] For the IDs, Secrets etc of any app, you should check the dedicated page of each one of them (example here).

Backend

You can find the .env.local.sample at backend/.env.local.sample.

Rename the .env.local.sample to .env.local, Then fill the different environment variable with yours.

TWITCH_CLIENT_ID=// The client ID of your Twitch Developer Application
TWITCH_CLIENT_SECRET=// The client secret of your Twitch Developer Application
DISCORD_APP_ID=// The unique application ID of your Discord bot
DISCORD_APP_PUBLIC_KEY=// The public key of your Discord bot
DISCORD_BOT_TOKEN=// The bot token used to authenticate your Discord bot
NGROK_AUTHTOKEN=// The auth token from your Ngrok account
JWT_ACCESS_SECRET=// A passkey used to sign access tokens
JWT_REFRESH_SECRET=// A passkey to sign and verify refresh tokens
JWT_ACCESS_EXPIRES=15m // Recommended
JWT_REFRESH_EXPIRES=7d // Recommended
GITHUB_CLIENT_ID=// The client ID of your GitHub OAuth app (one that works with your web)
GITHUB_CLIENT_SECRET=// The client secret of your GitHub OAuth app (one that works with your web)
GITHUB_MOBILE_CLIENT_ID=// The client ID of your GitHub OAuth app (one that works with your mobile app)
GITHUB_MOBILE_CLIENT_SECRET=// The client secret of your GitHub app (one that works with your mobile app)
PORT=8080 // The port you want the app to listen on (port asked by EPITECH subject is 8080)

[!NOTE] For Ngrok Authentification token (NGROK_AUTHTOKEN), you can learn how to get it by following the official wiki.

Frontend (web)

You can find the .env.sample at frontend/web/.env.sample. Rename the .env.sample to .env, then fill the variable environment with yours.

VITE_DEFAULT_WEB_URL=// The url you want to back to be exposed on (port asked by EPITECH subject is 8081)
VITE_DEFAULT_API_URL=// The url your backend listens to
VITE_GITHUB_CLIENT_ID=// The id of your Github Oauth app (MUST be same as backend)
VITE_TWITCH_CLIENT_ID=// The id of your Twitch Oauth app (MUST be same as backend)

To run the project locally, the API URL must point to the local IP of your machine, that can be found with the command ip a on Linux.

Mobile

You can find the .env.sample at frontend/mobile/.env.sample. Rename the .env.sample to .env, then fill the variable environment with yours.

DEFAULT_API_PORT=// The port you backend listens on
DEFAULT_API_URL=// The url of your backend (with protocol, without port)
GITHUB_CLIENT_ID=// The id of your Github Oauth app (MUST be same as backend)
TWITCH_CLIENT_ID=// The id of your Twitch Oauth app (MUST be same as backend)

To run the project locally, the API URL must point to the local IP of your machine, that can be found with the command ip a on Linux.

That being said, the API URL and port can be edited at runtime in the app.


  1. Run the project
docker-compose up --build

[!CAUTION] You must have Docker installed on your machine.

Now the API is exposed on port 8080, website is exposed on port 8081 and APK installation file can be found at route /client.apk.