- Project Overview
- Features
- Technologies Used
- Setup and Installation
- Running the Application
- Quick Start with LifeSync StartupScripts
LifeSync aims to provide a unified platform for managing personal tasks on a daily basis. The application is divided into three main projects:
- LifeSync.API: The backend API developed using .NET, responsible for handling business logic and data management.
- LifeSync.Client: The frontend application built with React and TypeScript, offering an intuitive user interface for interacting with the API.
- LifeSync.Tests.Unit: Unit tests written in .NET xUnit to ensure code reliability and maintainability.
- Personal Finance Management: Track income and expenses.
- User Profile: Track and manage personal balance and other info.
- User Authentication: Secure login and user management.
- .NET 9
- ASP.NET Core
- Entity Framework Core
- React
- TypeScript
- xUnit
- SQL Server
Follow these steps to set up your development environment for LifeSync.
-
Download & Install:
- Download MSSQL Developer Edition and run the installer. Follow the prompts in the installation wizard.
-
Configure the Server:
- Launch SQL Server Management Studio (SSMS) and connect to your server instance (typically
localhost
on port1433
). - (Optional) Adjust the authentication mode (Windows or Mixed Mode) as needed.
- Launch SQL Server Management Studio (SSMS) and connect to your server instance (typically
-
Verify the Connection:
- Ensure the server is running and you can connect to it.
To securely store sensitive information (e.g., JWT secret, database credentials), use ASP.NET Core’s user secrets.
-
Initialize User Secrets:
- Open a terminal in your ASP.NET Core project folder (the folder containing your
.csproj
file) and run:dotnet user-secrets init
- Open a terminal in your ASP.NET Core project folder (the folder containing your
-
Add Your Local Secrets:
- Create or update your local secrets with the following JSON (replace placeholder values with your actual credentials):
{ "AppSecrets": { "JWT": { "SecretKey": "INSERT_YOUR_SECRET", "Issuer": "LifeSyncApp", "Audience": "LifeSyncAppUsers", "ExpiryMinutes": 60 }, "Database": { "Username": "INSERT_YOUR_USERNAME", "Password": "INSERT_YOUR_PASSWORD", "Engine": "", "Host": "localhost", "Port": 1433, "DbInstanceIdentifier": "LifeSync" } } }
- Alternatively, set individual secrets via the command line:
dotnet user-secrets set "AppSecrets:JWT:SecretKey" "YOUR_SECRET_KEY" dotnet user-secrets set "AppSecrets:Database:Username" "YOUR_DB_USERNAME" dotnet user-secrets set "AppSecrets:Database:Password" "YOUR_DB_PASSWORD"
Important: User secrets are stored locally (typically under your user profile) and are not committed to source control.
For more details, refer to Microsoft's documentation on Secret Manager.
- Create or update your local secrets with the following JSON (replace placeholder values with your actual credentials):
-
Update the Connection String:
- Ensure your ASP.NET Core configuration (in appsettings.json or via user secrets) correctly points to your
LifeSync
MSSQL database.
- Ensure your ASP.NET Core configuration (in appsettings.json or via user secrets) correctly points to your
-
Run Migrations:
- Open a terminal in your project’s solution directory and run:
dotnet ef database update
- This command applies all pending EF Core migrations to the
LifeSync
database.
For further information, see the EF Core Migrations documentation.
- Open a terminal in your project’s solution directory and run:
-
Start the API:
- Navigate to your ASP.NET Core backend project folder.
- Run:
dotnet run
- Your backend server will start (by default, it listens on a port such as
http://localhost:5000
or as configured in your project).
-
Verify the API:
- Open your browser and navigate to the API’s URL (e.g.,
http://localhost:5000
) to confirm that it is running properly.
- Open your browser and navigate to the API’s URL (e.g.,
-
Install Dependencies:
- Navigate to your React project folder.
- Run:
npm install
-
Start the Frontend:
- Once the dependencies are installed, run:
npm start
- The frontend should start automatically (typically on port 3000 or 4200). If it doesn’t open automatically, navigate to the URL provided in the terminal.
- Once the dependencies are installed, run:
Instead of running the backend API and React frontend manually, you can simply use the provided LifeSync shortcut located in the LifeSync.StartupScripts
folder. This shortcut automates the process of launching both the backend and frontend with one click.