Quick Start


Port operates by reflecting messages in the most recently updated repository. Try creating and editing a basic project to see how you can modify and configure projects. Follow along to understand the process better.

How to create a port-project


Before starting a Port project, you need to create a root folder that defines your messages. The subfolders within this root folder are managed as groups by Port, allowing users to organize messages by group. The root folder contains files with the *.enum extension and the structure of sub-group folders. Within the sub-group folders, message definition documents with the *.msg extension are created.

Here's an example


cd C:\Users\sample


port new sample


port add --group room1,room2

Project Layouts

APT/
│
├── room1/
│   ├── *.msg
│
├── room2/
│   ├── *.msg 
│
└── *.enum

How to add messages


To declare a message, you need to edit the *.msg file in the sub-folder you created. By defining message data types and attributes as shown below, you can later utilize various features such as automatic logging and backup. Additionally, you can define relationships using predefined relations.

Sample message files


 bulb1          enum.OnOff   pkg:bulb1.PowerOnOff         
 bulb2          enum.OnOff   pkg:bulb2.PowerOnOff       property:{"Arguments":"1,0"}
 RoomTemp1    num          pkg:heater1.GetTemperature property:{"MIN":0,"MAX":300}
 RoomTemp2    num          pkg:heater2.GetTemperature property:{"MIN":200,"MAX":500}          


Check packages

port ls pkg


package1 [DateTime] package2 [DateTime] package3 [DateTime] package4 [DateTime]


Add packages


move directory

cd C:\Users\Demo


Add the package to the current project under the name "bulb1"

port add --pkg bulb1 bulb


Add the package to the current project under the name "bulb2"

port add --pkg bulb2 bulb


Add the package to the current project under the name "heater1"

port add --pkg heater1 heater


Add the package to the current project under the name "heater2"

port add --pkg heater2 heater

Tip

If you see a message like [ERROR][open ..\proj.toml: Access is denied.] granting administrator privileges to the port.exe program will resolve the issue.

After linking the relations to your project, you can verify the integration using the following command

How to start project

Once all message definitions are complete, you can start the message server based on these definitions. Before running the server, upload all updated content to the local repository by entering port push in the console. Then, run the server with the command port run [project-name].

port push


port run sample


[localhost:5001]Port Running ... OK Access point count [4] Package count [2] Pressing 'CTRL + C' will initiate server shutdown. Please wait for all processes to safely terminate before closing the application.

Tip

When running the server, if you include --ng ignore in the command, it will summarize only the points where errors (NG) occur. For detailed information on these NG points, you can visit the following URL to view the NG point table:

http://localhost:5001/api/app/ng/?view=table

Good luck!