-
Notifications
You must be signed in to change notification settings - Fork 0
Home
A full-stack template built with ASP.NET 10 and Next.js 16. It’s well-structured, includes essential features, and lets you build applications quickly. It also works seamlessly with AI, including built-in rules for generating various parts of the project.
- .NET 10.0
- PostgreSQL
- Node.js
To install the EasyForNet tool globally using the .NET CLI, run the following command:
dotnet tool install --global EasyForNetToolTo check the version of the EasyForNet tool, run the following command:
dotnet efn -vor
dotnet efn --versionTo create a new project using the EasyForNet tool, run the following command:
dotnet efn cp -n {name} -o {path}-
-n {name}: Specifies the name of the new project. -
-o {path}: (Optional) Specifies the output directory for the new project.
To build the backend project, navigate to the {name}/src/backend directory and run the following command:
dotnet tool restore
dotnet buildGo to {name}/src/backend/Source directory. By default, the EasyForNet sets up connection strings for PostgreSQL in the appsettings.json, appsettings.Development.json and appsettings.Testing.json files. To change the connection strings, follow these steps:
-
Open the
appsettings.Development.jsonfile. Update theDefaultConnectionandHangfireconnection strings with your PostgreSQL connection details:{ "ConnectionStrings": { "DefaultConnection": "Host=your_host;Database=your_db;Username=your_user;Password=your_password" }, "Hangfire": { "Storage": { "ConnectionString": "Host=your_host;Database=your_db;Username=your_user;Password=your_password" } } } -
Open the
appsettings.Testing.jsonfile. Update theDefaultConnectionstring with your PostgreSQL connection details:{ "ConnectionStrings": { "DefaultConnection": "Host=your_host;Database=your_db;Username=your_user;Password=your_password" } }
Go to {name}/src/backend/Source directory and run the following command:
dotnet ef migrations add InitialTo run the project, navigate to the {name}/src/backend/Source directory and execute the following command:
dotnet runOnce the project is running, open your browser and go to http://localhost:5000/swagger/index.html to view the Swagger documentation for the endpoints.
To install the frontend dependencies, navigate to the {name}/src/frontend/web directory and execute the following command:
npm installTo run the project, navigate to the {name}/src/frontend/web directory and execute the following command:
npm run devDefault credentials:
- Username: admin
- Password: Admin#123
To run the tests, navigate to the {name}/src/backend/Tests directory and execute the following command:
dotnet testThe project based on fast-endpoints framework that follows the REPR (Request-Endpoint-Response) design pattern with a vertical slice architecture approach. This architecture provides:
- Clear separation of concerns
- Maintainable and scalable codebase
- Easy-to-understand endpoint organization
- Type-safe request/response handling
public class MyRequest
{
public string FirstName { get; set; }
public string LastName { get; set; }
}
public class MyResponse
{
public string FullName { get; set; }
public string Message { get; set; }
}
public class MyEndpoint : Endpoint<MyRequest, MyResponse>
{
public override void Configure()
{
Post("/hello/world");
AllowAnonymous();
}
public override async Task HandleAsync(MyRequest r, CancellationToken c)
{
await SendAsync(new()
{
FullName = $"{r.FirstName} {r.LastName}",
Message = "Welcome to FastEndpoints..."
});
}
}- JWT Authentication & Refresh Tokens – Secure authentication with built-in refresh token handling.
- Permissions-Based Authorization – Fine-grained access control using flexible permissions, ensuring users can only perform authorized actions.
- Role & Permission Management – Define roles and assign permissions dynamically through frontend.
- User Management – Includes endpoints and pages for user CRUD operations, changing passwords, and handling forgotten/reset passwords.
- Localization – Support multiple languages.
- Self-Hosted Background Email Service – Send emails directly from your own server without relying on third-party services.
-
Automatic Token Cleanup Jobs
-
delete-expired-auth-tokens– A recurring job that runs once per day to remove expired authentication tokens. The schedule can be customized. -
delete-expired-tokens– A recurring job that runs once per day to remove expired tokens used for the "Forgot Password" functionality. The schedule can be customized.
-
For custom development, you can email me at easyfornet@outlook.com
If you find this project helpful and appreciate the effort put into creating a robust backend template and tool for creating fast endpoints, please consider giving it a star on GitHub. Your support helps make the project more visible to others who might benefit from it.
⭐ Star this repository to show your support! ⭐
Your stars motivate me to:
- Add more features and improvements
- Maintain documentation
- Provide better support
Thank you for your support! 👍
For detailed instructions and guides, please refer to the following documents:
- Authentication & Authorization - Detailed guide on authentication and authorization
- Send Email Guide - Instructions for sending emails using the background email service