Skip to content

Commit

Permalink
Merge branch 'develop' into feat/event
Browse files Browse the repository at this point in the history
  • Loading branch information
rajdip-b authored Feb 9, 2024
2 parents 01f875a + 69a832e commit b9a005a
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 10 deletions.
4 changes: 4 additions & 0 deletions docs/contributing-to-keyshade/design-of-our-code/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ As per the NestJS convention, our API base is totally modularized, with each mod
* **dto**: Contains class objects for data intake from the clients
* **types:** Optionally, some modules have a \`\<module\_name>.types.ts\` file that holds the custom types it uses in the module.

## The common module

Just so that we can employ code reusability without much OOP hassle, we have clustered all of our usable components of the backend under the `common` module.&#x20;

### The `prisma` module

This module deserves special attention since it deals with the data layer. Apart from the usual files, we have two other:
Expand Down
1 change: 1 addition & 0 deletions docs/contributing-to-keyshade/environment-variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Here's the description of the environment variables used in the project. You can
* **SMTP\_PORT:** The SMPT port as specified by your SMPT provider.
* **SMTP\_EMAIL\_ADDRESS:** The email address you want to be sending out the emails from.
* **SMTP\_PASSWORD:** The app password for your email account. &#x20;
* **GITHUB\_CLIENT\_ID, GITHUB\_CLIENT\_SECRET, GITHUB\_CALLBACK\_URL:** These settings can be configured by adding an OAuth app in your GitHub account's developer section. Please note that it's not mandatory, until and unless you want to support GitHub OAuth.
* **FROM\_EMAIL**: The display of the email sender title.
* **JWT\_SECRET**: The secret used to sign the JWT tokens. It is insignificant in the development environment.
* **WEB\_FRONTEND\_URL, WORKSPACE\_FRONTEND\_URL**: The URLs of the web and workspace frontend respectively. These are used in the emails sometimes and in other spaces of the application too.
2 changes: 1 addition & 1 deletion docs/contributing-to-keyshade/prerequisites.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ Of course, to get started, you will need to have the required components in plac

* Make sure you have Git installed and have an account in GitHub
* Have an account in Supabase along with a project
* Have your SMTP credentials ready (only for backend development)
* Have your SMTP credentials ready
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,20 @@ pnpm run db:deploy-migrations
pnpm run dev:api
```

* Once you have made the changes and added tests (if any), make sure to test the code:
## Testing your code

```bash
pnpm run test:api
```
We currently perform two kinds of tests: **unit tests** and **integration tests.**&#x20;

* Lint the code:
After you make sure that you have added your unit tests, or you have made some changes to the existing functionality, you can run them using:

```bash
pnpm run lint:api
pnpm run test:api
```

* Run prettier:
After this is complete, you can run the integration tests. But for that, you would first need your test DB to be up and running. These commands will do of that for you.

```bash
pnpm run prettier:fix:api
docker compose up -d
pnpm run e2e:api
docker compose down
```
17 changes: 16 additions & 1 deletion docs/contributing-to-keyshade/setting-things-up.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
---
description: A tour of how to get the prerequisites done
---

# Setting things up

## Setting up the .env file
Expand All @@ -10,6 +14,10 @@ cp .env.example .env

Fill in the values for the environment variables in the `.env` file. You can find the values for the variables in the [Environment Variables](environment-variables.md) section.&#x20;

## Installing Docker

We tend to use docker for doing the heavy lifting on our behalf. Currently, we use it to set up the integration test environment before you make a commit. To make sure your experience is smooth, consider installing docker from [https://docs.docker.com/engine/install/](https://docs.docker.com/engine/install/)

## Setting up `pnpm`

keyshade works with any version of **node (>=18)** and takes the liberty that you have it installed. The project uses `pnpm` as the package manager. To install `pnpm`, run the following command:
Expand Down Expand Up @@ -39,6 +47,13 @@ pnpm install
The last step is to install NX. It is the monorepo management tool that we are using. Read more about it in [https://nx.dev](https://nx.dev). To install nx, you need to run the following command:

```bash
pnpm i -g nx
npm i -g nx
```

## Installing nest CLI

If you plan to work on the API, you would need the **NestJS CLI.** To do this, simply run:

```bash
npm install -g @nestjs/cli
```

0 comments on commit b9a005a

Please sign in to comment.