My personal playground for coding and learning.
-
Copy the
.env.examplefile 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 settingsin the left menu - Click on
Github Appsin the left menu - Click on
New Github Appbutton - 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
Activecheckbox fromWebhooksection - Don't forget to check
Any accountfor theWhere can this Github App be installed?field - Click on
Create a Github Appbutton - 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.keyfile and copy the content - Paste the content in the
GITHUB_PRIVATE_KEYfield in the.envfile
- Copy the
Client IDand paste it in theGITHUB_IDfield in the.envfile - Copy the
Client secretsand paste it in theGITHUB_SECRETfield in the.envfile- If you don't see the
Client secretsclick onGenerate a new client secretbutton
- If you don't see the
- Copy the
App IDand paste it in theGITHUB_APP_IDfield in the.envfile
- 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
spotlightby pressingcmd + spaceand typeterminaland pressenter. - You probably need to install
nodefirst. You can download it from here. I personally recommend usingbrewto installnodeon Mac. You can installbrewby 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