Giter Site home page Giter Site logo

brianhague_dev_be's Introduction

brianhague_dev_be

Backend for brianhague.dev By Brian Hague (alphaseinor)

Tech Stack

dependencies

  • bcryptjs
  • cors
  • dotenv
  • express
  • helmet
  • jsonwebtoken
  • knex
  • pg
  • uuid

devDependencies

  • nodemon

Installation Instructions

[ ] - Fork this repo [ ] - Clone your own repo [ ] - npm i [ ] - touch .env [ ] - install postgresql on your local machine and configure .env file for your environment [ ] - run knex migrate:latest

.env file

DATABASE_URL=postgres://postgres:password@localhost:5432/postgres NODE_ENV=development test or production SECRET_JWT=whatever your secret for your jwt is SITE_NAME=yourSiteName.com CONFIRMATION_PATH=path where your confirmation emails are verfied

Deployment Instructions

[ ] - Push your changes [ ] - connect heroku to repo [ ] - add resource to heroku for heroku postgres [ ] - Fill in environment variables fro your .env file except what is already there, such as DATABASE_URL or PORT (if you defined one in your .env file) [ ] - make sure site is deployed by going to root [ ] - run knex migrate:latest on heroku server

endpoints

/api/users/login

Front end should only have access to the following fields to login.
username - text field, normalize to lower case, no special characters - required min 2 characters max 50 characters
password - text field, minimum of 8 characters - required max 255 characters

returns

{token:"jwt"}

jwt will decode to

id:"string",
is_confirmed: boolean,
twofactor_type: "string",
username:"string",
email: "string",
is_active: boolean

/api/users/register

Front end should only have access to the following fields to register.
username - text field, normalize to lower case, no special characters - required min 2 characters max 50 characters
email - text field, validated via regex - required max 255 characters
password - text field, minimum of 8 characters - required max 255 characters

returns

{token:"jwt"}

jwt will decode to

id:"string",
is_confirmed: boolean,
twofactor_type: "string",
username:"string",
email: "string",
is_active: boolean

/api/users/confirmation

Front end will forward confirmation param to confirmation endpoint as

{
  "confirmation_num":param
}

returns

will return a standard error/message group

brianhague_dev_be's People

Contributors

alphaseinor avatar dependabot[bot] avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.