Dreezy305 / User-Acc-Backend

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Nest Logo

A progressive Node.js framework for building efficient and scalable server-side applications.

NPM Version Package License NPM Downloads CircleCI Coverage Discord Backers on Open Collective Sponsors on Open Collective Support us

Description

This assessment is a mini-project designed by Skye Wallet to test my approach to solving real-world problems.

Installation instructions:

  • To install and run the project, follow these steps:

Clone the repository using the command:

$ git clone https://github.com/<username>/<repository>.git

Install dependencies by running the following command:

$ npm install

An enxmple env file is in the code base, it contains the db connection string. you can Create a .env file at the root directory of the project and add the following environment variables found in the example file:

$ DATABASE_URL=<mongodb_connection_string>

Run the app

# watch mode
$ npm run start:dev

# production mode
$ npm run start:prod

Test

# unit tests
$ npm run test

# e2e tests
$ npm run test:e2e

# test coverage
$ npm run test:cov

Usage instructions:

To use the APIs, you can use tools like Postman or Thunderclient. Here are the available endpoints:

  1. user/signup - POST: Creates a user with the give name, phone number, email, password.

  2. Upon, user creation, a 7 digit alpha-numeric paymentID is being generated.

  3. generatePaymentId/:id - PUT: generates a 7 digit alpha-numeric payment ID for the users, this API requires a user id.

  4. /deletePaymentId/:id/paymentId/:paymentId - DELETE: Deletes a the payment ID with the given ID

  5. /getUserByPaymentId/:paymentId - GET: Retrieves a user associated with a given payment ID

  6. /transferFunds - POST: Sends funds from one user to another

  7. /getTransactionHistory - POST: Retrieves the transaction history of a particular user.

  8. the test suite can be located in the app.e2e-spec.ts file

The API documentation was generated using Swagger. You can access the documentation at http://localhost:8000/docs. or https://user-management-assessment.herokuapp.com/docs

Contributing Guidelines:

  • Fork the repository and create a new branch for your changes.
  • Make your changes and write tests for them.
  • Submit a pull request with your changes.
  • Your pull request will be reviewed by a maintainer and merged if it meets the project's standards.

Contact Information

Acknowledgments:

  • This project was created using NestJS, Prisma, Typescript and MongoDB.
  • e2e test suite was written with nestjs/testing and jest.

About


Languages

Language:TypeScript 96.9%Language:JavaScript 2.9%Language:Procfile 0.2%