Rentals-API is a RESTful-API
that allows developers
to connect to data about rental properties
.
To use Rentals-API, clone this repository and follow one of two methods shown below:
- Install Docker Compose
- Run all containers with
make up
.
- Install Go
- Install PostgreSQL
- Create a database named
rental
. - Install all dependencies using:
go mod tidy
- Run the application using:
make run
To contribute to Rentals-API, follow these steps:
- Clone this repository.
- Create a branch:
git checkout -b <branch_name>
. When you create a branch, it should follow the name of the task. - Make your changes and commit them:
git commit -m '<commit_message>'
- Push to the original branch:
git push origin <branch_name>/<location>
- Create the pull request.
Alternatively see the GitHub documentation on creating a pull request.
Mailchimp api is used for sending emails to customers using the platform.
- To gain access to this template, log on to (mailchimp) you need to login with the rental-api verified username and password.
- Navigate to the create campaigns, then click on email templates.
- Click on the rental-api template.
- Edit the template, add the links desired and save the template.
An environment variable is a text file containing KEY=value
pairs of your secret keys and other private information. For security purposes, it is ignored using .gitignore
and not committed with the rest of your codebase.
To create, ensure you are in the root directory of the project then on your terminal type:
touch .env
All the variables used within the project can now be added within the .env
file in the following format:
DB_HOST=127.0.0.1
DB_PORT=8080
DB_USER=<your db username>
DB_PASS=<your db password>
Testing is done using the GoMock framework. The gomock
package and the mockgen
code generation tool are used for this purpose.
If you installed the dependencies using the command given above, then the packages would have been installed. Otherwise, installation can be done using the following commands:
go get github.com/golang/mock/gomock
go get github.com/golang/mock/mockgen
After installing the packages, run:
make mock-db
The command above helps to generate mock interfaces from a source file.
To run tests, run:
make test
Thanks to the following people who have contributed to this project:
- Odohi David (spankie) 📖
- Toluwase Thomas (toluwase1) 📖
- Olusola Alao (olusolaa) 📖
- Tambarie Gbaragbo (Tambarie) 🐛
- Clinton Adebayo (Ad3bay0c) 🐛
- Omoyemi Arigbanla (yemmyharry) 🐛
- Victor Anyimukwu (udodinho) 🐛
- Franklyn Omonade (nade-harlow) 🐛
- Chisom Amadi (Tchisom17) 🐛
- Nonso Okike (okikechinonso) 🐛
- Shuaib Olurode (OShuaib) 🐛
- Chukwuebuka Iroegbu (iBoBoTi) 🐛
- Nnah Nnamdi (techagentng) 🐛