tipogi / bushido-backend

πŸ›‘ bushido.guide server development

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Motivation

The web server for bushido.guide. It has two main tasks: Get the repository domains and P2P market offers.

Overview

bushido.backend is implemented using Hexagonal Architecture pattern and it has mainly three layers:

  • Infrastructure: To access into the system, users or external services, it uses ports and adapters. Ports determines the interface for external actors to communicate with the application and adapters will initiate the interaction with the Application
  • Application: It takes all the events related with the infrastructure layer and it passes through the domain layer. In that case, it uses CQRS pattern to achieve the communication with the domain layer and there are two types of models: commands, usually uses to mutate domain data and query to render information to the requested party, there is not domain mutation in that model
  • Domain: The layer that holds all the business logic and the rules

Hexagonal

Domain

It has different aggregates to represent application entities:

  • Cards: This aggregate can be topic and domain type and each one has its own duties. Topic, is the the group that wraps the related domains and domain is the web page url
  • Market: The responsible to fetch the exchanges offers

domain

Launch the server

Before launch the server, we have to import bushido.library domains. Once we populate the database with domains and topics, we can launch the server:

npm run start:dev

GraphQL queries

If we want to enter in the apollo client from the browser, we have to deactivate CORS in the bootstrap procedure.

  • GraphQL web server: localhost:4000/graphql

Container

  • We might need to create a network inside docker: docker network create bushido-network

About

πŸ›‘ bushido.guide server development


Languages

Language:TypeScript 98.9%Language:JavaScript 1.1%