Connecting a device from another device by a common Wi-Fi

Firstly, I want to note that I don't know whether here is the proper StackExchange place. Otherwise, the moderator can forward the topic.

I hope to get your ideas and ways to do my intent. I haven't done such a project before.

I have an IOT e.g. its local ip is, let's say raspberry pi, which is connected to Wi-Fi that I connect to it as well by another device. I have a text file that can be edited by the device's local ip when I enter the IP into browser within it. I mean I should be able to connect to the device from another the device. Both of them are on same Wi-Fi.

How can I do that? I need the steps. For example, do I need to behave the IOT device as a server?