Modular waste management solution based on the pay-as-you-throw concept

  • dedicated mobile app for waste collectors
  • management web cloud app with several modules (CRM, Operations, Financial, etc.)
  • dedicated mobile app for the final client

Technologies

C#, Asp.Net 5, EntityFramework Core, PostgreSQL, Docker & Docker compose, Consul, RabbitMq, MediatR, Steeltoe, Polly, Hangfire, IronPdf, SendGrid, MailKit, MassTransit, Ocelot, OpenAPI, JWT, Linux, Angular, Typescript, Nginx, WSL2

“pay-as-you-throw” modular solution

Developing from scratch a modular solution enriched with features that address waste management specific needs (mobility + pay-as-you-throw system + multi-user apps + real-time data synchronization)

THE CONTEXT

Our approach

In the past years, the market has changed significantly. And so were worldwide clients' behavior and expectations. The fast switch to remote management, collaborative tools and custom services impacted almost all industries at several levels.

That's why we decided to allocate teams and resources to develop ready-to-use disruption-free apps & solutions that respond to the new market's dynamic and clients' changing needs and expectations.

Examples of ready-to-use solutions & apps we developed (by industry):

THE SOLUTION

  • as a complementary module for SmartCity solution - to provide communities and municipality with extended features & functionalities;
  • as a freestanding complete solution for sanitation that addresses both clients (household clients and municipal organization) and waste management companies specific needs.

Roles we cover

Project Manager

Developers

Solution architect

For providing a complete experience, the waste management solution integrates 3 main apps:

Mobile app for the waste collectors

Management web cloud app

iOS & Android app designed for clients

Interested in adapting this solution to your company / community?

Mobile app for the waste collectors

The mobile app is implemented on an Android PDA and allows users (waste collectors) to:

  • scan the QR from the bin (the QR code representing the contract number);
  • identify the associated client account quickly;
  • register the waste volume and type (household, recyclable or compostable);
  • generate the charge ticket (are uploaded photos with the bin before the waste is taken over);
  • refuse to collect waste (specifying the reason).

All the new data is sent online to the main management app. If the connection between the app and the server is not possible at some point, the data is saved by the device, and the synchronization is resumed once the internet connection is restored.

Management web cloud app

CRM

