Skip to content

Commit

Permalink
docs(Mongodb connection string):
Browse files Browse the repository at this point in the history
Adds more information on How to connect to MongoDB
  • Loading branch information
danybeltran committed Mar 28, 2024
1 parent 6d04a37 commit d4fcdd9
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,38 @@ NEXTAUTH_URL=

How to get these variables?

---

- [`MONGO_URI`](https://www.mongodb.com/docs/manual/reference/connection-string/)

The connection string looks something like this:

`mongodb+srv://<user>:<password>@cluster0.<org>.mongodb.net/<database_name>?retryWrites=true&w=majority`

In your cluster, click **Connect**:

![alt text](docs/connect-1.png)

Under the **Connect your application** section, click **Drivers**:

![alt text](docs/drivers.png)

Click the Copy button next to the connection string:

![alt text](docs/connection-string.png)

Replace `<password>` with the password for your user. Ensure any option params are [URL encoded](https://dochub.mongodb.org/core/atlas-url-encoding).

---

- [`GOOGLE_APP_CLIENT_ID` and `GOOGLE_APP_CLIENT_SECRET`](https://developers.google.com/identity/oauth2/web/guides/get-google-api-clientid)

---

Use your preferred tool to generate the `NEXTAUTH_SECRET` hash:

Using [This tool](https://generate-secret.vercel.app/32) is the quickest way to generate a hash. You can change the last segment of the url to get a hash of your preferred length, such as `https://generate-secret.vercel.app/44`

**OpenSSL :**

```bash
Expand Down
Binary file added docs/connect-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/connection-string.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/drivers.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit d4fcdd9

Please sign in to comment.