Skip to content

WilferCiro/sales_dashboard_backend

Repository files navigation

NestJS Project with Hexagonal Architecture and SQL

This repository contains a NestJS project that follows the Hexagonal Architecture pattern and uses SQL as the underlying database.

Project Structure

The project is structured into the following folders:

  1. application: This folder contains the application layer of the Hexagonal Architecture. It defines the use cases and orchestrates the flow of data between the domain and infrastructure layers. Each use case is implemented as a separate module within this folder.

  2. domain: The domain folder holds the core business logic and domain models of the application. It is independent of any external dependencies and represents the heart of the Hexagonal Architecture.

  3. architecture: This folder contains the infrastructure implementation details. It includes frameworks, libraries, and databases. In this project, we use SQL as the underlying database, and the code for interacting with the database is placed within this folder.

Prerequisites

Make sure you have the following prerequisites installed:

  • Node.js (version v18.16.0 or higher)
  • NPM (version 9.5.1)
  • SQL database (e.g., PostgreSQL, MySQL, SQLite)

Getting Started

To get started with the project, follow these steps:

  1. Clone the repository:
  git clone https://github.com/WilferCiro/sales_dashboard_backend.git
  cd sales_dashboard_backend
  1. Install the dependencies:
  npm install
  1. Configure the SQL database connection creating a .env file and add the sql database credentials, and other required environment variables
POSTGRES_HOST=HOST
POSTGRES_PORT=6543
POSTGRES_USER=USER
POSTGRES_PASSWORD=PASS
POSTGRES_DATABASE=postgres
MODE=DEV
RUN_MIGRATIONS=true

SECRET_JWT=SECRET_FOR_JWT

SENDGRID_API_KEY=
SENDGRID_USER=
SENDGRID_EMAIL=

PORT=5000
  1. Start the application:
  npm run start

Database Schema migration

  npm run build
  npm run typeorm:generate-migrations
  npm run typeorm:run-migrations

Acknowledgments

  • NestJS - A progressive Node.js framework for building efficient and scalable web applications.
  • Hexagonal Architecture - A software architecture pattern that emphasizes loose coupling and separation of concerns.
  • SQL - A programming language used for managing relational databases.

Contact

For any questions or inquiries, please contact wilcirom@gmail.com.

All repositories for this project:

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages