This is the API layer for the TimeEntryUI and TimeEntryDB repos.
Version 1.0 = Initial check-in. Shows CRUD (Create, Read, Update, Delete) functionality and Master\Detail screens.
Version 1.01 = 12/31/2024 = Threatened with the "Separation of Concerns Authority" :-), everything was switched to repositories and where APIs do not know anything about DbContext.
The TimeEntry is a .NET Aspire designed to streamline workforce management. Its purpose is for employees to be able to:
- enter their time for the day
- request leave, clearance, expense reimbursement, and overtime.
This is a work-in-progress repo. The purpose of this application is to show the flow of data back and forth, not really to be a useful fully functioning application. The application has CRUD (Create, Read, Update, Delete) functionality and Master\Detail screens.
The Time Entry Server repo piece uses C#, .NET 9, has minimal APIs, uses .NET Aspire, exposes endpoints including ones for Swagger to use, uses entity framework (EF) to connect to the MS SQL Server database.
IMPORTANT - 1) Run the TimeEntryServer solution in Visual Studio. This drives everything else. 2) Change the "SQL Connection String" in 3 spots so it will work in your environment (see DB repo for details).
- Prerequisites
- Installation
- Project Setup
- Running the Project
- Additional Configuration
- Troubleshooting
- Contributing
Before beginning, make sure you have the following tools installed:
-
.Visual Studio 2022 or later.
- Download and install from Visual Studio Official Site. Free community version is fine.
- During installation, select .NET Aspire workload: ( https://learn.microsoft.com/en-us/dotnet/aspire/fundamentals/dotnet-aspire-sdk ). (.NET Aspire requires .NET 8 or higher for .NET Aspire to work. AS of this date, Visual Studio ships with .NET 9. The projects contained within this repo are .NET 9).
- Also during installation, I recommend selecting if you do not already have them: .NET desktop development and ASP.NET and web development workloads.
-
.NET 9 SDK
- Download from [.NET Official Website] (https://dotnet.microsoft.com/en-us/download/dotnet/9.0).
- This is essential for building and running .NET 9 applications, including the TimeEntry.
-
Microsoft SQL Server
- Download and install MS SQL Server: https://www.microsoft.com/en-us/sql-server/sql-server-downloads
- The free Express version is fine
-
Communication with database This solution requires communicating to a database. Change the "SQL Connection String" in 3 spots so it will work in your environment. Search for "ConnectionString" and fix all of them.
-
Open a terminal or command prompt.
-
Clone the repository with the following command:
git clone https://github.com/yourusername/TimeEntry.git
-
Navigate to the project directory:
cd TimeEntry
- Launch ** Visual Studio **.
- Select Open a project or solution.
- Navigate to the cloned
TimeEntry
folder and open the.sln
file to load the solution in Visual Studio.
- In Solution Explorer, right-click on the solution (top-level project name) and select Restore NuGet Packages.
- This will download and install all dependencies required by the project.
- In Solution Explorer, locate
appsettings.json
in the main project folder. - Open
appsettings.json
for the ApiService and AppHost projects and configure the necessary settings, including:- **Database Connection String ** (e.g., SQL Server)
- Open
TimeEntryContextFactory.cs
for the Data project and configure the necessary settings, including:- **Database Connection String ** (e.g., SQL Server)
- Save your changes.
- Unzip the zip files found in TimeEntryDB.
- Follow the TimeEntryDB instructions to attach the database.
-
Set the Startup Project:
- In Solution Explorer, right-click the TimeEntry.AppHost project and select Set as StartUp Project.
-
Run the Project:
- Click the Run button (or press
F5
) to start the application. - Visual Studio will compile the application and open it in the default browser.
- Click the Run button (or press
-
Access the Application:
- By default, the application will run at
https://localhost:5001
(HTTPS) orhttp://localhost:5000
(HTTP). - Use this URL to access the Angular frontend and interact with the Web API.
- By default, the application will run at
- Authentication. Potential inspiration at https://github.com/tbarracha/Angspire .
- Investigate possible over-subscription of things in Angular.
- Perhaps infusion of AI with potential inspiration at https://github.com/thangchung/practical-dotnet-aspire and https://dev.to/thangchung/coffeeshop-app-infused-with-ai-intelligent-apps-development-202k .
- Add API pagination rather than purely Angular pagination.
- Fork the Repository: Click on the Fork button on the GitHub repository.
- Create a New Branch: Use a descriptive branch name, like
feature/add-new-feature
. - Make Changes: Commit your changes and push to the branch.
- Submit a Pull Request: Once your changes are ready, submit a pull request for review.
Thank you for contributing to the TimeEntry project!