Before starting to work on the API, you will first need to install the following :
- Git
- Node.js (see package.json "engine.node" field for the version to use, and we advise to manage NodeJS versions locally with n)
- Docker
- Yarn
- PDFtk
- For MacOS either download and install the last pkg or do the install via homebrew
And make sure that :
- You have been granted an access to the Appenin falco-api gitlab repository
- You have added your ssh key to gitlab
- You have a
.env
file at the root of the project (you can take the.env.example
as an example) - You will need to use your own Stripe/HelloSign API Key and replace it in your
.env
. See.env.example
for more details in order to setFALCO_API_STRIPE_API_KEY
,FALCO_API_HELLO_SIGN_API_KEY
,FALCO_API_HELLO_SIGN_CLIENT_ID
git clone git@gitlab.com:appenin/falco-api.git
cd falco-api
yarn install --frozen-lockfile
For the API to work properly, you need to have a database running. You can run one locally in Docker with the following command :
yarn containers:db:start
Then, you can launch the API :
yarn start
Or
yarn dev
to start with watch mode. This can be convenient in development mode to avoid restarting manually the server after each modification in the code.
The API can be accessed at http://localhost:8080
For the API documentation, go to http://localhost:8080/documentation
If you already have launched the database locally and need to apply newly created migrations, run :
yarn db:migrate
Or
yarn db:undo
if you need to revert the last migration
The automated tests can be launched with the command :
yarn test
This will run all the automated tests and generate the appropriate coverage report.
Ah, by the way, you need to have the database running locally before launching the automated tests !
Please refer to CONTRIBUTING.md for contribution guidelines.