Giter VIP home page Giter VIP logo

fdn-melvina-bot's Introduction

Welcome to fdn-melvina-bot ๐Ÿ‘‹

Version License: MIT Twitter: yanndurand11

Discord bot for the Ponce's sub community called "Fleurs de Nantes". This bot will help us to manage many IRL and IG events created on our discord server and add some missing features from the native one.

Generate SSH key (In order to clone project in more secure way)

mkdir -p ~/.ssh
chmod 0700 ~/.ssh
cd ~/.ssh
ssh-keygen

cat id_rsa.pub

Install with NPM

npm install

Create your own .env file.env

cp .env.dist .env

DB Postgres install

  • Docker engine (CLI or desktop App) : Docker install with Postgis image to monitorate the DB
    docker run -d \
      -p 5432:5432 \
      -e POSTGRES_PASSWORD=postgres \
      -e POSTGRES_USER=postgres \
      postgis/postgis:11-3.0-alpine

OR

  • PostgresSQL Install on UNIX system :
     sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
     wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
     sudo apt-get update
     sudo apt install postgresql-11
     sudo apt install postgis postgresql-11-postgis-3
    

To start server :

sudo -u postgres pg_ctlcluster 11 main start

If this error occurs "Could not create /var/run/postgresql/11-main.pg_stat_tmp: No such file or directory" when starting server :

  cd /var/run
  sudo mkdir postgresql
  chown -R postgres.postgres postgresql/
  sudo -u postgres pg_ctlcluster 11 main start

Usage

Create DB

npm run test:prepare

This script erase the existing DB and replace it with fresh one.

If you want to execute latest migrations files run this :

npm run sequelize db:migrate

You can undo the latest migration with this :

npm run sequelize db:migrate:undo

/!\ If there is problems while executing test:prepare and those problems are related to PG and/or sequelize, run this :

npm install -g pg sequelize sequelize-cli 

Reexecute the prepare or migrate script

Start the bot

npm run start

Run tests

Unit tests

npm run test:unit

Integration tests

npm run test:integ

Features tests

npm run test:features

Execute all tests

npm run test:all

Tips unit and integration tests

You can run only one (or more) specified test(s) (who start with .it) or a tests group (starting with .describe) by adding .only. Example :

> describe("Commands :: Handlers :: createOutingEvent", () => {
> describe.only("ValidationMiddleWare", () => {

Tips tests features

To execute unique specified feature test, execute this command :

npm run test:features -- --name "[scenario name]"

Author

๐Ÿ‘ค Yann Durand

Show your support

Give a โญ๏ธ if this project helped you!


This README was generated with โค๏ธ by readme-md-generator

fdn-melvina-bot's People

Contributors

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