Getting started


To streamline the setup process and ensure a smooth, consistent development environment, Midaz utilizes Docker Compose. This section provides a step-by-step guide to get your Midaz stack up and running using Docker Compose.

Prerequisites

Before you begin, make sure you have the following installed:

Midaz Setup

1. Clone the Repository

git clone https://github.com/LerianStudio/midaz.git
cd midaz

2. Navigate to the Ledger Component

Change to the components/ledger directory, which is crucial for the operation of the Midaz project:

cd components/ledger

3. Configuring Environment Variables

Configure your environment variables by renaming and updating the .env.example to .env.

mv .env.example .env

4. Wake up Midaz with Docker compose

With the environment variables set, you can now start the Midaz stack using Docker Compose. Run the following command in the terminal:

docker-compose up -d

This command builds and starts the services defined in your docker-compose.yml file in detached mode, allowing you to continue using the terminal for other tasks.

Verify if the stack is running

Run the command below to validate if the stack is running properly.

docker ps

Next Steps - Creating an Organization

Congratulations! You have successfully set up the Midaz project on your machine. You are now ready to explore the functionalities offered by Midaz.

Now it’s time to make a test, in this case we will perform a new Organization with curl below:

curl --location 'http://127.0.0.1:3000/v1/organizations' \
--header 'Content-Type: application/json' \
--data '{
    "legalName": "Midaz Tech LTDA",
    "doingBusinessAs": "The ledger.io",
    "legalDocument": "48784548000104",
    "status": {
        "code": "ACTIVE",
        "description": "Teste Ledger"
    },
    "address": {
        "line1": "Avenida Paulista, 1234",
        "line2": "CJ 203",
        "zipCode": "04696040",
        "city": "São Paulo",
        "state": "SP",
        "country": "BR"
    },
    "metadata": {
        "string": "string",
        "boolean": true,
        "double": 10.5,
        "int": 1
    }
}'

Output 201 - Created Status Code:

{
    "id": "f59ac4b4-5043-4e3e-8678-12b11bbb05ca",
    "legalName": "Midaz Tech LTDA",
    "doingBusinessAs": "The ledger.io",
    "legalDocument": "48784548000104",
    "address": {
        "line1": "Avenida Paulista, 1234",
        "line2": "CJ 203",
        "neighborhood": "",
        "zipCode": "04696040",
        "city": "São Paulo",
        "state": "SP",
        "country": "BR"
    },
    "status": {
        "code": "ACTIVE",
        "description": "Teste Ledger"
    },
    "createdAt": "2024-05-19T20:30:35.188876216Z",
    "updatedAt": "2024-05-19T20:30:35.188876507Z",
    "deletedAt": null,
    "metadata": {
        "boolean": true,
        "double": 10.5,
        "int": 1,
        "string": "string"
    }
}

API Collection

You can easily download our API collection directly from GitHub to simplify your integration with Midaz's endpoints. Just check out the documentation here.

Are you facing any problems?

  1. Read Our Contribution Guidelines: Familiarize yourself with our Contribution Guidelines to understand how to submit contributions effectively.

  2. Join the Discussion: Participate in discussions on our community channels to get to know the project and community better. Enter in your Discord Channel.

  3. Pick an Issue: Check out the open issues labeled for beginners or propose your own project.

Don't be afraid to take the first step. Whether it's your first time contributing to an open-source project or you're an experienced.

For more detailed guides on using and contributing to the Midaz ecosystem, refer to the further documentation provided with the project. Should you encounter any issues during setup, consult our troubleshooting guide or reach out through our community support channels.

Last updated