Skip to content

guilhermebernava/api-aws

Repository files navigation

API-AWS Project

Development and deployment of a .NET 6 project with a focus on Amazon EC2 and RDS PostgreSQL.


🚀 Overview

This .NET 6 project is an application that demonstrates the construction of a REST API using JWT for authentication and authorization. The project utilizes Entity Framework to manage access to a PostgreSQL database hosted on Amazon RDS. The repository pattern is applied for data management.


🛠️ Technologies Used

  • .NET 6
  • Entity Framework Core
  • Amazon EC2
  • Amazon RDS
  • xUnit
  • AutoMapper
  • FluentValidation
  • Jwt

🏗️ Development Environment Setup

Before starting development and deployment of the project, you need to set up your development environment. Make sure you have:


📂 Project Structure

Each project has its folder, and its tests are together in these folders.

├── src/
│   ├── ApiAws.Api/Aws.Api                 # Application API
│   ├── ApiAws.Infra/Aws.Infra             # Data access layer
│   ├── ApiAws.Domain/Aws.Domain           # Domain layer
│   ├── ApiAws.Services/Aws.Services       # Services layer
│   └── ApiAws.Api.sln                     # Visual Studio solution
│
├── .gitignore                   # .gitignore file
├── README.md                    # This file
└── appsettings.json             # Application settings

Customize the project structure according to your application's needs.


📦 Configuration and Deployment

  1. Clone this repository inside your EC2 instance with .NET and dotnet ef installed:

    git clone https://github.com/guilhermebernava/api-aws.git
  2. Configure environment variables in the appsettings.json file with the database connection information.

  3. Run Entity Framework migrations to create the database schema:

    dotnet ef database update
  4. Ensure that the files within launchSettings.json are configured to access your EC2's URL.

    "Prod": {
      "commandName": "Project",
      "dotnetRunMessages": true,
      "launchBrowser": true,
      "launchUrl": "swagger",
      "applicationUrl": "https://+:443;http://+:80",
      "environmentVariables": {
        "ASPNETCORE_ENVIRONMENT": "Prod"
      }
    }
  5. Run the application on your EC2 instance:

    sudo dotnet run

About

An API for deploy in EC2 and RDS

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages