PERCEIVE Documentation Help

How to run?

Requirements

Before starting with the Perceive Web API, ensure you have the following prerequisites installed on your system:

  • .NET 8.0 SDK: The software development kit for .NET 8 is essential for compiling and running the application. Verify that both the runtime and SDK are installed on your machine.

  • Docker: Docker is required for containerizing the application, allowing it to run in a consistent and isolated environment. - Ensure Docker Desktop or the appropriate Docker environment is set up and operational.

  • Code Editor: While you can use any code editor or integrated development environment (IDE) of your preference, Visual Studio Code, JetBrains Rider, or Visual Studio are recommended for optimal .NET development experience.

Installation

Follow these steps to prepare the environment and obtain the Perceive Web API source code:

  1. Clone the Repository: Start by cloning the project repository from GitHub to your local machine.

    git clone https://dev.azure.com/horizon-perceive/_git/PerceiveAPI
  2. Install .NET Aspire Workload: The Perceive project requires the .NET Aspire workload for specific capabilities. Install it using the .NET CLI:

    dotnet workload install aspire
  3. Start Docker: Before proceeding, make sure Docker is running. This step is crucial for containerization and ensuring the application runs smoothly within a Docker container.

Building the Project

To build the Perceive Web API, follow these instructions:

  1. Navigate to the Project Directory: Open a terminal or command prompt window and change to the project's root directory, where the solution file (.sln) is located.

  2. Restore Dependencies: It's necessary to restore the project dependencies before building. Execute the following command:

    dotnet restore

Build the Project:

Compile the project to ensure there are no compilation errors. Run:

dotnet build

This step compiles the project and prepares it for running.

Running the Web API

After successfully building the project, you're ready to run the Web API:

Execute the Web API: Within the project directory, run the following command to start the Web API on your local development machine:

dotnet run

This command launches the Web API, making it accessible locally for testing and development purposes.

Access the Web API

Now go to http://localhost:port to access the API

Last modified: 28 March 2024