Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rename contributing.md => CONTRIBUTING.md
- Loading branch information
1 parent
ffc0cea
commit 4b1643f
Showing
1 changed file
with
98 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
# Contributing | ||
|
||
All contributions are greatly appreciated! | ||
|
||
## Issues | ||
|
||
- Feature requests/enhancements | ||
- Bug reports | ||
- Questions/feedback | ||
|
||
## Pull Requests | ||
|
||
All pull requests are welcome! | ||
|
||
- [Fork][fork-a-repo] the repository on GitHub. | ||
|
||
- [Clone][cloning-a-repo] the forked repo to your local machine. | ||
|
||
- Create a new [feature branch][feature-branch] from master | ||
|
||
- Commit your changes | ||
|
||
- Push your changes back up to your fork. | ||
|
||
- When you're ready, submit a [pull request][pull-requests] so that we can review your changes | ||
|
||
If you have an existing fork, make sure to pull the latest changes from the upstream repository before working on a new contribution. | ||
|
||
```shell | ||
$ git remote add upstream https://github.com/lukePeavey/quotable.git | ||
$ git pull upstream master | ||
``` | ||
|
||
## Running the API Locally | ||
|
||
If you are working on changes to the source code, you will want to run the server locally so you test your changes as you work. | ||
|
||
**Requirements** | ||
|
||
- Node >= 12.x | ||
- NPM >= 6.x | ||
- MongoDB | ||
|
||
|
||
**1. Create a database** | ||
|
||
Create a MongoDB database called quotable. | ||
|
||
If you don't have MongoDB setup locally, you can use [MongoDB Atlas][mongodb/atlas] to create a free hosted database. | ||
|
||
**2. Environment Variables** | ||
|
||
You need to set the `MONGODB_URI` environment variable to point to your database. | ||
|
||
Create a file called `.env` in the root directory of the project. Add the following (replace `<your-database-uri>` with the connection string for your database) | ||
|
||
```shell | ||
MONGODB_URI=<your-mongodb-uri> | ||
``` | ||
|
||
**3. Install dependencies** | ||
|
||
```shell | ||
$ npm run install | ||
``` | ||
|
||
**4. Seed the database** | ||
|
||
This will populate your database with the sample data included in the repository. | ||
|
||
```shell | ||
$ npm run database:seed data/sample | ||
``` | ||
|
||
**4. Start the Server** | ||
|
||
The server will automatically restart when you make changes to the code. | ||
|
||
```shell | ||
$ npm run start:dev | ||
``` | ||
|
||
**5. Running Tests** | ||
|
||
Before submitting a PR, make sure all tests are passing. | ||
|
||
```shell | ||
# Runs tests | ||
$ npm run test | ||
# Check for lint issues | ||
$ npm run lint | ||
``` | ||
|
||
[mongodb/atlas]: https://www.mongodb.com/cloud/atlas | ||
[fork-a-repo]: https://help.github.com/en/articles/fork-a-repo | ||
[cloning-a-repo]: https://help.github.com/en/articles/cloning-a-repository | ||
[feature-branch]: https://www.atlassian.com/git/tutorials/comparing-workflows/feature-branch-workflow | ||
[pull-requests]: https://help.github.com/en/articles/about-pull-requests |