Skip to content

Setup Mockpit natively

Sran Manpreet edited this page Sep 7, 2023 · 3 revisions

To run Mockpit natively, you need to have the following tools installed on your machine:

  • Java 11
  • Maven
  • Node 14.21
  • Angular 15
  • PostgreSQL 15

Steps:

Clone the Mockpit Repository:

Fetch the latest version of Mockpit by running the following Git command:

git clone https://github.com/sranmanpreet/mockpit.git

Navigate to newly created directory with:

cd mockpit 

Setup Database

Open the file server/src/main/resources/application.yml and configure the datasource properties. For example, to set up a PostgreSQL Database, use these configurations:

spring:
   datasource:
      url: jdbc:postgresql://localhost:5432/moock #your database jdbc url here
      username: postgres #your database username here
      password: postgres #your database password here
      driver-class-name: org.postgresql.Driver #your database Driver here

Starting the Server:

Navigate to the server directory at the project root:

cd server

Install required dependencies and build the JAR using the following Maven command. This will create a JAR in the mockpit/server/target directory:

mvn clean install -U

Run the JAR using the following Java command:

java -jar target/mockpit-<version>-RELEASE.jar

By default, the server will be deployed at http://localhost:8080. You can change the port from the application configurations.

Starting the Client:

Navigate to the client directory at the project root:

cd client

Install the required node_modules using the following npm command:

npm install

Set the backend URL in mockpit/client/mockpit-ui/src/assets/config/config.json to point to the Mockpit server:

{
    "backendUrl": "http://localhost:8080"
}

Run the client using the following command:

npm start

The client will be deployed at http://localhost:4200 by default. You can change the default port using the command line or the angular.json file.

Client deployment on custom port

Clone this wiki locally