Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/smakosh/article-auth-api
Example REST API for my recent article
https://github.com/smakosh/article-auth-api
Last synced: about 14 hours ago
JSON representation
Example REST API for my recent article
- Host: GitHub
- URL: https://github.com/smakosh/article-auth-api
- Owner: smakosh
- Created: 2019-12-01T18:05:52.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2021-05-11T08:33:53.000Z (over 3 years ago)
- Last Synced: 2024-11-11T05:58:07.720Z (about 1 month ago)
- Language: JavaScript
- Size: 598 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Hire Dev API
## Setting up the env variables
Create `.env` file and pass in the next values:
> DM me for the key values```bash
DB=mongodb://localhost:27017/hiredev
SECRET_KEY=xxxxx
REACT_APP_URL='http://127.0.0.1:3000'
NODE_ENV=dev
SENDGRID_API_KEY=xxxxxx
```## Installation
1. `yarn`
2. Start database: `yarn database`
3. Start the dev server: `yarn dev`> Replace `mongo-data` with the name of the folder your data is stored within the npm scripts.
## Models
User
- firstName
- lastName
- username
- password
- tokens## Routes
- User
```bash
POST /api/user/register
// Register a new user and returns user data with the generated token
// PublicPOST /api/user/login
// Login user and returns user data with the generated token
// PublicDELETE /api/user/logout
// Logout
// PrivatePOST /api/user/resend/email
// Resend email to confirm account
// PrivateGET /api/user/verify
// Verifies token is not expired
// PrivatePATCH /api/user/email/confirm
// Confirms email
// PrivatePATCH /api/user/reset/password
// Resets password
// PrivatePOST /api/user/forgotten/password
// Sends email to reset password
// PrivatePOST /api/user/users/all
// Returns all registered users
// PublicPOST /api/user/users/total
// Returns total registered users
// PublicPOST /api/user/:id
// Returns specific user
// PublicPATCH /api/user/edit
// Edits user account
// PrivatePATCH /api/user/follow/:id
// Follow another user
// PrivatePATCH /api/user/unfollow/:id
// Unfollow another user
// PrivatePATCH /api/user/edit
// Edits user account
// Private
```