Git Product home page Git Product logo

back-end-node-ng-chat's Introduction

Back-end-Node-NG-chat

Hello and Welcome to the back-end part of my first and ongoing Node/Angular chat !

Install

  • To install the following project, start by cloning or downloading it

  • Once you are in the project folder in your computer :

$ npm install

It will install all the dependencies needed to run this NodeJs API and the socket server Do take note that in this project, i am using MySql as my chosen database, and Sequelize for the ORM If you wish to use MariaDB or PostGreSql, a few tweaks might be needed, such as

$ npm install pg 

for PostgreSql e.g

  • You will also want to change your DB config in the config.json, for instance :
{
    "development": {
    "username": "Your_User_Name_Here",
    "password": "Your_Password_Here",
    "database": "Your_DB_Name_Here",
    "host": "127.0.0.1",
    "port": "3306",
    "dialect": "mysql",
    "operatorsAliases": false
    },
    ...
}

Run migrations

Now that you have everything ready (I hope), you will have to run some migrations to get your DB in order. I personnaly had some issues with Sequelize automatic model synchronisation, so while I work on that, the best way to get started is :

$ sequelize db:create

( Or $ node_modules/.bin/sequelize db:create if you don't have it installed globally).It Will create you DB. Check on phpMyAdmin or directly in your terminal via

$ mysql -u Your_user_name -p

Then to migrate :

$ sequelize db:migrate

(Or $ node_modules/.bin/sequelize db:migrate)

Create a .env file with your private JsonWebToken Key

At the root of your directory :

$ sudo vim .env

Add JWT_KEY=your_very_complex_key to it

Start the server

Now you can start your server !

$ npm start

Go Get and install the Front-end !

You can just do that here

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.