- This is a take home task as part of recruitment process for Kro
- Clone the repo with
git clone <repo url>
- Run
yarn
to install all the packages - Run
yarn prisma:generate
to generate Prisma - Set up or connect with Postgress database
- Run
yarn db.migration:create
to apply create migration - Run
yarn db.migration.apply
to apply migration to database - Run
yarn start:dev
to start development server on local host4001
or any other port of your choice - Run
yarn test
to run unit test - Register a user with email and password using the register endpoint.
Swagger API ducumentation
can be assessed at<base url>/swagger
e.ghttp://localhost:4002/swagger
- Get userId of the registered user and manually replace it with the userId in the seed data located in
src/commom/database/seed-data/transactions.seed.ts
- login using your email and password, go to
apa/transactions
endpoint to view all transactions by the registered user.
Please complete this task; It simulates a basic flow in a typical fintech app, so super relevant for what you’ll be doing day-to-day.
You’re going to create an app that allows users to sign up (email + PW only), log in, and view a dashboard of financial transactions for that specific user. The backend should be built with Node.js. Requirements
- Signup: Allows new users to create an account by providing an email, first name, last name, and a password. The user details should be stored in the database in a safe way.
- Login: Authenticates a user using email and password, and returns a JWT token.
- Transactions: Retrieves a list of financial transactions for the logged-in user. Each transaction should have the following fields:
- id
- amount
- type (withdrawal / deposit)
- timestamp
- payment method
- user id
A sample mock data containing transactions will be linked to this task. Feel free to attach a payment method and some user ids to the transaction and use that.
Please use PostgreSQL as your database. You can use Neon for free, or something else if you prefer You’re free to design the database how you see fit. It must be proper and follow best practices.
- Submission is expected at most 72 hours after receiving this task. Your submission should be a link to a GitHub repository containing your project. IMPORTANT: Please use different commits throughout the progress, and not just a single commit with everything. We need to see your planning process, and how you work in stages.
- Include a README file with instructions on how to set up and run the backend locally (incl. any necessary environment variables).
- Include a postman collection if possible so that the API can easily be tested Ensure your code is clean and readable. Automated tests are a bonus
Good luck!
A progressive Node.js framework for building efficient and scalable server-side applications.
Nest framework TypeScript starter repository.
$ yarn install
# development
$ yarn run start
# watch mode
$ yarn run start:dev
# production mode
$ yarn run start:prod
# unit tests
$ yarn run test
# e2e tests
$ yarn run test:e2e
# test coverage
$ yarn run test:cov
Nest is an MIT-licensed open source project. It can grow thanks to the sponsors and support by the amazing backers. If you'd like to join them, please read more here.
- Author - Kamil Myśliwiec
- Website - https://nestjs.com
- Twitter - @nestframework
Nest is MIT licensed.