Skip to content

Pet project where we use TDD, DDD, Ports and adapters, CQS and more.

Notifications You must be signed in to change notification settings

Nakerdev/envios-canarios

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Canary Deliveries

  • BackEnd - Antonio Sánchez
  • FrontEnd - Iru Hernández

Canary deliveries is a project that born from a Business idea. The idea was create a web platform where Canary Islands people can buy products from providers that don't deliveries to Canary Islands. From the web application you can create a purchase request, specifies the product link, units, etc. That request is managed from Backoffice application, the operator can accept the request or reject it. The project is unfinished and only has the reject case of use.

Most important thecnical specifications

BackEnd

  • .NET Core
  • Docker
  • EF Core
  • DDD
  • TDD
  • Command and Query Segregation (Not CQRS)
  • Ports and Adapters architecture
  • Automatic Documentation using OpenApi specification
  • Functional programming concepts like Monads pattern (using LanguageExt lib)
  • JWT Auth

Requirements

  • Docker >=19.03
  • CANARY_DELIVERIES_HOME environment var decalared with the project root path

Table of content

  1. Web App
    1. BackEnd
    2. FrontEnd
  2. Backoffice
    1. BackEnd
  3. Database
    1. Migrations
  4. Technology

Web App

BackEnd

To run the WebAppApi for devel propouse you should go to /scripts/devel directory and execute the run-apis.sh script. CANARY_DELIVERIES_HOME enviroment var is needed to execute the script, see the Requirements sections for more info.

run-apis.sh applies the required database migrations automatically.

If the script execution finished successfuly, the Api is running in http:https://192.168.2.2

To stop the Api press CTRL+C

Api Documentation

The Api documentation is created following the OpenApi specification (OAS3), you can view it using the following route: http:https://192.168.2.2/_doc.

The Api documentations is only available in a development enviroment.

Health Checks (/health)

Health checks runs the following infraestructure connections:

  • Postgres

Logs

Api logs are storage in the following directory ~/envios-canarios/web-app-api-logs. The logs output can be redirected to /tmp folder but i decided to save it and delete it manually.

FrontEnd

Go to /src/WebApp/frontend directory

  • Launch a development server on localhost:3000 with hot-reloading: npm run dev

If the command finished successfuly the WebApp is running in http:https://127.0.0.1:3000

  • Serve your production application from dist/ directory:
    1. npm run build
    2. npm run start

If the command finished successfuly the WebApp is running in http:https://127.0.0.1:3000

  • To generate the static website you can run the following command: npm run generate

Backoffice

BackEnd

To run the BackofficeApi for devel propouse you should go to /scripts/devel directory and execute the run-apis.sh script. CANARY_DELIVERIES_HOME enviroment var is needed to execute the script, see the Requirements sections for more info.

run-apis.sh applies the required database migrations automatically.

If the script execution finished successfuly, the Api is running in http:https://192.168.2.5

To stop the Api press CTRL+C

Api Documentation

The Api documentation is created following the OpenApi specification (OAS3), you can view it using the following route: http:https://192.168.2.5/_doc.

The Api documentations is only available in a development enviroment.

Logs

Api logs are storage in the following directory ~/envios-canarios/backoffice-api-logs. The logs output can be redirected to /tmp folder but i decided to save it and delete it manually.

Database

The database container creates a directory that it uses as a volume to avoid losing the local data. This directory is located in ~/envios-canarios/db-data. If you remove this directory you will lose all your local database data.

Migrations

To create migrations you need to create an enviroment variable with the connection string.

Purchase applications context database: PurchaseApplicationDbConnectionString="Host=192.168.2.3;Database=CanaryDeliveries;Username=postgres;Password=Password01!;"

Technology

  • .NET Core 3.0
  • Postgres 13.1
  • Nuxt.js
  • TypeScript

About

Pet project where we use TDD, DDD, Ports and adapters, CQS and more.

Topics

Resources

Stars

Watchers

Forks

Languages