0.0.1 • Published 4 years ago

probate-api v0.0.1

Weekly downloads
-
License
UNLICENSED
Repository
bitbucket
Last release
4 years ago

Probate API

Getting started

Make sure you have NodeJS installed or later and have connected to a running Postgres instance.

Clone the project and install the dependencies:

npm i

Get db submodule

git submodule add <git@github ...> db/server

Get the development server running and auto-reloading:

npm run dev

When ready for production run npm run build, which will transpile the code from ES6 to ES5, compatible with most NodeJS versions, to the dist folder.

npm start will start the production server reading from the dist folder.

Create Environment

eb create staging-env --single --cname probateapp-web-st --cfg probateapp-web-pr

Deploy

Because of the need for a build process EB is configured to deploy a ZIP archive. By using the following command it will deploy the archive stored in 'dist/archive.zip' and give it the version label of the first sever characters of the last commit.

eb deploy --nohang -l `date +'%Y%m%d%m%S'`-`git log --format="%H" -n 1 | cut -c1-7`

Database

The configuration file .sequelizerc for sequelize-cli specifies the location of the environment config, migration, and seeder data. A sample environment configuration file can be can be found at server/config/sequelize.json.sample. Copy this file to sequelize.json in the same location and edit it with your specific development environment settings. This file is ignored by git to ensure that no passwords are stored in the repository.

Install the sequelize-cli tool with the following command:

npm install -g sequelize-cli pg

Run the following commands to create the tables, apply migrations, and populate any initial data.

sequelize db:migrate --url $POSTGRES_UR
sequelize db:seed:all --url $POSTGRES_UR