GithubHelp home page GithubHelp logo

khuzama98 / expressjs-socketio-boilerplate Goto Github PK

View Code? Open in Web Editor NEW

This project forked from aaron5670/expressjs-socketio-boilerplate

0.0 2.0 0.0 28 KB

๐Ÿ“ฆ Simple Express.js & Socket.io Boilerplate

JavaScript 100.00%

expressjs-socketio-boilerplate's Introduction

๐Ÿ“ฆ Express.js & Socket.io Boilerplate

Simple Express.js & Socket.io Boilerplate.

โœจ Features

  • Express 4.16
  • Mongoose 5.7
  • Passport.js with Bcrypt.js
    • Login endpoint
    • Register endpoint
    • Username availability check endpoint
    • Logout endpoint
  • Socket.io integration for real-time, bidirectional and event-based communication.
  • Social login / register integration.

๐Ÿ“ Getting Started

git clone https://github.com/aaron5670/ExpressJS-SocketIO-Boilerplate.git

cd expressjs-socketio-boilerplate

npm install

// Optional: if you want dummy data, then run this seed file
node seed.js

node server.js

๐Ÿš€ Endpoints

The following endpoints are available

Login

url:    /api/v1/auth/login
method: POST

This request expects the following body:

{
  "username": "jane", 
  "password": "securepassword1"
}

It will response the client the following object after a successful login:

{
  "success": true,
  "username": "jane",
  "message": "Successful login, welcome!"
}

Register

url:    /api/v1/auth/register
method: POST

This request expects the following body:

{
  "name": "John Doe",
  "username": "john",
  "password": "password123"
}

It will response the client the following object after a successful register:

{
  "success": true,
  "message": "User is successfully registered!"
}

Username availability check

url:             /api/v1/auth/username-availability
method:          GET
query parameter: username

This request expects a request like:

https://localhost:3005/api/v1/auth/username-availability?username=john

It will response the client the following object after a successful request:

{
  "usernameAlreadyInUsage": true
}

Logout

url:    /api/v1/auth/logout
method: GET

It will response the client the following object after a successful request:

{
  "success": true
}

expressjs-socketio-boilerplate's People

Contributors

aaron5670 avatar

Watchers

 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.