https://github.com/bradgarropy/weighter-api
REST API to track your weight over time!
https://github.com/bradgarropy/weighter-api
dotenv eslint express expressjs javascript jsonwebtoken jwt mongodb mongoose node nodejs nodemailer rest rest-api web-app web-application web-server
Last synced: 2 months ago
JSON representation
REST API to track your weight over time!
- Host: GitHub
- URL: https://github.com/bradgarropy/weighter-api
- Owner: bradgarropy
- Created: 2017-08-24T04:17:51.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2018-03-15T01:57:06.000Z (over 8 years ago)
- Last Synced: 2025-09-13T01:47:59.372Z (9 months ago)
- Topics: dotenv, eslint, express, expressjs, javascript, jsonwebtoken, jwt, mongodb, mongoose, node, nodejs, nodemailer, rest, rest-api, web-app, web-application, web-server
- Language: JavaScript
- Homepage: https://weighter-api.herokuapp.com/
- Size: 69.3 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Weighter API
After creating a completely server side weight tracking app ([weighter](https://github.com/bradgarropy/weighter)), it was time to implement a client side front end, which means I also needed a REST API on the server side. Using my [NWA Template](https://github.com/bradgarropy/nwa) as a starting point, I was able to quickly spin up some user and weight models. This API acts as the backend to both the [React](https://reactjs.org/) and [Vue](https://vuejs.org/) implementations of the front end.
Both implementations are deployed on [Heroku](https://dashboard.heroku.com/apps) at the links below:
http://weighter-react.herokuapp.com/
http://weighter-vue.herokuapp.com/
You can access the API here:
https://weighter-api.herokuapp.com/
## API
### Feedback
Send feedback to the site maintainer.
```
POST /api/feedback
{
"email": ,
"feedback":
}
```
### Forgot Password
Requests a password reset token be sent to the email provided.
```
POST /api/forgot
{
"email":
}
```
### User Login
Validates user credentials and responds with a [JSON Web Token](https://jwt.io/)
```
POST /api/login
{
"email": ,
"password":
}
```
### Change Password
Changes the user's password.
```
POST /api/password
{
"current_password": ,
"new_password": ,
"confirmation":
}
```
### Reset Password
Allows the user to change their password by providing a reset token.
```
POST /api/reset/:token
{
"password": ,
"confirmation":
}
```
### User
User CRUD operations.
```
GET /api/user
GET /api/user/:id
POST /api/user
{
"first_name": ,
"last_name": ,
"email": ,
"password": ,
"confirmation": ,
}
DELETE /api/user/:id
PUT /api/user/:id
{
"first_name": ,
"last_name": ,
"email":
}
```
### Weight
Weight CRUD operations.
```
GET /api/weight
GET /api/weight/:id
POST /api/weight
{
"date": ,
"weight":
}
DELETE /api/weight/:id
PUT /api/weight/:id
{
"date": ,
"weight":
}
```
## Usage
If you would like to build and run this API locally, follow the instructions below.
First, clone the repository.
```
git clone https://github.com/bradgarropy/weighter-api.git
```
Next, install the dependencies.
```
npm install
```
Then, start the web server.
```
npm start
```
Finally, navigate to the site.
```
localhost:3000
```