Linka Documentation

A customizable open-source social network base

1 - How to Install

To install Linka, you can download it directly or compile the source code.

First, you will need a VPS or a web server if you want your Linka server online.

1. Download the source code:

git clone https://github.com/luizgustavo76/Linka

2. Compile Linka:

On Linux:

make compile
make run

On Windows:

compile.bat

2 - How to Launch My Own Server?

To launch your own server, follow these steps:

1. Clone the repository and enter the Linka directory:

git clone https://github.com/luizgustavo76/Linka

2. Install dependencies:

pip install -r requirements.txt

3. Go to the backend directory:

cd backend

Important: If you are running Linka on your personal computer, the server will only work on your local network.

Run the server:

python main.py

How to use federations

Linka's biggest advantage is the ease of creating your own server and the simple implementation of federations in just a few lines of code.

to use federations follow this steps:

1.1-import the api LinkaFederations

1.2-to download the api, run: pip install LinkaFederations

2-to use the api in your code:

import LinkaFederations #import the api
LinkaFederations.connect_json("route.json") #-- your routes json
LinkaFederations.start()

the route json in the method LinkaFederations This file is used to translate your server routes, identify servers you don't want to communicate with, and specify the domain your server is running on.

how to make this file?

{
"domain":"your-domain.com",
"blacklist":{},
"routes":{
"create-post":"/new-post",
"send-a-message":"/send-message",
"sign-out":"/out"
}
}

the domain is your domain on the server is running

blacklist is servers you dont want communicate

and routes is a translator of your routes to universal routes

now, your server support federations!

server routes and how to use

this topic explain how to use the routes of the server in your own client

login

/register
method:post
json="username", "password", "email"

/login
method:post
json="username", "password"

friends

/inbox
methods:post
json="username"
what is? is your inbox of friends requests and news

/accept
methods:post
json="receiver", "remittee",
what is? accept a friend requests

/send-friend
methods:post
json="receiver", "remittee"
what is? is a route to send a friend request

Chat

/send
methods:post
json="receiver", "remittee", "message
what is? a route to send message Chat

/view
methods:post
json="receiver", "remittee"
what is? a route of view Chat

Post

/new
methods:post
json="username, text_post, datetime"
what is?a route of creation of Post

/view
methods:get
endpoint:id_of_post
what is? a route of view a post with post_id

Note: Successful requests return HTTP status codes 200 or 201. Failed requests return error codes such as 400, 401, 403, 404, or 500

Customization

Linka is fully customizable.

You can modify the client GUI or the server to create your own social network experience.

Launch your own server. Build your own network.