Naijafotos is a photo repository designd to show the beauty of photography by Nigerians. Whether professionals or amateurs, users are encouraged to share their stories with the world in pictures.
Ensure you have the following installed on your local machine:
- NodeJS
- MongoDB or Mongo Atlas
- Docker to run in a containerized environment (optional)
-
Clone or fork repo🤷♂
- git clone <repo> - cd naijafotos - npm install
-
Create/configure
.env
environment with your credentials. A sample.env.example
file has been provided to get you started. Make a duplicate of.env.example
and rename to.env
, then configure your credentials (ensure to provide the correct details). -
Run
npm run dev
to start the server and watch for changes
-
After cloning and configuring your
.env
file,- docker volume create --name=mongo_external - npm run docker:build - npm install
All API requests are made by sending a secure HTTPS request using one of the following methods, depending on the action being taken:
POST
Create a resourceGET
Get a resource or list of resourcesPATCH
Update a resourceDELETE
Delete a resource
For POST
and PATCH
requests, the body of your request may include a JSON payload.
Each response will be returned with one of the following HTTP status codes:
200
OK
The request was successful201
Created
Successful request, A new resource has been created204
No Content
Request was successful but there's no request returned (Used in Delete requests)400
Validation Errors or Bad Request
There was a problem with the request (malformed)401
Unauthorized
The supplied API credentials are invalid403
Forbidden
The credentials provided do not have permissions to access the requested resource404
Not Found
An attempt was made to access a resource that does not exist in the API409
Conflict
Data already exists in the database (Used when trying to sign up or update a unique field)500
Server Error
An error occurred on the server
Check documentation here