This repository contains a Store API project built using .NET Web API Core 7.0. The API includes JWT-based authentication and utilizes the repository pattern and Entity Framework Core's code-first approach. AutoMapper and DTOs are used for presentation requests.
🏠 Homepage
This documentation provides the API endpoints using Postman.
Before running the API project, ensure you have the following software installed:
- .NET 7.0 SDK
- Visual Studio or Visual Studio Code (optional)
- SQL Server
To get started with the project, follow these steps:
- Clone the repository to your local machine.
- Open the project in your preferred development environment (such as Visual Studio or Visual Studio Code).
- Build the project to restore NuGet packages and compile the source code.
The API project requires some configuration settings to run properly. Open the appsettings.json file and update the following settings:
{
"ConnectionStrings": {
"DefaultConnection": "YourConnectionString"
},
"JwtSettings": {
"SecretKey": "YourSecretKey",
"Issuer": "YourIssuer",
"Audience": "YourAudience"
}
}DefaultConnection: Replace this with your own database connection string.SecretKey: Replace this with a secure secret key for JWT token generation.Issuer: Replace this with the issuer name for JWT tokens.Audience: Replace this with the audience for JWT tokens.
After edit appSettings to target database , database created automatically such project run The project follows the repository pattern to separate data access logic from the API controllers. The Repositories folder contains repository classes for each entity, responsible for querying and modifying the data.
AutoMapper and DTOs (Data Transfer Objects) are used for mapping between the entities and the API presentation layer. The AutoMapperProfiles.cs file contains the mapping configurations for different entities and DTOs.
👤 Youssef Mohamed Ali
- Website: https://joegithubpro.github.io/Profile/
- Twitter: Y_mohamed_Ali
- Github: @JoeGitHubPro
- LinkedIn: youssef-mohamed-ali
Contributions, issues and feature requests are welcome!
If you would like to contribute to this project, please follow these steps:
- Fork the repository.
- Create a new branch for your feature or bug fix.
- Make your changes and commit them.
- Push your changes to your forked repository.
- Submit a pull request to the main repository.
Give a ⭐️ if this project helped you!
Copyright © 2023 Youssef Mohamed Ali.
This project is MIT licensed.