Change to the master branch to access the files.
- About the Project
- Features
- Technologies Used
- Getting Started
- Usage
- Project Structure
- Contributing
- License
- Contact
This project, "Gas-Consumption-portal," aims to provide a system for managing and tracking gas consumption.
Example elaborations:
- "This web application allows users to record their gas consumption details, view historical data, and generate reports, helping them to monitor and manage their energy usage efficiently."
- "It provides a user-friendly interface for adding new consumption entries, tracking different types of gas usage (e.g., household, vehicle), and visualizing consumption trends over time."
- User Authentication & Authorization: (Likely includes Login, Register, Logout functionality as seen from
AccountController.csandRegister.cshtml,Login.cshtml). - Gas Consumption Data Entry: (Presumably, users can input details of their gas consumption).
- Data Viewing/Reporting: (Ability to view historical consumption, perhaps charts or summaries).
- User Profile Management: (Possibly, if there's a
ConsumerProfile.cshtml). - Dashboard: (As suggested by
Dashboard.cshtml, probably an overview for users). - Database Management: (Uses EF Core for data persistence, implied by
Migrationsfolder).
- Backend:
- C#
- ASP.NET Core (MVC / Razor Pages - based on
Pagesfolder) - Entity Framework Core (for database interactions, hinted by
Migrations)
- Frontend:
- HTML
- CSS
- JavaScript / jQuery (common in ASP.NET Core Razor Pages)
- Bootstrap (common for UI styling in ASP.NET Core)
- Database:
- SQL Server (or mention if it's SQLite, PostgreSQL, etc., if you configured it differently)
- Development Environment:
- Visual Studio 2022 (or whichever version you are using)
To get a local copy up and running, follow these simple steps.
- .NET SDK (.NET 8.0)
- Visual Studio 2022 (Community Edition is free)
- SQL Server LocalDB (usually comes with Visual Studio) or a SQL Server instance.
- Clone the repository:
git clone [https://github.com/Shaurya16h/Gas-Consumption-portal.git](https://github.com/Shaurya16h/Gas-Consumption-portal.git)
- Navigate to the project directory:
cd Gas-Consumption-portal - Open in Visual Studio:
- Open the
.sln(solution) file located in the root of the cloned directory (e.g.,Gas-Consumption-portal.sln) with Visual Studio.
- Open the
This project uses Entity Framework Core Migrations for database management.
-
Update Connection String:
- Open
appsettings.json(orappsettings.Development.json). - Locate the
ConnectionStringssection and ensure theDefaultConnectionpoints to your SQL Server instance or LocalDB.(Adjust"ConnectionStrings": { "DefaultConnection": "Server=(localdb)\\mssqllocaldb;Database=GasConsumptionDB;Trusted_Connection=True;MultipleActiveResultSets=true" }
Database=GasConsumptionDBto your desired database name if necessary.)
- Open
-
Apply Migrations:
- Open the Package Manager Console in Visual Studio (Go to
Tools>NuGet Package Manager>Package Manager Console). - Run the following commands:
Update-Database - This command will create the database and all necessary tables based on your EF Core migrations.
- Open the Package Manager Console in Visual Studio (Go to
- Run the application:
- After setting up the database, run the project from Visual Studio by pressing
F5or clicking the "IIS Express" (or "HTTPS") button in the toolbar.
- After setting up the database, run the project from Visual Studio by pressing
- Access the application:
- The application will typically open in your default browser at
https://localhost:XXXX(where XXXX is a port number, usually 7000s or 5000s).
- The application will typically open in your default browser at
- Register an account:
- On the website, use the "Register" link to create a new user account.
- Explore features:
- Log in and start adding gas consumption entries, viewing your dashboard, etc.
Briefly describe the key folders and their purpose:
Controllers/: Contains MVC controllers (if applicable).Data/: ContainsApplicationDbContext.csand potentially other data access classes.Migrations/: Entity Framework Core database migration files.Models/: Contains application models/entities.Pages/: Contains Razor Pages (.cshtmland.cshtml.csfiles) for UI and backend logic.wwwroot/: Contains static files like CSS, JavaScript, images.appsettings.json: Application configuration settings (e.g., database connection strings).Program.cs: Application entry point and startup configuration.
Contributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request
Distributed under the MIT License. See LICENSE for more information. (You'll need to add a LICENSE file to your repository if you choose one.)
Shaurya - shauryakatiyar2209@gmail.com
Project Link: https://github.com/Shaurya16h/Gas-Consumption-portal