Skip to content

Commit

Permalink
docs: Add getting-started.md
Browse files Browse the repository at this point in the history
  • Loading branch information
rajdip-b committed Dec 26, 2023
1 parent 3f90e4a commit 617c346
Show file tree
Hide file tree
Showing 3 changed files with 91 additions and 0 deletions.
Empty file removed docs/.gitkeep
Empty file.
90 changes: 90 additions & 0 deletions docs/getting-started.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
# Getting Started

This document is meant to help you get started with running the project and developing it locally. Before getting started, make sure you have forked the repository and cloned it locally.

## Environment Variables

Here's the description of the environment variables used in the project. You can find the values for these variables in [`.env.example`](../.env.example).

- **DATABASE_URL**: The URL of the PSQL database to connect to. This is used by the [Prisma Client](https://www.prisma.io/docs/concepts/components/prisma-client) to connect to the database.

- **SUPABASE_API_URL**: The URL of the Supabase API. This is used by the [Supabase Client](https://supabase.io/docs/reference/javascript/supabase-client) to connect to the Supabase API. Make sure you create a Supabase project and get the API URL from the project settings.

- **SUPABASE_ANON_KEY**: The anonymous key of the Supabase project. This is used by the [Supabase Client](https://supabase.io/docs/reference/javascript/supabase-client) to connect to the Supabase API. Make sure you create a Supabase project and get the anonymous key from the project settings.

- **RESEND_API_KEY**: The API key for the [Resend API](https://resend-api.vercel.app/). The project uses Resend API to send out emails.

- **JWT_SECRET**: The secret used to sign the JWT tokens. It is insignificant in the development environment.

- **FROM_EMAIL**: The email address from which the emails will be sent. This is used by the [Resend API](https://resend-api.vercel.app/) to send out emails.

- **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.

## Setting up the .env file

- Make a copy of the `.env.example` file and rename it to `.env`
```bash
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) section.

## Setting up `pnpm`

The project uses `pnpm` as the package manager. To install `pnpm`, run the following command:

```bash
npm install -g pnpm
```

## Installing the dependencies

To install the dependencies, run the following command:

```bash
pnpm install
```

## Running the API

The API resides in the `apps/api` directory. It is a NestJS project. To run the API locally, do the following:

- Generate the prisma types:

```bash
pnpm run db:generate-types
```

- Generate the migrations:

```bash
pnpm run db:generate-migrations
```

- Deploy the migrations:

```bash
pnpm run db:deploy-migrations
```

- Start the server in development mode:

```bash
pnpm run dev:api
```

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

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

- Lint the code:

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

- Run prettier:
```bash
pnpm run prettier:fix:api
```
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"lint:cli": "nx run cli:lint",
"lint:sdk-node": "nx run sdk-js:lint",
"lint:fix": "nx run-many -t lint --fix --parallel",
"prettier:fix:api": "nx run api:prettier:fix",
"build": "nx run-many -t build -p api web workspace --parallel --maxParallel 3",
"build:api": "nx run api:build",
"build:web": "nx run web:build",
Expand Down

0 comments on commit 617c346

Please sign in to comment.