https://github.com/mochrks/crud-api-netcore
This repository contains a sample project for building a CRUD (Create, Read, Update, Delete) API using .NET Core. It demonstrates how to set up a RESTful API with essential CRUD operations, designed for developers looking to learn or implement a robust and scalable API using .NET Core technologies.
https://github.com/mochrks/crud-api-netcore
netcore postgresql
Last synced: 8 months ago
JSON representation
This repository contains a sample project for building a CRUD (Create, Read, Update, Delete) API using .NET Core. It demonstrates how to set up a RESTful API with essential CRUD operations, designed for developers looking to learn or implement a robust and scalable API using .NET Core technologies.
- Host: GitHub
- URL: https://github.com/mochrks/crud-api-netcore
- Owner: Mochrks
- Created: 2024-05-24T02:16:43.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-12-02T02:27:57.000Z (over 1 year ago)
- Last Synced: 2025-01-12T08:36:01.661Z (over 1 year ago)
- Topics: netcore, postgresql
- Language: C#
- Homepage:
- Size: 17.6 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
.NET Core CRUD API - Order, Product, User
## Overview
This is a **CRUD API** built with **.NET Core** to manage **Orders**, **Products**, and **Users**. The API supports creating, reading, updating, and deleting data for each of these entities. The project is designed to follow clean architecture principles, is fully documented with **Swagger**, and uses **Entity Framework Core** as the ORM for database operations.
## Features
- CRUD Operations for **Orders**, **Products**, and **Users**
- RESTful API design
- **Swagger UI** for interactive API documentation
- **Entity Framework Core** with migrations
- Input validation and error handling
- **Dependency Injection** for better code maintainability
- **JWT Authentication** for secure API access
## Tech Stack
- **.NET Core 8.0**
- **Entity Framework Core** (Code-First Approach)
- **PostgreSQL r** as the database
- **Swagger** for API documentation
- **JWT** for authentication
## Project Structure
```bash
dotnet-crud-api/
│
├── Controllers/ # API Controllers for Order, Product, and User
├── Data/ # EF Core DbContext and Migrations
├── Models/ # Order, Product, User Models
├── Services/ # Business logic and service layer
├── DTOs/ # Data Transfer Objects for request/response
├── Repositories/ # Repository pattern for data access
└── Program.cs # Application startup
```
## Setup & Installation
--------------------
- **Clone the repository**
```bash
git clone https://github.com/mochrks/crud-api-netcore.git
cd crud-api-netcore/WebApi
```
- **Install dependencies**
```bash
dotnet restore
```
- **Set up the database**
- Update your connection string in `appsettings.json`.
- Run database migrations:
```bash
dotnet ef database update
```
- **Run the application**
```bash
dotnet run
```
- **Access Swagger UI**
Navigate to [http://localhost:5000/swagger](http://localhost:5000/swagger) to interact with the API documentation.
## Connect with me:
[](https://github.com/mochrks)
[](https://youtube.com/@Gdvisuel)
[](https://instagram.com/mochrks)
[](https://linkedin.com/in/mochrks)
[](https://behance.net/mochrks)
[](https://dribbble.com/mochrks)