Api for Lendsqr backend interview test written in node js + typescript.
- Node Js
- MySQL
- Paystack Account
Provided you have docker
and docker compose
installed on your machine, you can follow the steps below to spin up a mysql database
- Update the key-value pairs under the field
environment
with your appropriate db credentials in thedocker-compose.yml
file - Update
.env
file database values to be in sync with that of the values specified in thedocker-compose.yml
file - Start a specific database
docker-compose -f ./docker-compose.yml up -d <service_name>
e.gdocker-compose -f ./docker-compose.yml up -d test_db
- Clone the repo
git clone https://github.com/Oluwatunmise-olat/Lendsqr-Backend-Interview-Test.git
- Navigate to repo directory
cd Lendsqr-Backend-Interview-Test
- Create a
.env
file following the format as that inenv.example
file - Install project dependencies
yarn install
- Run migrations (Database should have been setup)
yarn run migrate
- Start application
yarn run start:dev
- Note: To receive Paystack webhooks you have to register a
webhook url
. For this, i recommend usingngrok
as a reverse proxy.
- Create a test database either by following the docker setup above or manually creating one
- Update the database credentials in the
.env
to match that of the created test database - Run migrations
yarn run migrate
- Run tests
yarn run test
- Node Js
- Typescript
- MySql
- Knex
- Paystack