Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sodiqsanusi/uptick-backend-assessment
This is a backend application built following the prompt of the Uptick Assessment project
https://github.com/sodiqsanusi/uptick-backend-assessment
backend express mongodb mongoose nodejs nosql
Last synced: 27 days ago
JSON representation
This is a backend application built following the prompt of the Uptick Assessment project
- Host: GitHub
- URL: https://github.com/sodiqsanusi/uptick-backend-assessment
- Owner: sodiqsanusi
- Created: 2023-04-26T23:44:35.000Z (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2023-05-02T01:35:35.000Z (over 1 year ago)
- Last Synced: 2024-11-08T21:32:26.617Z (3 months ago)
- Topics: backend, express, mongodb, mongoose, nodejs, nosql
- Language: JavaScript
- Homepage:
- Size: 62.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Notes API
A simple backend API that allows users create, read, update and delete their notes.
Built following the [Uptick Backend Assessment Prompt](./uptickBackendAssessment.pdf)
### Technologies
![Express.js](https://img.shields.io/badge/express.js-%23404d59.svg?style=for-the-badge&logo=express&logoColor=%2361DAFB)
![JavaScript](https://img.shields.io/badge/javascript-%23323330.svg?style=for-the-badge&logo=javascript&logoColor=%23F7DF1E)
![NodeJS](https://img.shields.io/badge/node.js-6DA55F?style=for-the-badge&logo=node.js&logoColor=white)
![Git](https://img.shields.io/badge/git-%23F05033.svg?style=for-the-badge&logo=git&logoColor=white)
![MongoDB](https://img.shields.io/badge/MongoDB-%234ea94b.svg?style=for-the-badge&logo=mongodb&logoColor=white)### Installation
First, you need to install the dependencies.
```bash
$ npm i
```
secondly, you need to create a `.env` file and copy the `.env.example` file to it.
```bash
$ cp .env.example .env
```
Finally, you need to run the server.
```bash
$ npm run server
```### Base URL
https://uptick-backend-assessment.onrender.com### Usage
#### Registration
* Route: /api/user/register
* Method: POST
* Body:
```java
{
name: Your name here,
email: [email protected],
password: yourPassword
}
``````java
* Response:
* 201: success || Created
* 400: error || Bad Request
* 500: error || Server Error
```#### Login
* Route: /api/user/login
* Method: POST
* Body:
```java
{
email: [email protected],
password: yourPassword
}```
* Response
```java
200: success
400: error || Bad Request
500: error || Server Error
```#### Get User Details
* Route: /api/user/me
* Method: GET (Authentication required to access route)
* Authorization: Bearer *token*
* Response
```java
200: success
400: error || Bad Request
500: error || Server Error
```#### Create New Note
* Route: /api/notes
* Method: POST (Authentication required to access route)
* Authorization: Bearer *token*
* Body:
```java
{
title: notes title,
body: notes content
}```
* Response status Codes:
```java
201: success || Created
401: error || Unauthorized
400: error || Bad Request
500: error || Server Error
```#### Get a Note
* Route: /api/notes/:id
* Method: GET (Authentication required to access route)
* Authorization: Bearer *token*
* Response
```java
200: success
401: error || Unauthorized
500: error || Server Error
```#### Get all Notes
* Route: /api/notes
* Method: GET (Authentication required to access route)
* Authorization: Bearer *token*
* Response```java
200: success
401: error || Unauthorized
500: error || Server Error
```#### Update a Note
* Route: /api/notes/:id
* Method: PUT (Authentication required to access route)
* Authorization: Bearer *token*
* Body:
```java
{
title: notes title,
body: notes content
}
```
* Response
```java
200: success
401: error || Unauthorized
500: error || Server Error
```#### Delete a Note
* Route: /api/notes/:id
* Method: DELETE (Authentication required to access route)
* Authorization: Bearer *token*
* Response
```java
200: success
401: error || Unauthorized
500: error || Server Error
```#### Delete all Notes
* Route: /api/notes
* Method: DELETE (Authentication required to access route)
* Authorization: Bearer *token*
* Response
```java
200: success
401: error || Unauthorized
500: error || Server Error
```