This is an ASP.NET MVC project for tracking expenses. The project includes features such as adding income and expenses, categorizing them, and viewing summaries.
Before you begin, ensure you have met the following requirements:
- .NET SDK: Download and install the .NET SDK (version 6.0 or later).
- Visual Studio: Install Visual Studio with the ASP.NET and web development workload.
- Mysql Server:
- Git: Install Git to clone the repository.
To clone the repository, follow these steps:
-
Open a terminal or command prompt.
-
Navigate to the directory where you want to clone the project.
-
Run the following command to clone the repository:
git clone https://github.com/danujav/expense-tracker.git
-
Navigate into the project directory:
cd expense-tracker
To run the project, follow these steps:
-
Open the project in Visual Studio:
- Open Visual Studio.
- Click on
File
->Open
->Project/Solution
. - Navigate to the
expense-tracker
directory and open the.sln
file.
-
Restore NuGet packages:
- Visual Studio will automatically restore the NuGet packages when you open the solution. If not, go to
Tools
->NuGet Package Manager
->Package Manager Console
and run the command:
Update-Package -reinstall
- Visual Studio will automatically restore the NuGet packages when you open the solution. If not, go to
-
Update the database connection string:
- Open the
appsettings.json
file. - Locate the
ConnectionStrings
section and update theDefaultConnection
string to match your MySQL server instance. Example:
"ConnectionStrings": { "DefaultConnection": "Server=localhost;Database=ExpenseTracker;User=root;Password=yourpassword;" }
- Open the
-
Apply migrations and create the database:
- Open the
Package Manager Console
fromTools
->NuGet Package Manager
->Package Manager Console
. - Run the following commands:
Add-Migration InitialCreate Update-Database
- Open the
-
Build and run the project:
- Press
F5
or click onDebug
->Start Debugging
to build and run the project.
- Press
- Once the project is running, navigate to
http://localhost:<port>/
in your web browser. - Use the navigation bar to access different sections of the application.
- Add, edit, and view your expenses and income entries.