My personal playground for coding and learning.
-
Copy the
.env.example
file and rename it to.env
-
How to set
AUTH_SECRET
- Generate a random string by running the following command in the terminal
openssl rand -base64 32
- Generate a random string by running the following command in the terminal
-
How to set
GITHUB_ID
,GITHUB_SECRET
,GITHUB_APP_ID
,GITHUB_PRIVATE_KEY
- Go to profile and click on
Developer settings
in the left menu - Click on
Github Apps
in the left menu - Click on
New Github App
button - Fill in the form
- Give it a name
- This will be the name of
NEXT_PUBLIC_GITHUB_APP_SLUG
- This will be the name of
- Give it a homepage url
- Example:
http://localhost:3000
- Example:
- Give it a callback url
- Example:
http://localhost:3000/callback/auth/github/authorize
- Example:
http://localhost:3000/api/auth/callback/github
- Example:
- Check
Expire user authorization tokens
- Give it a setup url
- Example:
http://localhost:3000/callback/auth/github/application-install
- Example:
- Check
Redirect on update
- Uncheck
Active
checkbox fromWebhook
section - Don't forget to check
Any account
for theWhere can this Github App be installed?
field - Click on
Create a Github App
button - Click on
Generate a private key
- Run the following command to convert the private key to pkcs8 format
openssl pkcs8 -topk8 -inform PEM -outform PEM -nocrypt -in DOWNLOADED_PRIVATE_KEY_PATH -out private-key-pkcs8.key
- Open the
private-key-pkcs8.key
file and copy the content - Paste the content in the
GITHUB_PRIVATE_KEY
field in the.env
file
- Copy the
Client ID
and paste it in theGITHUB_ID
field in the.env
file - Copy the
Client secrets
and paste it in theGITHUB_SECRET
field in the.env
file- If you don't see the
Client secrets
click onGenerate a new client secret
button
- If you don't see the
- Copy the
App ID
and paste it in theGITHUB_APP_ID
field in the.env
file
- Give it a name
- Go to profile and click on
-
For the permissions & events
- Repository permissions
- Administration : Read-only
- Checks : Read and write
- Contents : Read-only
- Metadata : Read-only
- Pull requests : Read and write
- Organization permissions
- Plan : Read-only
- Repository permissions
- You need terminal to run the following commands. Open the
spotlight
by pressingcmd + space
and typeterminal
and pressenter
. - You probably need to install
node
first. You can download it from here. I personally recommend usingbrew
to installnode
on Mac. You can installbrew
by running the following command in the terminal.- What is homebrew? Homebrew is a package manager for Mac. You can install a lot of software by running a single command. You can find more information about homebrew here
- How to install node using homebrew?
brew install node
- Clone the repository by running the following command in the terminal.
git clone https://github.com/coding-for-fun-org/frontend.git
- Go to the project directory by running the following command in the terminal.
cd frontend
- Install the dependencies by running the following command in the terminal.
npm install