Code Monkey home page Code Monkey logo

whatsapp-gateway's Introduction

Whatsapp Gateway

Whatsapp API Gateway which can be used to send messages to a person or group, can also receive and save messages and their media for future use.

Installation

This application is made using TypeScript so it needs to be compiled into JavaScript before it can be used, here are the steps:

  1. Clone this repository using command git clone https://github.com/vermaysha/whatsapp-gateway.git
  2. Install required package yarn
  3. Create an .env file whose contents match the example in the .env.example file
  4. Make sure to do the migration to ensure that the connection is correct and the necessary tables have been created with the following command node ace migration:run
  5. Run the seeder database to fill it with the default data with the command node ace db:seed
  6. Run the following command to compile yarn build
  7. If you want to run the development server on a local network, you can run the following command yarn dev

API Documentation

To display the Documentation API, make sure you have followed the steps above, then run the following command:

yarn docs

Deployment

To run the application on the production server, make sure you have compiled this application according to the guide above, then use the following command to run

cd build
yarn install --production
yarn start

Dont forget to setup your ENV based on .env file
Using .env file in production is not recommended, USE REAL ENV !!

It is recommended to use a process manager when managing a Node.js application on a basic server.

A process manager ensures to restart the application if it crashes during runtime. In addition, some process managers like PM2 can also perform graceful restarts when re-deploying the application.

Following is an example ecosystem file for PM2.

module.exports = {
  apps: [
    {
      name: 'web-app',
      script: './build/server.js',
      instances: 'max',
      exec_mode: 'cluster',
      autorestart: true,
    },
  ],
}

LICENSE

Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.

whatsapp-gateway's People

Contributors

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