Git Product home page Git Product logo

dyte-task's Introduction

Dyte Backend Task

Dyte's take home task for backend development.

Moleculer

Run in Postman

Info

  • Uses Express as backend.
  • Runs Moleculer API Gateway in middleware mode on express. [Link]
  • Uses Prisma as the Database ORM with Postgres as the database.
  • Has two Moleculer services: API Gateway and Webhooks.
  • Batch size for concurrent requests [trigger route] can be configured by env variables
  • In addition to JWTs, admins have to send admin-id as a header, which is cross-checked with the enviroment variable (can be a set of rotating uuids which is shared internally)
  • Written in TypeScript. (obv)
  • Postman Collection(JSON) here

Instructions To Run

  • Install dependencies
npm install
  • Run Postgres (remember to set env vars!)
  • Perform DB migrations with prisma
npx prisma migrate dev
npx prisma generate
  • Start the server (also transpiles TS to dist/)
npm start

NPM scripts

  • npm run build: Transpiles TS to JS
  • npm run start: starts the moleculer and express servers
  • npm run cli: Start a CLI and connect to production. Don't forget to set production namespace with --ns argument in script
  • npm run dc:up: Start the stack with Docker Compose
  • npm run dc:down: Stop the stack with Docker Compose

TODOs:

  • test retry logic properly (I'm sure interceptor method is wrong)
  • dockerize
Made with ❤️ by Siddhartha Varma

dyte-task's People

Contributors

bro3886 avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

dyte-task's Issues

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.