forked from revertinc/revert
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from hrutik7/revertinc#261/dev-ex
discord lost changes
- Loading branch information
Showing
2 changed files
with
129 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,123 @@ | ||
# Requirements | ||
## System Requirements | ||
|
||
Before you start, make sure you have the following applications and their minimum versions installed, in addition to Node.js and yarn (as mentioned earlier): | ||
|
||
- **Node.js 18.0.0** or later | ||
- **Yarn 3.0.2** or later | ||
- macOS, Windows (including WSL), and Linux are supported. | ||
|
||
## System Requirements | ||
|
||
## Get Started | ||
### **setup** | ||
|
||
1 . Clone the forked repository and open the created directory | ||
|
||
```shell | ||
git clone https://github.com/<YOUR_GITHUB_USERNAME>/revert.git | ||
cd revert | ||
|
||
``` | ||
|
||
2 . Install dependencies | ||
|
||
```shell | ||
yarn | ||
``` | ||
|
||
3 . backend setup | ||
|
||
# @revertdotdev/backend | ||
|
||
```shell | ||
|
||
# Copy the example env file | ||
cp packages/backend/.env.example packages/backend/.env | ||
|
||
# Update this .env file with your own secrets if you'd like to. | ||
|
||
``` | ||
|
||
### Fern setup | ||
|
||
- Login with Fern with `fern login`. | ||
- To generate Fern drive code locally, run `yarn fern` in the root folder of this repo. This will create the `packages/backend/generated` folder with the generated code. | ||
|
||
### Setup Redis | ||
|
||
- Have a redis instance running locally or use https://upstash.com/ to get a redis url. | ||
- Update the redis url in `.env` | ||
|
||
### Seed the database | ||
|
||
```shell | ||
# seed the database with sample data | ||
yarn workspace @revertdotdev/backend db-seed | ||
|
||
``` | ||
|
||
### Running the API locally | ||
|
||
- Run | ||
```shell | ||
yarn workspace @revertdotdev/backend dev | ||
``` | ||
to the run service locally at `:4001` | ||
|
||
4 . client setup | ||
|
||
# @revertdotdev/client | ||
|
||
```shell | ||
|
||
# Copy the example env file | ||
cp packages/client/.env.example packages/client/.env | ||
|
||
# Update this .env file with your own secrets if you'd like to. | ||
|
||
``` | ||
|
||
create a tunnel using ngrok | ||
|
||
```shell | ||
|
||
ngrok http 3000 | ||
``` | ||
|
||
After generationg a tunnel copy that url and paste into clerk webhook | ||
make sure the endpoint is `clerk/webhook` | ||
|
||
Now signup in app you will get user.created object in clerk dashboard copy that object | ||
and paste in body of this endpoint `http://localhost:4001/clerk/webhook` in the postman | ||
|
||
1. Generate a Tunnel URL | ||
|
||
- First, generate a tunnel URL using | ||
```shell | ||
ngrok http 3000 | ||
``` | ||
- Copy this URL to your clipboard as you'll need it in the next steps. | ||
|
||
2. Configure Clerk Webhook Endpoint | ||
|
||
- Access your Clerk dashboard. | ||
- Navigate to the webhook settings or configuration section. | ||
- Ensure that the webhook endpoint is set to `clerk/webhook` | ||
|
||
3. Sign Up in Your Application | ||
|
||
- Use your application to sign up a new user. This action will trigger a user creation event. | ||
- In your Clerk dashboard, you should now see a user.created object associated with the newly signed-up user. | ||
|
||
4. Testing with Postman | ||
|
||
- To verify that Clerk is sending user creation notifications to your endpoint, you can use Postman for testing. | ||
|
||
- Open Postman and create a new request. | ||
|
||
- Set the HTTP method to POST. | ||
|
||
- In the request's URL field, use http://localhost:4001/clerk/webhook. This is the endpoint Clerk will send notifications to. | ||
|
||
- In the request body, paste the user.created object that you copied from your Clerk dashboard. |