Giter VIP home page Giter VIP logo

educado-api-server's Introduction

Educado Server

Server application of Educado. Made with ❤️ for UnionBank Blockchain Xcellerator Experts Program case study.

Prerequisites

  • Docker
  • Node.js >= 8.0.0
  • npm >= 3.0.0
  • git

Setup

Clone the repository.

git clone https://github.com/xcellerator-sybilian/educado-api-server.git && cd educado-api-server

Install dependencies.

npm install

Create Docker network.

docker network create --driver bridge --subnet 172.18.0.0/16 --gateway 172.18.0.1 educado-network

Pull PostgreSQL Docker image.

docker pull postgres:12.0

Create PostgreSQL Docker container. Mount $HOME/.docker/volumes/postgres on the host machine to the container side volume path /var/lib/postgresql/data. This ensures that postgres data persists even after the container is removed. Update this path if you have your own customized volume path.

docker run --restart=always --net educado-network --ip 172.18.0.3 --name educado-database-server -d -p 5432:5432 -v $HOME/.docker/volumes/postgres:/var/lib/postgresql/data -e POSTGRES_DB=educado -e POSTGRES_USER=root -e POSTGRES_PASSWORD=secret postgres:12.0

Pull Adonis Docker image.

docker pull stephenafamo/adonisjs:1.0.0

Create Adonis Docker container. Mount $HOME/Projects/Educado/educado-api-server on the host machine to the container side path /var/www. Update this path to your own project path.

docker run --restart=always --net educado-network --ip 172.18.0.4 --name educado-api-server -d -p 3333:3333 -v $HOME/Projects/Educado/educado-api-server:/var/www stephenafamo/adonisjs:1.0.0

Generate .env file.

cp .env.example .env

Generate app key.

adonis key:generate

Update environment variables.

HOST=EDUCADO_SERVER_IP_ADDRESS
PORT=3333
.
.
.
DB_CONNECTION=pg
DB_HOST=POSTGRESQL_SERVER_IP_ADDRESS
DB_PORT=5432
DB_USER=postgres
DB_PASSWORD=DATABASE_PASSWORD
DB_DATABASE=DATABASE_NAME

Run migrations.

adonis migration:run

Run seeds.

adonis seed

educado-api-server's People

Contributors

apquinit avatar snyk-bot 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.