Keyshade Alpha is launching April 30th 5:00 PM IST
Join our Launch Party
keyshade docs
GithubDiscordReddit
  • 👋What is keyshade?
  • Getting Started
    • Introduction
    • Adding your first secret and variable
    • Installing the CLI
    • Setting up your profile
    • Add keyshade to your project
    • Running your app
  • CLI
    • Introduction
    • Profile
    • Init
    • Workspace
    • Project
    • Environment
    • Run
    • Scan
  • 🥰CONTRIBUTING TO KEYSHADE
    • Summary
    • Design of our code
      • Organization of code
      • API
      • CLI
      • Web
      • Integrations
    • Prerequisites
    • Environment Variables
    • Setting things up
    • Running things locally
      • Running the API
      • Running the Web
      • Running the Platform
      • Running the CLI
      • API Testing
      • Docker Support
  • Internals
    • Architecture of keyshade
    • How the CLI works
Powered by GitBook
On this page
  • Stack
  • Structure
  • The common module
  • The prisma module

Was this helpful?

Edit on GitHub
  1. CONTRIBUTING TO KEYSHADE
  2. Design of our code

API

Design of our API

This document covers how we have developed our API, the stacks, and things you should know before you get started with it!

Stack

Our API is developed using the following stack:

  • NestJS as the base

  • Prisma as the DDL and DML

  • Node Mailer as the mail agent

Structure

As per the NestJS convention, our API base is totally modularized, with each module catering to a particular part of our project. The general module structure is as follows:

  • controller: Stores the APIs that the clients will be interacting with.

  • service: Holds the business logic

  • misc: Holds utility functions and classes localized to the particular module

  • dto: Contains class objects for data intake from the clients

  • types: Optionally, some modules have a `<module_name>.types.ts` file that holds the custom types it uses in the module.

The common module

Just so that we can employ code reusability without much OOP hassle, we have clustered all of our usable components of the backend under the common module.

The prisma module

This module deserves special attention since it deals with the data layer. Apart from the usual files, we have two other:

  • schema.prisma: This contains the data definition

  • migrations: This folder stores the migrations generated by running the pnpm run db:generate-migrations command. These migrations are the state that the current prisma database is in.

PreviousOrganization of codeNextCLI

Last updated 1 year ago

Was this helpful?

🥰