This is a framework project from my 2 year of experience in web api's
This project uses the DotnetNLayer framework and includes several features and functionalities for managing user roles, permissions, and background tasks.
This project follows a layered architecture with the following key layers:
The API Layer handles HTTP requests and responses. It acts as the entry point for communication with the application. This layer exposes endpoints that the client can interact with, such as authentication, CRUD operations for users and roles, etc.
The Service Layer contains the business logic and service methods for the application. It is responsible for processing data and performing business rules. It is invoked by the API layer to handle more complex operations.
The Repository Layer is responsible for abstracting data access and managing interactions with the database. It handles the CRUD operations and communicates with the underlying data storage (e.g., SQL Server). It is invoked by the Service Layer to retrieve and persist data.
The Background Job Layer uses Hangfire to manage and execute background tasks. These tasks are typically long-running processes that don't need to be executed immediately, such as database backups, scheduled email reminders, and other periodic operations.
- Token-Based Authorization: Secure access through token-based authentication.
- Token Distributor: Manages the distribution and validation of tokens.
- CRUD Operations: Supports Create, Read, Update, and Delete operations for Users and Roles.
- Admin Role Management: Allows admins to manage users, roles, and role assignments.
- Database Backup: Performs a database backup every 8 hours.
- SMTP Server for User Email Confirmation: Implement an SMTP server to handle user email confirmations.
- User Email Reminder: Create a job that sends periodic emails to users. If the user does not confirm their email within a specified time, the user will be deleted.
-
Clone the repository:
git clone https://github.com/mahmutozerg/DotNetNlayer.git
-
Install dependencies:
cd yourprojectname dotnet restore
-
Configure the database: Update the
appsettings.json
file with your database connection string. Update The files under 'DotNetNlayer.Core/Constants' to your use case Update The files under 'SharedLibrary/Constants'⚠️ Important: The Aud variable should match with "TokenOptions":"Audience" in 'appsettings.json' -
Run the project:
dotnet run
If you'd like to contribute to this project, feel free to fork the repository, create a branch, and submit a pull request with your changes.
This project is licensed under the MIT License - see the LICENSE file for details.