Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: Review app api docs refactored #66

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
132 changes: 89 additions & 43 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
# Contributing to Review App API

Thank you for your interest in contributing to the Review App API!
We appreciate your support and welcome your contributions to help
enhance and improve the project. Please read through the following
We appreciate your support and welcome your contributions to help
enhance and improve the project. Please read through the following
guidelines to get started.

## Table of Contents

- [Contributing to Review App API](#contributing-to-review-app-api)
- [Table of Contents](#table-of-contents)
- [Prerequisites](#prerequisites)
Expand All @@ -16,13 +17,13 @@ guidelines to get started.
- [Process](#process)
- [Code of Conduct](#code-of-conduct)
- [We appreciate your contributions and look forward to
collaborating with you to improve the Review App API!]
(#we-appreciate-your-contributions-and-look-forward-to-collaborating-with-you-to-improve-the-review-app-api)
collaborating with you to improve the Review App API!]
(#we-appreciate-your-contributions-and-look-forward-to-collaborating-with-you-to-improve-the-review-app-api)

## Prerequisites

Before you begin contributing to the backend of the Review App,
please ensure you have the following prerequisites installed and
Before you begin contributing to the backend of the Review App,
please ensure you have the following prerequisites installed and
configured on your local machine:

- Docker: To set up and manage the development environment.
Expand All @@ -41,99 +42,144 @@ We follow these guidelines for contributing:
```bash
git clone https://github.com/yourusername/review-app-api.git

```

3. Navigate to the backend project directory:
```bash

```bash
cd review-app-api

```

4. Create a new branch for your contribution:

```bash
git checkout -b feature-name

```

5. Make your changes and ensure your code follows our coding
standards and practices.

6. Test your changes locally to ensure they work as expected.

7. Commit your changes with clear and concise commit messages:

```bash
git commit -m "Add feature: your feature description"

```

8. Create a pull request (PR) to the `main` repository's `main` branch.

## Setting Up the Development Environment

To set up the development environment locally, follow these steps:

1. Clone the backend repository:

```bash
git clone https://github.com/yourusername/review-app-api.git

```

2. Navigate to the backend project directory:

```bash
git clone https://github.com/yourusername/review-app-api.git cd review-app-api
cd review-app-api

```

3. Run Docker Compose to set up the development environment:

2. Run Docker Compose to set up the development environment:
```bash
docker-compose up -d

3. Install project dependencies using Yarn:
```

4. Install project dependencies using Yarn:

```bash
yarn

4. Copy the `.env.example` file to .`env.local` and configure the
5. following environment variables in the `.env.local` file:
```

5. Create a new env file named `.env.local` and copy the `.env.example` template and configure it like below.

6. Following environment variables in the `.env.local` file:

```env
DATABASE_URL=postgresql://postgres:password@localhost:5432/review
JWT_SECRET=superman123
```

You can replace superman123 with any secret of your choice.

You can replace superman123 with any secret of your choice.
7. Run database migrations to set up the database:

If you're doing this for the first time run this script -

5. Run database migrations to set up the database:
```bash
yarn migrate:latest
prisma:migrate:local

```

Otherwise run this script -

```bash
migrate:latest

```

8. Start the local development server:

6. Start the local development server:
```bash
yarn local

7. The backend will be up and running on port 8000.
```

9. The backend will be up and running on port 8000.

## Submitting a Pull Request (PR)

When you're ready to submit your changes, create a pull request
(PR) to the `main` repository's main branch following our guidelines.
Be sure to provide a clear description of your changes in the PR, and
(PR) to the `main` repository's main branch following our guidelines.
Be sure to provide a clear description of your changes in the PR, and
one of our maintainers will review it.

## `.env Configuration`
## `.env Configuration`

- Instructions on how to configure the environment variables for the
Review App API.

1. You need to copy the `.env.example` file to
`.env.local`

2. Then configure the necessary environment variables in the `.env.local`
file.

4. In this case, the required environment variables are `DATABASE_URL` and
`JWT_SECRET`.

6. The example shows the format for these variables and provides a placeholder
value for `JWT_SECRET`.

8. You are instructed to replace this placeholder value with a secret of your choice.
Review App API.

1. You need to create a new env file named `.env.local` and then copy from `.env.example` file to
`.env.local`

2. Then configure the necessary environment variables in the `.env.local`
file.
3. In this case, the required environment variables are `DATABASE_URL` and
`JWT_SECRET`.
4. The example shows the format for these variables and provides a placeholder
value for `JWT_SECRET`.
5. You are instructed to replace this placeholder value with a secret of your choice.

### Process

- Copy the `.env.example` file to `.env.local` and configure the following
environment variables in the `.env.local` file:
```env
DATABASE_URL=postgresql://postgres:password@localhost:5432/review
JWT_SECRET=superman123

- You can replace superman123 with any secret of your choice.
```env
DATABASE_URL=postgresql://postgres:password@localhost:5432/review
JWT_SECRET=superman123

```

- You can replace superman123 with any secret of your choice.

## Code of Conduct

Please be aware that we have a Code of Conduct (CODE_OF_CONDUCT.md) that all
contributors are expected to follow. Please read and adhere to it throughout
contributors are expected to follow. Please read and adhere to it throughout
your contribution journey.

## We appreciate your contributions and look forward to collaborating with you
to improve the Review App API!

## We appreciate your contributions and look forward to collaborating with you to improve the Review App API!
Loading