Skip to content

Latest commit

 

History

History
125 lines (90 loc) · 2.81 KB

README.md

File metadata and controls

125 lines (90 loc) · 2.81 KB

Routinely API

version license main tool dev tool

Requirements

Make a clone of the repository

Create a folder on your computer and clone the repository:

git clone https://github.com/RoutinelyOrganization/routinely-api.git

Setup

  • Copy file .env.example from project root
  • Rename it to .env
  • Fill up the info:
# Replace the bracketed examples "[Database username]" with their final value "root"

PORT=[Server port]
# e.g: 3000

NODE_ENV=[Current application environment]
# e.g: development

SALT_SESSION=[Secret string for hashing session tokens]
# e.g: my_secret_string

SALT_DATA=[Secret string for hashing sensitive data]
# e.g: my_new_secret_string

SALT_ROUNDS=[Salt rounds for password hashing]
# e.g: 10

EMAIL_HOST=[Email host name]
# e.g: sandbox.smtp.mailtrap.io

EMAIL_PORT=[Email port]
# e.g: 2525

EMAIL_USERNAME=[Email user name]
# e.g: my_email_user_name

EMAIL_PASSWORD=[Email password]
# e.g: my_email_password

FROM_EMAIL=[Email adress]
# e.g: [email protected]

POSTGRES_USER=[Postgres user]
# e.g: root

POSTGRES_PASSWORD=[Postgres password]
# e.g: example

POSTGRES_DB=[Postgres database name]
# e.g: api-dev

POSTGRES_HOST=[Postgres host]
# e.g: localhost

POSTGRES_PORT=[Postgres port]
# e.g: 5432

DATABASE_URL="postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/${POSTGRES_DB}?schema=public"
# ! This value does not need to be changed, use it as is.

Recommended email service: Mailtrap

Install dependencies

After cloning and whenever you synchronize the repository, run the command below to keep the dependencies up to date:

npm install

Running the app

Development mode: This command runs all the commands needed for docker configuration

npm run dev

Development in minimal mode:
You must run normal mode at least once before using this mode

npm run dev:min

Production mode:

# build
npm run build

# start
npm run start:prod

Test

unit tests:

npm run test

e2e tests:

npm run test:e2e

Support

Read more here.

Stay in touch

Author - Routinely's backend team

License

Routinely API is MIT licensed.