UtshobKotha - Backend is an ASP.NET Web API project built using ASP.NET 9 to provide backend services for UtshobKotha. The API serves different endpoints and is integrated with a database. Swagger is enabled to provide API documentation for easy testing and exploration.
To run this project, you need to install the following software:
-
Visual Studio 2022 or Visual Studio Code (Recommended: Visual Studio for full experience)
- Visual Studio is the IDE for developing ASP.NET Core applications.
- Visual Studio Code can also be used with proper extensions like C#.
-
Git (for cloning the repository from GitHub)
-
.NET SDK 9.0 (Required to run ASP.NET 9 Web API projects)
- Download and install .NET SDK 9.0 to your machine.
-
SQL Server (if your project requires a database, you can use SQL Server Express).
- Open Git Bash or any terminal with Git installed.
- Run the following command to clone the project repository to your local machine:
git clone https://github.com/shamim36/Backend-UtshobKotha.git
-
Open Visual Studio 2022 or Visual Studio Code.
-
In Visual Studio, follow these steps:
- Click File > Open > Project/Solution and browse to the folder where you cloned the project.
- Open the
.sln(solution) file in the project folder.
-
In Visual Studio Code, follow these steps:
- Click File > Open Folder and select the folder where you cloned the project.
-
Open Package Manager Console in Visual Studio:
- Go to Tools > NuGet Package Manager > Package Manager Console.
-
Run the following command in the Package Manager Console to restore the project dependencies:
dotnet restore
If your project includes database models that need to be migrated to the database, follow these steps:
-
Open the Package Manager Console:
- In Visual Studio, go to Tools > NuGet Package Manager > Package Manager Console.
- Alternatively, you can use Visual Studio Code with the terminal for the following commands.
-
Add a New Migration:
- In the Package Manager Console or terminal, run the following command to add a new migration:
Add-Migration InitialCreate
Once all the dependencies are installed, you need to build the project to compile the code and check for any errors. You can do this in Visual Studio or using the .NET CLI.
-
In Visual Studio:
- Open the project in Visual Studio.
- Click on Build in the top menu and select Build Solution (or press
Ctrl + Shift + B). - Visual Studio will compile the entire solution, checking for any errors or warnings in your code.
-
In the Terminal (using .NET CLI):
- Open a terminal or command prompt and navigate to the project directory.
- Run the following command to build the project:
dotnet build
Once the project is built and dependencies are restored, you can run the application locally by following these steps:
-
In Visual Studio:
- Click Run or press
F5to start the project. This will launch the application locally in your browser.
- Click Run or press
-
In the Terminal (using .NET CLI):
- Navigate to the project directory using the terminal (if you're not already there).
- Run the following command to start the application:
dotnet run
