/vzy-stripe-api

Primary LanguageTypeScriptApache License 2.0Apache-2.0

VZY Test API

PM Docs

https://documenter.getpostman.com/view/29881481/2sA2r6XPfd

Tasks

Task 1: Build API Endpoints

  • Develop API endpoints to connect with MongoDB Atlas
  • Create an endpoint to register new users and authenticate existing users. Upon successful authentication, generate an access token that expires after one minute. This access token should be used as an authentication header for subsequent requests
  • Implement an endpoint to update user records, accessible by authorized users

Task 2: Implement Stripe Webhook

  • Set up an endpoint to accept requests from the Stripe webhook.
  • Verify successful payment events from Stripe.
  • Upon receiving payment event, update user status to "paid" in the database.

Tools Used

  • Express
  • MongoDB
  • Stripe
  • Cloudinary
  • Nodemailer
  • Docker
  • NGINX

Achitecture

I this project i made use of clean achitecture

Application layer (REST) -> Domain Layer (Repositories) -> Data Layer (Mongodb) Which then encourages easy error handling, mock testing, and refactoring of code

For dev

Replicate .env.example to a .env file

Response Object

most likely looks like this!

{
    "status": "success",
    "message": "Successully perform an action",
    "data": {...},
}

Startup The Project

install

yarn

Then run the development server:

yarn dev

Using Docker

make dev-start

Check the Makefile for more commands