-
Notifications
You must be signed in to change notification settings - Fork 196
/
Copy pathCONTRIBUTING.md
139 lines (99 loc) · 4.44 KB
/
CONTRIBUTING.md
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
# 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
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)
- [Contributing Guidelines](#contributing-guidelines)
- [Setting Up the Development Environment](#setting-up-the-development-environment)
- [Submitting a Pull Request (PR)](#submitting-a-pull-request-pr)
- [`.env Configuration`](#env-configuration)
- [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)
## Prerequisites
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.
- Git: To clone and manage the project repository.
- Node.js and npm: To install project dependencies.
- Yarn: To manage Node.js packages effectively.
## Contributing Guidelines
We follow these guidelines for contributing:
1. Fork the backend repository to your GitHub account.
2. Clone your forked repository to your local machine:
```bash
git clone https://github.com/yourusername/review-app-api.git
3. Navigate to the backend project directory:
```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 cd review-app-api
2. Run Docker Compose to set up the development environment:
```bash
docker-compose up -d
3. 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:
```env
DATABASE_URL=postgresql://postgres:password@localhost:5432/review
JWT_SECRET=superman123
You can replace superman123 with any secret of your choice.
5. Run database migrations to set up the database:
```bash
yarn migrate:latest
6. Start the local development server:
```bash
yarn local
7. 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
one of our maintainers will review it.
## `.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.
### 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.
## 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
your contribution journey.
## We appreciate your contributions and look forward to collaborating with you
to improve the Review App API!