Giter VIP home page Giter VIP logo

chatty's Introduction

About β€’ Tech Stack β€’ How it works β€’ Endpoints β€’ Documentation β€’ Authors β€’ License

ℹ️ About

Chat with Socket.IO created at RocketSeat Next Level Week 5.0, using stack TypeScript with Node.js.


πŸ›  Tech Stack

The following tools were used in the construction of the project:


πŸš€ How it works

πŸ‘‰ Pre-requisites

Before you begin, you will need to have the following tools installed on your machine: Git, Node.js and Yarn. In addition, it is good to have an editor to work with the code like VSCode.

🏁 Start

# Clone this repository
$ git clone https://github.com/BiaChacon/chatty.git

# Access the project folder cmd/terminal
$ cd chatty

🎲 Running the server

# go to the api folder
$ cd api

# install the dependencies
$ npm install

#Create migrations
$ yarn typeorm migration:run

# Run the application
$ yarn dev

# The server will start at port: 3333 - go to http://localhost:3333

πŸ–₯️ Endpoints

πŸ’  To access the Admin chat go to πŸ‘‰ http://localhost:3333/pages/admin

πŸ’  To access the Client chat go to πŸ‘‰ http://localhost:3333/pages/client


πŸ—Ž Documentation API

Settings

πŸ“ Create Settings [/settings] [POST]

Request

  • Body
{
    "chat": "true",
    "username": "admin"
}

Response 201 (application/json)

[
  {
    "id": "admin_id",
    "username": "admin",
    "chat": "true",
    "updated_at": "2021-04-22T19:22:37.000Z",
    "created_at": "2021-04-22T19:22:37.000Z"
}
]

πŸ“ Update Settings [/settings/admin] [PUT]

Request

  • Body
{
    "chat": "false"
}

Response 201

User

πŸ“Create User [/users] [POST]

Request

  • Body
{
    "email": "[email protected]"
}

Response 201 (application/json)

[
 {
    "id": "user_id",
    "email": "[email protected]",
    "created_at": "2021-04-22T19:37:24.000Z"
}
]
Message

πŸ“Send Message [/messages] [POST]

Request

  • Body
{
    "user_id": "user_id",
    "text": "message"
}

Response 201 (application/json)

[
  {
    "id": "message_id",
    "text": "message",
    "user_id": "user_id",
    "created_at": "2021-04-23T19:40:02.000Z"
  }
]

πŸ“List Messages By User [/messages/:user_id] [GET]

Response 201 (application/json)

[
  {
    "id": "message_id",
    "admin_id": "admin_id",
    "text": "message",
    "user_id": "user_id",
    "created_at": "2021-04-22T19:40:02.000Z",
    "user": {
      "id": "user_id",
      "email": "[email protected]",
      "created_at": "2021-04-22T19:37:24.000Z"
    }
  }
]

πŸ‘©πŸ½β€πŸ’» Authors


Bia Chacon

πŸ’»

πŸ“ License

This project is under MIT. See at here LICENSE for more information.


README versions

English πŸ‡ΊπŸ‡Έ | Portuguese πŸ‡§πŸ‡·

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.