Giter Site home page Giter Site logo

godsofarena-api's Introduction

API Gods of Arena

API for the web app Gods of Arena

Requirements

Installation

git clone

cd godsofarena-api
npm install

Configuration

# copy env file for all environments
cp .env .env.local
# makes your changes in .env.local, which will not be pushed
nano .env.local
# you may have to change DB settings for your database and the environment variable

Database

# create the databse 'godsofarena' and user godsofarena
CREATE DATABASE godsofarena;
create user godsofarena with encrypted password 'godsofarena';
grant all privileges on database godsofarena to godsofarena;

# do not forget to activate login option to authorize authentication from outside

# run migrations (before running server !!!) :
npm run migrate

# run seeds
npm run seeds

# now you can run the server

Modify database

If you want to edit the database (add/remove/update column, table, ...), you first need to create a new migration. This will be like a commit for the database state, and it will be possible to roll back to a previous state of the structure (not data).

cd /database
npx sequelize migration:generate --name name_of_your_migration

Edit the migration generated in database/migrations/timestamp-name_of_your_migration.js. Then run the migration to apply changes in the database :

npm run migrate

This will not change your models. You will finally have to change them accordingly, or to create one if neccessary.

Commands

npm run dev     # development server
npm run start   # production server
npm run migrate # run migrations

Structure (generated with 'tree' command)


(to come)

godsofarena-api's People

Contributors

bheroult avatar

Watchers

 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.