Skip to content

Hasura + HAPI + PG Backend with EOSJS and KEOS wallet 🚀

License

Notifications You must be signed in to change notification settings

solocao/backend-boilerplate

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

EOSCR Backend Boilerplate

N|Solid

JavaScript Style Guide GitHub GitHub repo size Twitter Follow GitHub forks

A highly scalable skeleton with best practices, ideal for backend projects quick start

Version

  • 0.1.0

Features!

This boilerplate features all the latest tools and practices in the industry

  • hasura Hasura GraphQL Engine is an opensource service that connects to your databases & microservices and auto-generates a production-ready GraphQL backend

  • hapi A back end service for custom busines logic integrated with hasura using actions

  • docker-compose Compose is a tool for defining and running multi-container Docker applications

File Structure

Within the download you'll find the following directories and files:

eoscrbackendboilerplate/
├── hasura
│ ├── migrations
│ └── config.ymal
├── hapi
│ ├── src
│ | ├── config
│ | ├── api
│ | ├── routes
│ | └── config.ymal
│ ├── .dockerignore
│ ├── .eslintrc
│ ├── .prettierrc
│ ├── Dockerfile
│ ├── yarn-lock.json
│ └── package.json
├── .env.example
├── .gitignore
├── docker-compose.yaml
├── .LICENSE
├── .prettierrc
├── Dockerfile
├── LICENSE
└── README.md

There are some important folders like

  • hapi/src/api should have all reusable code for example a code to generate tax invoice
  • hapi/src/routes this folder should only have the endpoint mapping and params validations and use functions from api folder to handle the business logic

Installation

Basic knowledge about Docker, Docker Compose and NodeJS is required.

Before to start

Somethings you need before getting started:

First time

  1. Clone this repo using git clone --depth=1 https://github.com/eoscostarica/backend-boilerplate.git <YOUR_PROJECT_NAME>
  2. Move to the appropriate directory: cd <YOUR_PROJECT_NAME>.
  3. Copy the .env.example then update the environment variables according to your needs
# global
STAGE=dev
APP_NAME=eoscr-backend-boilerplate

# wallet
WALLET_DATA=./wallet_data

# postgres
POSTGRES_USER=eoscr
POSTGRES_PASSWORD=password
POSTGRES_DB=localdb
POSTGRES_DATA=./db_data

# hasura
HASURA_GRAPHQL_ENABLE_CONSOLE=true
HASURA_GRAPHQL_DATABASE_URL=postgres://eoscr:password@postgres:5432/localdb
HASURA_GRAPHQL_ADMIN_SECRET=myadminsecretkey
HASURA_GRAPHQL_UNAUTHORIZED_ROLE=guest

# hapi
HAPI_EOS_API_ENDPOINT=https://jungle2.eosio.cr
HAPI_EOS_API_CHAIN_ID=e70aaab8997e1dfce58fbfac80cbbb8fecec7b99cf982a9444273cbc64c41473
HAPI_EOS_BASE_ACCOUNT=baseaccount
HAPI_EOS_BASE_ACCOUNT_PASSWORD=PW...
HAPI_EOS_WALLET_URL=http://wallet:8888
HAPI_HASURA_URL=http://hasura:8080/v1/graphql
HAPI_HASURA_ADMIN_SECRET=myadminsecretkey
HAPI_SERVER_PORT=9090
HAPI_SERVER_ADDRESS=hapi

Quick start

At this point you can run make run, you can check the services runing on:

License

MIT © EOS Costa Rica

Contributing

Please Read EOS Costa Rica's Open Source Contributing Guidelines.

Please report bugs big and small by opening an issue

Contributors

Thanks goes to these wonderful people (emoji key):

Xavier Fernandez
Xavier Fernandez

🤔📝📢🚇
Teto Gomez
Teto Gomez

🤔💻👀
Adriel Diaz
Rubén Abarca Navarro

📃💻😎
Adriel Diaz
Adriel Diaz

🏡💻❤️

This project follows the all-contributors specification. Contributions of any kind welcome!

About EOS Costa Rica


EOS Costa Rica is an independently-owned, self-funded, bare-metal Genesis block producer that provides stable and secure infrastructure for EOSIO blockchains. We support open source software for our community while offering enterprise solutions and custom smart contract development for our clients.

eoscostarica.io Support OpenSource!

About

Hasura + HAPI + PG Backend with EOSJS and KEOS wallet 🚀

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 69.8%
  • Makefile 21.5%
  • Dockerfile 8.7%