This project is a comprehensive template for building a full-featured Web API using DotNet 6. It includes JWT authentication, RESTful API architectural design, Entity Framework, Identity User (IdentityDbContext) with SQL Server DB, global error handling, and the repository pattern design.
- JWT Authentication: Secure your API with JSON Web Token (JWT) authentication.
- RESTful API Design: Follow best practices for designing RESTful APIs.
- Entity Framework: Use Entity Framework for database interactions.
- Identity User (IdentityDbContext): Manage user authentication and authorization with IdentityDbContext and SQL Server DB.
- Global Error Handling: Implement global error handling to manage exceptions consistently.
- Repository Pattern Design: Use the repository pattern for cleaner and more maintainable code.
- .NET 6 SDK
- SQL Server
-
Clone the repository:
git clone https://github.com/Hu8MA/full_Web_Api_template.git
-
Navigate to the project directory:
cd full_Web_Api_template
-
Restore the project dependencies:
dotnet restore
-
Update the connection string in
appsettings.json
to point to your SQL Server instance. -
Apply the database migrations:
dotnet ef database update
-
Run the project:
dotnet run
This template provides a foundation for building robust and secure Web APIs. You can extend it by adding your own controllers, services, and repositories.
Contributions are welcome! Please fork the repository, create a new branch, and submit a pull request.
- Fork the repository.
- Create a new branch:
git checkout -b feature-name
- Make your changes and commit them:
git commit -m 'Add some feature'
- Push to the branch:
git push origin feature-name
- Open a pull request.
Please ensure your code adheres to the project's coding standards and includes appropriate tests.
This project is licensed under the MIT License
Developed by Hu8MA(Hussein Mahdi) . Special thanks to all contributors and the open-source community for their support and collaboration.