Skip to content

Commit

Permalink
Merge pull request #1 from hrutik7/revertinc#261/dev-ex
Browse files Browse the repository at this point in the history
discord lost changes
  • Loading branch information
hrutik7 authored Nov 3, 2023
2 parents d1116e6 + f1bc2e1 commit 9496407
Show file tree
Hide file tree
Showing 2 changed files with 129 additions and 0 deletions.
6 changes: 6 additions & 0 deletions fern/api/docs/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ navigation:
contents:
- page: Webhooks
path: ./mdx/webhooks.mdx
- section: Developer guides
contents:
- page: Developer guides
path: ./mdx/developer-guides.mdx


colors:
accentPrimary: '#ffffff'
logo:
Expand Down
123 changes: 123 additions & 0 deletions fern/api/docs/mdx/developer-guides.mdx
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.

0 comments on commit 9496407

Please sign in to comment.