Giter Site home page Giter Site logo

jlonardi / node-template Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 827 KB

Ready to use template for applications using Auth0 and Postgresql

Home Page: https://mighty-chat-demo.herokuapp.com

License: MIT License

Dockerfile 1.35% JavaScript 25.45% CSS 6.95% TypeScript 54.56% Shell 0.87% Pug 10.82%

node-template's Introduction

node-template

Basic node application ment to be a template for a node app which uses Auth0 and Postgresql. Ment to be forked for other projects in order to avoid writing the necessary boilerplate.

Development

The following are the instrocution to make the run the appication on your local machine

Database

The database is Postgres and runs in a docker container. To start the database run

npm run start-database

or alternatively

docker-compose up -d db

Application

To run the application in watch-mode for development

npm run dev

and go to http://localhost:3000

Building

To build the project for example for deployment

npm run build

The application can be run inside a docker container. The containers are build using Dockerfile. To run the app with docker

docker-compose up -d ui

NOTE ABOUT THE DATABASE URL

If your DATABASE_URL refers to 127.0.0.1, which is the loopback adapter (more here). This means "connect to myself".

When running both applications (without using Docker) on the same host, they are both addressable on the same adapter (also known as localhost).

When running both applications in containers they are not both on localhost as before. Instead you need to point the web container to the db container's IP address on the docker0 adapter - which docker-compose sets for you.

Change:

127.0.0.1 to CONTAINER_NAME (e.g. db)

Example:

DATABASE_URL: postgres://username:[email protected]:5432/mydatabase

to

DATABASE_URL: postgres://username:pgpassword@db:5432/mydatabase

node-template's People

Contributors

jlonardi avatar

Watchers

James Cloos avatar  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.