Coder Social home page Coder Social logo

portal-backend-koa's Introduction

Backend for the Agamim Portal project

This repo contains the backend code for the new Agamim Portal app.

Stack

This backend is written in Typescript, with the Koa framework, and ws for WebSocket functionality. MongoDB is used as the primary database. For schema validation and parsing, Zod is used. Dependencies are managed by Yarn.

Hierarchy

Top-level directories:

  • build (ignored by git) contains built code.
  • scripts contains "side scripts" related to the portal. At the time of writing a single script exists, migrateToNewSchema, which handlers migrating the MongoDB collections of the old backend to collections supporting the new schemas.
  • src contains the source code.

Directories under src:

  • auth: contains code related to authentication against Azure AD.
  • common: contains code that's generic in nature or relevant to multiple places in the code, mostly used as a utils directory.
  • controller: contains the endpoint implementation themselves; each controller is assigned a route, and the loadControllers function in controller/index.ts injects them.
  • middleware: contains general middleware not specific to a single endpoint (logger, validate, etc.)
  • model: contains Zod model definitions as well as types. These should be moved to a common package (as a private package preferably, otherwise as part of a monorepo) when a new frontend is created for the portal.
  • peripheral: contains logic for interacting with different components that are not the server's code (env, db connection, Azure blob storage, etc).
  • service: contains service logic. the generic Service, a MongoService for MongoDB services as well as specific services for the different models. in this context, services are the layer that implements the business logic; controllers wrap them with authentication & authorization, validation, receiving and sending data.
  • websocket: contains websocket-related logic. As the project scales, this part should be decoupled into a separate microservice.

portal-backend-koa's People

Contributors

nitzanhen avatar dependabot[bot] avatar

Watchers

 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.