Giter Club home page Giter Club logo

challenge's Introduction

This repository shows how you can build API with NestJS, Prisma and Manage subscriptions with Stripe

Features of this application

This application is basically an API for manage subscriptions with Stripe. It provides a possibility to perform sign up, sign in, create subscription and cancel subscription.

Running the application

  1. Register Stripe then add secret key to .env file as STRIPE_KEY
  2. Execute command docker-compose up to run database and application.
  3. Call API http://localhost:8000/api/v1/stripes/sync with GET method to sync product of Stripe with system.

Note: If you use Visual Studio Code then install REST Client extension. You can check file src/requests.http to test all API.

API Routes:

BASE_URL: http://localhost:8000/api/v1

  • GET

    • /stripes/sync : Sync data (plan) Stripe with system
    • /plans : List all plans
    • /users : List all users
    • /subscriptions : List own subscription
  • POST

    • /users

      • Body
        • username: String (required): The username of user
        • password: String (required): The password of user
        • fullname: String (required): The fullname of user
        • email: String (required): The email of user
    • /users/login

      • Body
        • username: String (required): The username to login
        • password: String (required): The password to login
    • /subscriptions/create-session

      • Body
        • planId: String (required): The id of plan
  • DELETE

    • /subscriptions/:id : Cancel subscription by its id

challenge's People

Contributors

namthit98 avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.