All contributions are greatly appreciated!
Use the Discussion area to ask questions, get help, discuss ideas, etc.
Please select the appropriate issue template when opening a new issue. For
Suggest a new API feature
Suggest changes to improve an existing API method. For example, adding a new sorting method, etc.
If something is not working as expected (based on the current documentation), file a bug report.
Bugs should be reproducible using a API client like Postman or Chrome.
All pull requests are welcome!
-
Fork the repository on GitHub.
-
Clone the forked repo to your local machine.
-
Create a new feature branch from master
-
Commit your changes
-
Push your changes back up to your fork.
-
When you're ready, submit a pull request 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.
$ git remote add upstream https://github.com/lukePeavey/quotable.git
$ git pull upstream masterIf 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 >= 4.2
1. Create a database
Create a MongoDB database called quotable. If you don't have MongoDB setup locally, you can use 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 line (replace <your-database-uri> with the connection string for your database).
MONGODB_URI=<your-mongodb-uri>3. Install dependencies
$ npm install4. Seed the database
This script will populate your database with the sample data included in the repository.
$ npm run database:seed data/sample4. Start the Server
The server will automatically restart when you make changes to the code.
$ npm run start:dev5. Running Tests
Before submitting a PR, make sure all tests are passing.
# Runs tests
$ npm run test
# Check for lint issues
$ npm run lint