Agri-Energy Connect is a prototype web application designed to empower farmers by bridging the gap between sustainable agricultural practices and green energy solutions. The platform supports two main user roles: Employees and Farmers, offering unique functionality tailored to each.
This system was developed using ASP.NET Core MVC, Entity Framework Core, and SQL Server (Azure-hosted), and is structured to be scalable, maintainable, and user-friendly for both technical and non-technical stakeholders.
Microsoft Docs. 2022. Hash passwords in ASP.NET Core. [online] Available at: https://learn.microsoft.com/en-us/aspnet/core/security/data-protection/consumer-apis/password-hashing?view=aspnetcore-9.0 [Accessed 12 May 2025]
- This was used to securely store user passwords in the system using industry-standard hashing techniques.
Microsoft. 2024. Use cookie authentication without ASP.NET Core Identity. [Online] Available at: https://learn.microsoft.com/en-us/aspnet/core/security/authentication/cookie?view=aspnetcore-9.0 [Accessed 12 May 2025]
- i am using cookies to manage and maintain a user's login session.
Microsoft. 2025. ClaimsPrincipal Class. [Online] Available at: https://learn.microsoft.com/en-us/dotnet/api/system.security.claims.claimsprincipal?view=net-9.0 [Accessed 12 May 2025]
- Im using this to represent the currently logged-in user.
Microsoft. 2025. ClaimsIdentity. 2025. [online] Available at: https://learn.microsoft.com/en-us/dotnet/api/system.security.claims.claimsidentity?view=net-9.0 [Accessed 12 May 2025]
- an object that holds all the facts (claims) about the user.
Microsoft. 2024. Role-based authorization in ASP.NET Core. [Online]. Available at: https://learn.microsoft.com/en-us/aspnet/core/security/authorization/roles?view=aspnetcore-9.0. [Accessed 12 May 2025]
- restricts access to certain parts of my application based on the role of the user.
Microsoft. 2024. HtmlHelper.AntiForgeryToken Method. [Online]. Available at:https://learn.microsoft.com/en-us/dotnet/api/system.web.mvc.htmlhelper.antiforgerytoken?view=aspnet-mvc-5.2 [Accessed 12 May 2025]
- built-in helper in ASP.NET MVC and Razor Pages that helps protect my forms from hackers
-
Frontend: ASP.NET Core MVC (Razor Pages, Bootstrap)
-
Backend: ASP.NET Core
-
Database: Azure SQL Database (via Entity Framework Core)
Make sure the following tools are installed:
- .NET 8 SDK
- SQL Server or Azure SQL
- Visual Studio 2022+ with ASP.NET and EF workloads
- Docker Desktop (optional but recommended)
-
Clone the Repository
git clone https://github.com/your-username/agri-energy-platform.git cd agri-energy-platform -
Configure the Database Connection
- Open appsettings.json
- Replace the connection string under "DefaultConnection" with your local or Azure SQL details:
"ConnectionStrings": { "DefaultConnection": "Server=your-server;Database=AgriEnergyDB;User Id=your-user;Password=your-password;" }
-
Apply Database Migrations
dotnet ef database update -
Run the Application
dotnet run