Coder Social home page Coder Social logo

avirgili-eclub / basicapinet Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 76 KB

Basic example of Api .net using sort of HMA arquitecture. (TODO: hexagonal arquitecture with DDD design)

C# 100.00%
example-project practice-project asp-net-core dotnet8 net8-web-api repository-pattern

basicapinet's Introduction

BasicApiNet

Codacy Badge

This is a basic example of a web API built on .NET Core 8. The main goal of this API is to demonstrate basic CRUD (Create, Read, Update, Delete) operations using two main entities: Country and City.

Key Features

  • Utilizes .NET Core 8 for API development.
  • Implements dependency injection architecture for better modularity and maintainability of the code.
  • Uses a local SQLite database to persistently store data.
  • Employs Entity Framework Core as the ORM (Object-Relational Mapping) for interacting with the database.
  • A middleware has been added to handle exceptions globally, improving error management in the application.
  • Unit tests are used for repository testing.

Prerequisites

  • .NET Core 8 must be installed on your system.
  • A C# compatible development environment is required for editing and compiling the project.

Installation and Configuration

  1. Clone this repository to your local machine:
git clone https://github.com/your-username/BasicApiNet.git
  1. Navigate to the project directory:
cd BasicApiNet
  1. Open the project in your preferred development environment.
  2. Build the project using the command:
dotnet build
  1. Run the migrations to set up the SQLite database:
dotnet ef migrations add InitialCreate -p BasicApiNet.Access -s BasicApiNet.Host -o Data/Migrations
  1. Apply the migrations to create the database:
dotnet ef database update
  1. Start the application by running the command:
dotnet run

Usage

  • Once the application is running, you first have to login (admin:admin123) to generate the jwt token, copy the token to access protected endpoints.
  • Once you have the token set you can make HTTP requests via the API to perform CRUD operations on the Country and City entities.
  • Make sure to review the API documentation to learn about the available endpoints and their respective operations.

basicapinet's People

Contributors

avirgili-eclub avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.