Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/khalil-codes/goals-mern-app

Goalsy is a Full Stack App. The Frontend is built using React, Redux and Redux Toolkit. The Backend is built using Node, Express and MongoDB. I've used jsonwebtoken to generate JWT and bcryptjs to hash password in backend. Only Authenticated user is authorized to Add Goal, Delete Goal, View Goals and Update Goal.
https://github.com/khalil-codes/goals-mern-app

Last synced: 27 days ago
JSON representation

Goalsy is a Full Stack App. The Frontend is built using React, Redux and Redux Toolkit. The Backend is built using Node, Express and MongoDB. I've used jsonwebtoken to generate JWT and bcryptjs to hash password in backend. Only Authenticated user is authorized to Add Goal, Delete Goal, View Goals and Update Goal.

Awesome Lists containing this project

README

        

# Getting Started with App

Goalsy is a Full Stack App. The Frontend is built using React, Redux and Redux Toolkit. The Backend is built using Node, Express and MongoDB. I've used jsonwebtoken to generate JWT and bcryptjs to hash password in backend. Only Authenticated user is authorized to Add Goal, Delete Goal, View Goals and Update Goal.

## API Endpoints

### User Authentication

1. Register a new user - POST [http://localhost:5000/api/users](http://localhost:5000/api/users)

| Headers | |
| ------------ | :--------------: |
| Content-Type | application/json |

Body

```json
{
"name": "Khalil Patiwala",
"email": "[email protected]",
"password": "password"
}
```

2. Login a user - POST [http://localhost:5000/api/users/login](http://localhost:5000/api/users/login)

| Headers | |
| ------------ | :--------------: |
| Content-Type | application/json |

Body

```json
{
"email": "[email protected]",
"password": "password"
}
```

3. Get Logged in user - GET [http://localhost:5000/api/users/me](http://localhost:5000/api/users/me)

| Headers | |
| ------------- | :----------------: |
| Content-Type | application/json |
| Authorization | Bearer |

### Goals Routes

1. Get users goals - GET [http://localhost:5000/api/goals](http://localhost:5000/api/goals)

| Headers | |
| ------------- | :----------------: |
| Content-Type | application/json |
| Authorization | Bearer |

2. Create a new Goal - POST [http://localhost:5000/api/goals](http://localhost:5000/api/goals)

| Headers | |
| ------------- | :----------------: |
| Content-Type | application/json |
| Authorization | Bearer |

Body

```json
{
"text": "Demo Goal Text"
}
```

2. Update a Goal - PATCH [http://localhost:5000/api/goals/<:id>](http://localhost:5000/api/goals/<:id>)

| Headers | |
| ------------- | :----------------: |
| Content-Type | application/json |
| Authorization | Bearer |

Body

```json
{
"text": "Updated Goal Text"
}
```

2. Delete a Goal - DELETE [http://localhost:5000/api/goals/<:id>](http://localhost:5000/api/goals/<:id>)

| Headers | |
| ------------- | :----------------: |
| Content-Type | application/json |
| Authorization | Bearer |

## Usage

Install dependencies

```bash
npm install
cd frontend
npm install
```

Run app:

### `npm start server`

This will start the backend API at [http://localhost:5000/api/](http://localhost:5000/api/).

### `npm start client`

This will start the frontend at [http://localhost:3000](http://localhost:3000).