In the CRM module are registered all customer data (individuals, legal entities or tenants' associations), defined contracts per customer, added several dependents related to the same customer, seen the operations and balance of each customer, issued invoices.

Operations

This module allows users to track all the operations performed by the sanitation company (waste lifting, volume and refusals). It can be, also, added to waste collection transactions or refuses' reasons manually.

Financial

Based on the contractual conditions, the invoices can be issued automatically or manually, and the clients' balances and payments can be managed. This module contains the billing logic according to the algorithm requested by the client - the sanitation company (for third parties - town hall).

Product nomenclatures

This is a specific module developed for listing and filtering products. This module defines the different types of waste that can be collected, u.m. and volume/mass conversion rates, dry waste, wet waste, unit prices for products, taxes and excise duties.

Super Admin

This is a dedicated module allowing the entire system to be managed from one dashboard. This module allows the definition of users and access rights in the application, the definition of special rules and calculation algorithms.

iOS & Android app designed for clients

A mobile app designed to keep clients (household clients and municipal organizations) informed and provide them with simplified access to their account:

  • real-time updates on their account status;
  • more transparency in the communication and the problem-solving process;
  • fast access to invoices;
  • reduced time and bureaucracy.

Microservices Architecture

Based on MSA (Microservices Architecture), SmartSanitation contains several microservices: Presentation | CRMService | TmService | FinancialService | PdfService | EmailService | Authentication | ApiGateway | ApiOrchestrator | Common projects (ApiKernel, DataAccessKernel, ErpCommons)

SOLID principles-based microservices

Each microservice is written using SOLID principles to be reactive to events using RabbitMq, store its own data in separate databases, communicate with other microservices over HTTP using Consul to get IP and port using DNS, be resilient to failure using Polly, segregate business logic implementing Command pattern using MediatR, and expose itself at runtime to Consul.

Presentation

CRMService

TmService

FinancialService

PdfService

EmailService

Authentication

ApiGateway

ApiOrchestrator

Presentation

Presentation is a SPA (Single Page Application) using Angular and Typescript to easily implement domain models and business logic that match with the models and business logic from microservices.

*Being a microservice, Presentation is written as well using SOLID principles to:

  • be reactive to events using RabbitMq;
  • store its own data in separate databases;
  • communicate with other microservices over HTTP using Consul to get IP and port using DNS;
  • be resilient to failure using Polly;
  • segregate business logic implementing Command pattern using MediatR;
  • expose itself at runtime to Consul.

CRMService

CRMService has the role to manage users, configure the main company, and store its data in PostgreSQL.

CRMService contains the following technologies:

  • C#, Asp.Net 5;
  • PostgreSQL;
  • EntityFramework Core as ORM;
  • OpenAPI;
  • Steeltoe as client for Consul;
  • MediatR to segregate the business logic.

TmService

TmService contains contracts, products, services with management options and stores the flow activities. TmService receives events through RabbitMq to mark products when emitting automated invoices and stores its data in PostgreSQL.

TmService contains the following technologies:

  • C#, Asp.Net 5;
  • PostgreSQL;
  • MassTransit for RabbitMq client and implementing pub/sub pattern;
  • EntityFramework Core as ORM;
  • OpenAPI;
  • Steeltoe as client for Consul;
  • MediatR to segregate the business logic.

FinancialService

FinancialService is a microservice that tracks all invoices and transactions and allows the creation of an invoice manually or automated. FinancialService communicates with PdfService, CrmService, TmService, and ApiOrchestrator directly through HTTP and sends events to TmService through RabbitMq. It also stores its data in PostgreSQL.

FinancialService contains the following technologies:

  • C#, Asp.Net 5;
  • PostgreSQL;
  • MassTransit for RabbitMq client and implementing pub/sub pattern;
  • EntityFramework Core as ORM;
  • OpenAPI;
  • Polly for circuit breaker;
  • Hangfire for scheduled jobs;
  • Refit to make it easier to communicate with other services over HTTP;
  • Steeltoe as client for Consul;
  • MediatR to segregate the business logic.

PdfService

PdfService is an agnostic service that communicates with an FTP server with the possibility to store, read and generate PDFs.

PdfService contains the following technologies:

  • C#, Asp.Net 5;
  • IronPdf library to generate Pdfs from .cshtml templates;
  • OpenAPI;
  • Steeltoe as client for Consul;
  • MediatR to segregate the business logic.

EmailService

EmailService is an agnostic microservice that sends emails to specific email accounts using Sendgrid client.

EmailService contains the following technologies:

  • C#, Asp.Net 5;
  • OpenAPI;
  • MassTransit for RabbitMq client and implementing pub/sub pattern;
  • SendGrid client;
  • MediatR to segregate the business logic.

Authentication

Authentication service is the service that creates accounts, generates tokens, and keeps the logic for authentication. It also stores its data in PostgreSQL.

Contains the following technologies:

  • C#, Asp.Net 5;
  • PostgreSQL;
  • OpenAPI;
  • MediatR to segregate the business logic;
  • MailKit to implement custom smtp logic;
  • Steeltoe as client for Consul;
  • JWT for authorization.

ApiGateway

ApiGateway is a gateway service with the role of exposing microservices endpoints and authorization logic. It is the only service that communicates directly with client apps.

ApiGateway contains the following technologies:

  • C#, Asp.Net 5;
  • Ocelot library to implement API Gateway using microservices DNS stored in Consul;
  • JWT for authorization.

ApiOrchestrator

ApiOrchestrator implements custom business logic by aggregating data for mobile and invoices.

ApiOrchestrator contains the following technologies:

  • C#, Asp.Net 5;
  • MediatR to segregate the business logic;
  • OpenAPI;
  • Polly for circuit breaker.

Common projects are used to implement DRY (Do not Repeat Yourself) principle, adding more stability to the solution by having a common place to store DTOs (Data Transfer Objects) and generic abstraction of the logic.

Detached from these microservices, the solution uses separate processes in the same context, with the responsibility to automate some flows using BackgroundServices and Hangfire. The entire solution is containerized using Docker, keeping each service image on Docker Hub and deploying everything to the host machine using docker compose.

Some of our works

SmartCity App

Web solution taxi fleet management