GithubHelp home page GithubHelp logo

webapp-be's Introduction

webapp-be

Starter kit for backend of web applications.

Development

Set variables in .env file then start development environment:

nvm install
yarn install
yarn serve

Development database

Load environment variables:

source .env

Start database:

docker run --name ${PG_DATABASE:?}-db \
  --restart=always -d \
  -e POSTGRES_USER=${PG_USER:?} \
  -e POSTGRES_PASSWORD=${PG_PASSWORD:?} \
  -e POSTGRES_DB=${PG_DATABASE:?} \
  -e POSTGRES_OPTIONS="-c log_statement=all" \
  -p 5432:5432 \
  postgres:14-alpine

Connect to database:

docker exec -ti ${PG_DATABASE:?}-db psql ${DB_URI:?}

Import schema:

cat database/0-funcs.sql database/1-schema.sql | docker exec -i ${PG_DATABASE:?}-db psql ${DB_URI:?}

Dump database:

docker exec -ti \
  -e POSTGRES_USER=${PG_USER:?} \
  -e POSTGRES_PASSWORD=${PG_PASSWORD:?} \
  -e POSTGRES_DB=${PG_DATABASE:?} \
  ${PG_DATABASE:?}-db \
  pg_dump --clean -U ${PG_USER:?} ${PG_DATABASE:?} > database/dump.sql # schema and data

Deployment

CI is powered by GitHub actions (.github folder):

  • PR on main branch are tested but not deployed to any environment
  • commits on main branch are deployed to staging environment
  • tags on main branch are deployed to production environment

webapp-be's People

Contributors

damianobarbati avatar emiliosp avatar

Stargazers

 avatar

Watchers

James Cloos avatar  avatar

webapp-be's Issues

data validation

@mello (aka @emilioSp) I'm still opting out of typescript, which anyway do not fill the purpose since a json input to the webserver will not respect any code annotion.

What's the best (aka cost-effective less-complex) solution for data validation right now?

I was going to give ajv a try.

[fix] various fixes necessary

  • .run folder should contain a run used by default when running a standalone script
  • tests are broken in CLI but they are working in webstorm debugger

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.