-
Build a node API that takes a passport image and returns the date of birth & expiry date.
-
Build a front-end web app where users can upload images of their passports, and by calling the API you built in part 1, return the date of birth & expiry date to the user.
- Nodejs
- Express
- PostgreSQL
- Jest
- Docker
- Typescript
- React
- Styled-components
- Material-UI
- Redux-toolkit
- Install latest node and npm.
- Run the APIs: Change to root of the project and run
docker-compose up
To run tests on backend, use the following command:
npm i
npm test
To clean the build of the backend (dist/) on run:
npm run clean
To run the backend locally, run the following commands:
npm i
npm run start_local
To run the frontend locally, run the following commands:
npm i
npm start
curl -i -H 'Accept: application/json' localhost:3000/healthcheck
```{
"success": true,
"status": 200,
"data": {
"name": "borderless-takehome-backend",
"version": "1.0.0"
}
}```
curl -i -H 'Accept: application/json' http://localhost:3000/passport/generate-signed-url?fileName=test.jpeg&contentType=image/jpeg
```{
"success": true,
"status": 200,
"data": {
"url": ""
}
}
## POST passport/extract-dates
curl --location --request GET 'http://localhost:3000/passport/extract-dates' --header 'Content-Type: application/json' --data '{"imagePath": "bucket-name"}'
### Response
```{
"success": true,
"status": 200,
"data": {
"dateOfBirth": "28 Nov 66",
"expiryDate": "08 Apr 16"
}
}