VClients is a project that aims to manage customer information. It provides a backend API for creating, updating, delete and retrieving customer data (CRUD).
The frontend code can be found in the following repository.
- π Requirements
- βοΈ Project Setup
- π Run with Docker
- π» Run with local machine
- π Folder structure
- Docker
- Docker Compose
- Rider or Visual Studio 2022 (optionals)
- .NET 8.0 SDK
- PostgreSQL
- Rider or Visual Studio 2022 (optionals)
- Clone the repository:
$ git clone https://github.com/maycon-mdrs/VClients.git
- Before running the project, ensure to create an .env file following the structure outlined in .env.example. This file should contain all necessary environment variables for Docker to function properly.
Variable | Description |
---|---|
ASPNETCORE__DB__NAME | The name of your database. |
ASPNETCORE__DB__USER | The username of your database. |
ASPNETCORE__DB__PASSWORD | The password of your database. |
Make sure the variables in ./VClients.Api/appsettings.json
match the values in the .env
file.
- Database=ASPNETCORE__DB__NAME
- Username=ASPNETCORE__DB__USER
- Password=ASPNETCORE__DB__PASSWORD
ASPNETCORE__DB__NAME=vclients
ASPNETCORE__DB__USER=postgres
ASPNETCORE__DB__PASSWORD=12345
{
"ConnectionStrings": {
"DefaultConnection": "Host=vclients.database;Port=5432;Database=vclients;Username=postgres;Password=12345"
}
}
Warning
If the commands via prompts don't work to use docker compose
, download one of these IDEs and run:
$ docker-compose -f docker-compose.yml -f docker-compose.override.yml up -d
# http://localhost:5000/
# http://localhost:5000/swagger/
-
When importing the project, select the option docker-compose.yml: Compose Deployment.
-
After that, just click the greeen play button to run the project.
-
When importing the project, select the option docker-compose.
-
After that, just click the greeen play button to run the project.
Warning
Remember to configure the DefaultConnection
in ./VClients.Api/appsettings.json
correctly according to your PostgreSQL database settings.
Access the VClients.Api package:
$ cd ./VClients.Api/
To run the project, use the following command:
$ dotnet run
# http://localhost:5138/
# http://localhost:5138/swagger/
/VClients.Api/*
- contains the backend code (API)./Context
- contains the database context./Migrations
- contains the database migrations./Controllers
- contains classes or modules that handle the control layer of the application./Services
- contains classes and interfaces that define the application's business logic./DTOs
- contains the DTOs for the application and classes responsible for mapping data between different formats or structures./Repositories
- contains classes and interfaces that define access to database data./Models
- contains the classes that represent your application's data structure./Extensions
- contains classes that extend the functionality of other classes.