Giter Site home page Giter Site logo

ht_backend_node_pg_express's Introduction

HT backend using node, express, sequelize and postgres

A simple REST api for the ht app, containing routes for users, technologies votes and links.

Scaffolded following scotch.io tutorial with correction for sequelize v4.

How to

Start the server for dev

Assumes a postgres db is running according to config, otherwise see how to start a dev db

npm run start:dev

Migrate db if needed (assumes sequelize cli globally installed)

sequelize db:migrate

Seed data if needed (assumes sequelize cli globally installed)

sequelize db:seed:all

Start a dev db using docker

Start a postgres container

docker run -p5432:5432 --name ht_postgres -e POSTGRES_PASSWORD=mysecretpassword -d postgres

Connect to the db

docker run -it --link ht_postgres:postgres postgres psql -h postgres -U postgres

Create user and db

CREATE USER ht_backend;
ALTER USER ht_backend WITH PASSWORD 'devpassword';

CREATE DATABASE ht_db;
GRANT ALL PRIVILEGES ON DATABASE ht_db TO ht_backend;

You should now be able to connect to ht_db as ht_backend,

docker run -it --link ht_postgres:postgres postgres psql -h postgres -U ht_backend -d ht_db

Todos

  • secure: ensure only the 'right users' are acknowledged and that all routes require the user to be logged in
  • define and add permissions, which users shall be able to edit / delete votes, links and reviews?
  • address different error types and return correct response codes
  • add tests, unit and / or e2e at least

ht_backend_node_pg_express's People

Contributors

gvankeerberghen 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.