Skip to content

JoeGitHubPro/Store

Repository files navigation

Welcome to Store 👋

Version Documentation Maintenance License:MIT

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.

Documentation

This documentation provides the API endpoints using Postman.

Prerequisites

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

Getting Started

To get started with the project, follow these steps:

  1. Clone the repository to your local machine.
  2. Open the project in your preferred development environment (such as Visual Studio or Visual Studio Code).
  3. Build the project to restore NuGet packages and compile the source code.

Configuration

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.

Deploy DataBase

After edit appSettings to target database , database created automatically such project run 

Repository Pattern

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

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.

Author

👤 Youssef Mohamed Ali

🤝 Contributing

Contributions, issues and feature requests are welcome!

If you would like to contribute to this project, please follow these steps:

  1. Fork the repository.
  2. Create a new branch for your feature or bug fix.
  3. Make your changes and commit them.
  4. Push your changes to your forked repository.
  5. Submit a pull request to the main repository.

Show your support

Give a ⭐️ if this project helped you!

📝 License

Copyright © 2023 Youssef Mohamed Ali.
This project is MIT licensed.

About

Web API .NET Core 7.0

Resources

Stars

Watchers

Forks

Languages