Welcome to the repository for PROJECT C. This guide will help you set up the project and run it locally on your machine.
- Create Mock Server endpoints to emulate a RESTful API behavior for testing during development.
- Capture Webhook events to redirect them to local environments using our CLI tool.
- Define variants of the simulated endpoints in the Mock Server to test multiple scenarios simultaneously.
- Generate responses dynamically from temporal storage and previous request data
Before you begin, make sure you have the following installed:
- .NET 8 SDK
- Visual Studio 2022 or Visual Studio Code (or any IDE of your choice with .NET support)
- SQL Server or use SQL Server Express for development purposes
To get started with the project, follow these steps:
-
Clone the repository:
git clone https://github.com/kevin-mr/project-c.git cd project-c -
Configure the Database:
- Install and configure SQL Server or SQL Server Express if not already installed.
- Create a new database
[your_database_name].
- Database Connection Configuration:
- Open the appsettings.json file in the ProjectC.Server project:
{ "ConnectionStrings": { "DefaultConnection": "Data Source=(localdb)\\MSSQLLocalDB;Database=your_database_name;Integrated Security=True;Connect Timeout=30;Encrypt=False;Trust Server Certificate=False;Application Intent=ReadWrite;Multi Subnet Failover=False;User Id=your_user_id;password=your_password;" }, // Other configurations... } - Replace
your_database_name,your_user_id,your_password, and any other necessary settings with your SQL Server configuration.
- Run Database Migrations:
-
Open a terminal or command prompt in the ProjectC.Server directory and run the following commands:
dotnet ef database update
-
This command applies any pending migrations to the database.
-
If you have any problem running the migrations, check ef official docs
- Build and Run the Project:
- Open the solution (ProjectName.sln) in Visual Studio or Visual Studio Code.
- Restore the dependencies and build the solution.
- Set ProjectC.Server as the startup project.
- Press F5 or use the IDE's running/debugging feature to start the project.
- Access the Application:
Once the project is running, you can access the Blazor application in your web browser at:
- https://localhost:7026 (or another port if configured differently)
- CLI Tool
To redirect webhook events to a local environment, follow these steps:
-
Publish Your Project to the Cloud: Utilize any cloud provider such as Azure that offers a public URL.
-
Run the CLI Project: Execute the CLI project and specify the server URL as a parameter.
project-c --url [server_url]
Replace [server_url] with your actual server URL, e.g., https://localhost:7026.
- Alternatively, Use the NuGet Package Version: If preferred, you can also use the NuGet package version of the project. The command remains the same.
If you encounter any issues while setting up or running the project, please check the following:
- Ensure all prerequisites are installed correctly.
- Verify database connection strings and configurations in appsettings.json.
- Check for any build or runtime errors in Visual Studio or Visual Studio Code.
If your issue is not resolved, please submit an issue to the repository.