Meeting notes, on autopilot.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
-
Yarn v3 (https://yarnpkg.com)
- This Project uses yarn workspaces (https://yarnpkg.com/features/workspaces)
-
NodeJS v18 (https://nodejs.org)
git clone https://github.com/System-D-Labs/recap.git
cd recap
yarn install
-
Go to the Firebase console and sign in to your account.
-
Click on Add project.
-
Finish creating a new project for a production server.
-
In the project dashboard, click on Project settings in the top-left gear icon. Click a button whose text appears to be html tag in order to create a webapp on the section Your apps on the tab General in project settings page. Just name it
Recap-app
and enable Also set up Firebase Hosting for this app., then click on Register app. -
Go to Build > Authentication and click Get started, then set Google as a sign-in method, activating an option Enable, finally click on Save.
-
Go to Build > Firestore Database and click on Create database, choose Start in production mode and click on Next, choose an expected cloud firestore location and click on Enable.
-
Go to Build > Realtime Database and click on Create database, choose Start in production mode and click on Next, choose an expected cloud realtime database location and click on Enable.
-
Optional: Go to Build > Hosting and finish
Get started
, then click Add custom domain to setup your domain.
Go to the repo of your local project you cloned.
In the root directlry of your local project, copy/paste .env.example
and rename it to .env
.
-
Set
NODE_ENV
asdevelopment
. -
Set
DOMAIN
aslocalhost:3000
. -
Set
EXTENSION_LINK
as the chrome webstore link of Recap extension. -
Set
EXTENSION_KEY
from the chrome webstore developer dashboard.-
Go to Chrome Web Store Developer Dashboard and select the package of the chrome extension you published.
-
Move to Package page and click View public key to see it.
-
Copy the content of the key value between
-----BEGIN PUBLIC KEY-----
and-----END PUBLIC KEY-----
. -
Remove all line breaks to use it as an environment variable.
-
Set
EXTENSION_KEY
with the value of key.
-
-
Go to your firebase project in Firebase console, click on Project settings in the top-left gear icon.
-
Take note of all variables in
firebaseConfig
in code snippet of your apprecap-app
.const firebaseConfig = { apiKey: 'xxxxx', authDomain: 'xxxxx', databaseURL: 'xxxxx', projectId: 'xxxxx', storageBucket: 'xxxxx', messagingSenderId: 'xxxxx', appId: 'xxxxx', measurementId: 'xxxxx' }
-
Replace all corresponding empty variables by upper snake case in
.env
with those values you"ve just taken note.
-
Go to the Google Cloud Platform Console.
-
From the projects list, select the firebase project you created in the step Create a firebase project.
-
In the sidebar on the left, click APIs & Services.
-
On the drop-down menu, click on Credentials.
-
At the top of the page, select Create Credentials and then from the dropdown, select OAuth client ID.
-
Choose the application type as
Chrome Extension
, and fill out Application type and Item ID. -
Click the Create button. Your client ID is created and shown on the credentials page.
-
Copy the Client ID you are given, then put it in
OAUTH2_CLIENT_ID
in.env
.
-
First, log in to your Sentry account.
-
Open your Project settings. To do this:
- Click on Projects in the sidebar.
- Then click on your Project's name.
-
Navigate to Settings > Projects > [Your project name] > Client Keys (DSN).
-
Now, you will see a list of your DSNs. There should be a default one already created for you.
-
Copy the DSN. It typically looks like this format:
https://<public_key>:<secret_key>@sentry.io/<project_id>
-
Paste it in
SENTRY_DSN
in.env
.
Finally the .env
will look similar to below:
NODE_ENV="xxxxx"
DOMAIN="xxxxx"
EXTENSION_LINK="xxxxx"
EXTENSION_KEY="xxxxx"
FIREBASE_API_KEY="xxxxx"
FIREBASE_AUTH_DOMAIN="xxxxx"
FIREBASE_DATABASE_URL="xxxxx"
FIREBASE_PROJECT_ID="xxxxx"
FIREBASE_STORAGE_BUCKET="xxxxx"
FIREBASE_MESSAGING_SENDER_ID="xxxxx"
FIREBASE_APP_ID="xxxxx"
FIREBASE_MEASUREMENT_ID="xxxxx"
OAUTH2_CLIENT_ID="xxxxx"
SENTRY_DSN="xxxxx"
-
Visit the Google Cloud Console.
-
From the projects list, select the firebase project you created in the step Create a firebase project.
-
Go to Enabling access to Google API and click NEXT > ENABLE to enable it.
-
Go to Enabling access to Google Calendar API and click NEXT > ENABLE to enable it.
-
Navigate to IAM & Admin > Service Accounts in the left-side menu.
-
Click Create Service Account.
-
In the Service account name field, enter a name
github-actions
. The Service account ID field will fill in automatically with an ID that is unique within the project. -
Optional: Add a description of the service account. Click Create and continue.
-
Assign roles to your service account.
-
Add the following roles:
API Keys Viewer
,Artifact Registry Writer
,Cloud Datastore Index Admin
,Cloud Functions Developer
,Cloud Run Viewer
,Cloud RuntimeConfig Admin
,Cloud Scheduler Admin
,Firebase Admin
,Firebase Authentication Admin
,Firebase Extensions API Service Agent
,Firebase Hosting Admin
,Firebase Rules Admin
,Service Account User
. -
Click Continue.
-
-
Click Done to finish. You will probably redirect back to
Service Accounts
page and see the service account you created appears in the table. -
Create a Key and download it.
-
Click the service account you've just created. ( Its name looks similar to
github-actions@recap.iam.gserviceaccount.com
. ) -
Navigate to Keys tab, then click Add Key > Create new key.
-
Choose JSON as the Key type and click Create.
-
A JSON key file gets downloaded onto your machine.
-
-
Move the JSON key file to the root directory of your local repository.
Go to the project github repository, then navigate to Settings tab.
Click Environments on the left sidebar of Repository settings page, then click New environment.
Give it a name PRODUCTION
and click Configure environment to finish, you will be redirect to the environment edit page.
-
Click Add variable and give
DOMAIN
to Name, give the domain of your firebase hosting server (ex: withrecap.com) to Value. -
Click New repository secret and give
EXTENSION_KEY
to Name, copy/paste the value in.env
into Secret.
-
Create variables
EXTENSION_LINK
,OAUTH2_CLIENT_ID
,FIREBASE_AUTH_DOMAIN
,FIREBASE_DATABASE_URL
,FIREBASE_PROJECT_ID
,FIREBASE_APP_ID
,FIREBASE_STORAGE_BUCKET
,FIREBASE_MESSAGING_SENDER_ID
,FIREBASE_MEASUREMENT_ID
, copying/pasting the corresponding values in.env
to each one. -
Create secrets
FIREBASE_API_KEY
,SENTRY_DSN
, copying/pasting the corresponding values of.env
which you early configured to each one.
-
Open
service-account.json
in your local project and copy its content. -
On the environment edit page of your github repository, create a new secret
FIREBASE_SERVICE_ACCOUNT
and paste the content of JSON file into the secret value.
-
Configure User type.
-
Set
MAKE EXTERNAL
if it is for a production. You will need to submit and take an extensive verification process, or just setTest
and add testers' emails in Test users section. -
Set
MAKE INTERNAL
if it is for a staging.
-
-
Click EDIT APP and enter required inputs and click SAVE AND CONTINUE to move to the step Scopes.
-
Click ADD OR REMOVE SCOPES and select scopes whose values are
.../auth/userinfo.email
,.../auth/userinfo.profile
,...auth/calendar.readonly
, and click UPDATE, then SAVE AND CONTINUE to move to the step Optional info. -
Just click SAVE AND CONTINUE.
-
Visit the official site of OpenAi at https://beta.openai.com/signup/
-
Click on 'Get Started'.
-
Fill out all the required details and create a new account.
-
Confirm your Email ID by clicking on the verification link sent to your email.
-
After confirming your email, log in to your account.
-
Navigate to the 'API Keys' section. It can usually be found under the Dashboard or Account Settings.
-
Click on 'Create New' and then name your application and describe its purpose.
-
Copy the api key and paste it
-
On the environment edit page of your github repository, create a new secret
CHATGPT_API_KEY
and paste the API KEY into the secret value.
-
First, log in to your Mailgun account.
-
Once you're logged in, go to your Dashboard by clicking on the
Dashboard
button usually located at the top right corner of the page. -
Inside the Dashboard, find and click on
Settings
in the left side navigation bar. This should open a dropdown menu. -
In the dropdown menu, look for and click on
API Keys
. -
On the
API Keys
page, you will see a list of available API Keys with their names and a hidden key. -
Find the
Private API Key
section. The API key will be hidden for security purposes, but there's aneye
icon next to it. -
Click on the
eye
icon to reveal your Mailgun Private API key, then copy it. -
On the environment edit page of your github repository, create a new secret
MAILGUN_API_KEY
and paste the API KEY into the secret value.
-
Go to github settings for personal access tokens.
-
Click Generate new token > Generate new token (classic).
-
Give it a name (ex:
RECAP_PRODUCTION_TOKEN
), set ExpirationNo expiration
, giverepo
,workflow
,write:packages
,delete:packages
,project
to its scopes, then click Generate token to create a token and copy the token's value. -
On the environment edit page of your github repository, create a new secret
PERSONAL_GITHUB_TOKEN
and paste the token into the secret value.
Deployment is processed automatically by github actions. You must have already done configuring Environment Setup for Local development and Environment Setup for CI/CD before starting a deployment.
Merge a PR branch or directly push commits into main in order to deploy a production server.
You must be in main branch.
-
Bump up a new version.
yarn bump --version=<version> # EX: yarn bump --version=1.1.0 # or yarn bump:major # or yarn bump:minor # or yarn bump:patch
-
Push to github.
git commit -m "<commit message>" # EX: git commit -m "chore: release v1.1.0 git push
You have to configure an another firebase project and github environment named STAGING
in order to set up a CI/CD for a staging server. Then make a PR to deploy staging server and use the prerelease
version of test-tailord extension on Releases page, like v1.1.0-test.1
.
-
Go to Enabling access to functions, you will see all firebase cloud functions used in the project.
-
Select all functions that have triggers specified as HTTP by clicking checkboxes on the left side of each rows.
-
Click PERMISSIONS and side toggle pane will appear, then click ADD PRINCIPAL.
-
Enter
allUsers
in the input box named New principals, then give a roleCloud Functions Invoker
in the select box named Select a role. -
Click SAVE to finish.
🎉 Congratulations! You have successfully setup your project finally.
Go to the root directory of the project.
yarn engine start
yarn app start # with cloud server
yarn app start:emulate # with emulators
yarn extension start # with cloud server
yarn extension start:emulate # with emulators
Open http://localhost:3000 to view it in the browser.
Also, you will see the chrome extension is being built into /packages/extension/dist
.
This project is licensed under the MIT License.
Made with ❤️ by System D Labs
. Enjoy!