TonWork that's platform/marketplace where you can find work, team, and interesting project that rooted with IT(and not also). If you need team, you will can create a find order on, for example, data sciences developer or another. And you can pay for work by crypto currency(in our plan start from TON coint and move to another SOL, ETH, BTC...).
You need to download a docker image(postgres).And after create database:
docker run --name=name-of-database -e POSTGRES_PASSWORD="password" -p 5436:5432 -d --rm postgres
migrate -path ./schema -database "postgres://postgres:password@localhost:5436/postgres?sslmode=disable" up
DB_PASSWORD='password'Secret_Key='SECRET-KEY' This command will install docker image to your computer.
docker pull postgres
This command will run docker database(PostgresSQL). docker run --name=name-of-database -e POSTGRES_PASSWORD='password' -p 5436:5432 -d --rm postgres
This command will create migrations for your database.migrate -path ./schema -database "postgres://postgres:password@localhost:5436/postgres?sslmode=disable" up
This command will run project.go run cmd/main.go
docker compose build
docker compose up
- "/auth":
- "/register" POST
- "/login" POST
- "/profile/:username" GET
- "/updateProfile" PUT
- "/api/v2/":
- "/work":
- "/" POST
- "/" GET
- "/:id" GET
- "/:id" PATCH
- "/:id" DELETE
- "/posts":
- "/" POST
- "/" GET
- "/:id" GET
- "/:id" PATCH
- "/:id" DELETE
- "/subscribe":
- "/buy" POST
- "/cancel" POST
- "/timetoend" GET
- "/chat":
- "/CreateRoom" POST
- "/GetRooms" GET
- "/JoinRoom/:roomId" WebSocket
- "/GetClients/:roomId" Get
- "/work":
"/auth":
"/auth/updateProfile" PUT
"/auth/register" POST+
"/auth/login" POST+
"/auth/profile" GET+
"/api/v2/":
"/api/v2/work":
"/api/v2/work/" POST+
"/api/v2/work/" GET+
"/api/v2/work/:id" GET+
"/api/v2/work/:id" PATCH+
"/api/v2/work/:id" DELETE+
"/api/v2/posts":
"/api/v2/posts/" POST+
"/api/v2/posts/" GET+
"/api/v2/posts/:id" GET+
"/api/v2/posts/:id" PATCH+
"/api/v2/posts/:id" DELETE+
"/api/v2/subscribe":
"/api/v2/subscribe/buy" POST+
"/api/v2/subscribe/cancel" POST+
"/api/v2/subscribe/timetoend" GET+
"/api/v2/chat:
"/api/v2/chat/CreateRoom" POST+
"/api/v2/chat/GetRooms" GET+
"/api/v2/chat/JoinRoom/:roomId" WebSocket+
"/api/v2/chat/GetClients/:roomId" GET+
JWT token looks like this:
qweioucu34ioslk1j23lkjds.dkowjrlekwjriodfslvvldkwsjqr.dsfouqweopriuoiu3oi3o2uadflsk
And has three parts: header.payload.signatureClaims of our JWT token: userId, userUsername, userName, userSurname.
Please, save in cookies or session storage.
Header for token: Authorization.
Type | JSON |
---|---|
Request | { "username": "User Name", "password_hash": "123456789", "email": "[email protected]" } |
Response | { "Status": "OK" } |
Error Response | { "message": "Some text" } |
Type | JSON |
---|---|
Request | { "username": "User Name", "password_hash": "123456789" } |
Response | { "token": "wqewqeqwr123o1kepo2k-c439!(#_$I(#$.@)#@!O)$K@J)!$.!@(#JWJDWADISIADOUI" } |
Error Response | { "message": "Some text" } |
Type | JSON | Headers |
---|---|---|
Request | write param to url, example: "/auth/profile/Glebegor" | Headers |
Response | { "username": "User name", "email": "[email protected]", "telefon": "+3242 3242 432", "position": "Position", "description": "Description text", "subscribe": "Subscribe", "companies": "Companies", "name": "name", "surname": "Surname", "id": "Id" } | Headers |
Error Response | { "message": "Some text" } | Headers |
Type | JSON | Headers |
---|---|---|
Request | --- | --- |
Response | {data: [{ "title": "Title", "description": "Title", "text": "aqweqweqwesd", "tags": "['asdasd','asdasd','asdasd']", "rating": 1, "id": 2 }... ]} | --- |
Error Response | { "message": "Some text" } | --- |
Type | JSON | Headers |
---|---|---|
Request | { "title": "Title", "description": "Title", "text": "aqweqweqwesd", "tags": "['asdasd','asdasd','asdasd']", "rating": 1} | Authorization: "Bearer tokenqw.qweqweqe.qwesaid0@OI#U!sf09a" |
Response | { "Status": "OK" } | --- |
Error Response | { "message": "Some text" } | --- |
Type | JSON | Headers |
---|---|---|
Request | --- | --- |
Response | { "title": "Title", "description": "Title", "text": "aqweqweqwesd", "tags": "['asdasd','asdasd','asdasd']", "rating": 1} | --- |
Error Response | { "message": "Some text" } | --- |
Type | JSON | Headers |
---|---|---|
Request | { "title": "Title", "description": "Title", "text": "aqweqweqwesd", "tags": "['asdasd','asdasd','asdasd']", "rating": 1} | Authorization: "Bearer tokenqw.qweqweqe.qwesaid0@OI#U!sf09a" |
Response | { "Status": "OK" } | --- |
Error Response | { "message": "Some text" } | --- |
Type | JSON | Headers |
---|---|---|
Request | --- | Authorization: "Bearer tokenqw.qweqweqe.qwesaid0@OI#U!sf09a" |
Response | { "Status": "OK" } | --- |
Error Response | { "message": "Some text" } | --- |
Type | JSON | Headers |
---|---|---|
Request | --- | --- |
Response | { "data": [ { "title": "title", "description": "description", "text": "text", "tags": "['asdasd', 'asdad']", "technologies": "['qweqw', 'qweqe']", "company": "qwec rewqrq", "price": 2, "experienceLevel": "qweq ", "type_of_job": "qwe ", "invites": 0, "rating": 2, "id": 1 } ] } | --- |
Error Response | { "message": "Some text" } | --- |
Type | JSON | Headers |
---|---|---|
Request | { "title": "title", "description": "description", "text": "text", "tags": "['asdasd', 'asdad']", "technologies": "['qweqw', 'qweqe']", "company": "qwec rewqrq", "price": 2, "experienceLevel": "qweq ", "type_of_job": "qwe ", "invites": 0, "rating": 2 } | Authorization: "Bearer tokenqw.qweqweqe.qwesaid0@OI#U!sf09a" |
Response | { "Status": "OK" } | --- |
Error Response | { "message": "Some text" } | --- |
Type | JSON | Headers |
---|---|---|
Request | --- | --- |
Response | { "title": "title", "description": "description", "text": "text", "tags": "['asdasd', 'asdad']", "technologies": "['qweqw', 'qweqe']", "company": "qwec rewqrq", "price": 2, "experienceLevel": "qweq ", "type_of_job": "qwe ", "invites": 0, "rating": 2 } | --- |
Error Response | { "message": "Some text" } | --- |
Type | JSON | Headers |
---|---|---|
Request | { "title": "title", "description": "description", "text": "text", "tags": "['asdasd', 'asdad']", "technologies": "['qweqw', 'qweqe']", "company": "qwec rewqrq", "price": 2, "experienceLevel": "qweq ", "type_of_job": "qwe "} | Authorization: "Bearer tokenqw.qweqweqe.qwesaid0@OI#U!sf09a" |
Response | { "Status": "OK" } | --- |
Error Response | { "message": "Some text" } | --- |
Type | JSON | Headers |
---|---|---|
Request | --- | Authorization: "Bearer tokenqw.qweqweqe.qwesaid0@OI#U!sf09a" |
Response | { "Status": "OK" } | --- |
Error Response | { "message": "Some text" } | --- |
Type | JSON | Headers |
---|---|---|
Request | --- | Authorization: "Bearer tokenqw.qweqweqe.qwesaid0@OI#U!sf09a" |
Response | { "Status": "OK" } | --- |
Error Response | { "message": "Some text" } | --- |
{ "name":"qweqwe", "id":"qweqew" } |
Type | JSON | Headers |
---|---|---|
Request | --- | Authorization: "Bearer tokenqw.qweqweqe.qwesaid0@OI#U!sf09a" |
Response | { "Status": "OK" } | --- |
Error Response | { "message": "Some text" } | --- |
Type | JSON | Headers |
---|---|---|
Request | --- | Authorization: "Bearer tokenqw.qweqweqe.qwesaid0@OI#U!sf09a" |
Response | { "TimeToEnd": -1, "Username": "username"} | --- |
Error Response | { "message": "Some text" } | --- |
Type | JSON | Headers |
---|---|---|
Request | { "name":"qweqwe", "id":"qweqew" } | Authorization: "Bearer tokenqw.qweqweqe.qwesaid0@OI#U!sf09a" |
Response | { "name":"qweqwe", "id":"qweqew" } | --- |
Error Response | { "message": "Some text" } | --- |
Type | JSON | Headers |
---|---|---|
Request | --- | Authorization: "Bearer tokenqw.qweqweqe.qwesaid0@OI#U!sf09a" |
Response | { --- } | --- |
Error Response | { "message": "Some text" } | --- |
Type | JSON | Headers |
---|---|---|
Request | --- | Authorization: "Bearer tokenqw.qweqweqe.qwesaid0@OI#U!sf09a" |
Response | [ { "id": "room1", "name": "room1" }...] | --- |
Error Response | { "message": "Some text" } | --- |
Type | JSON | Headers |
---|---|---|
Request | --- | Authorization: "Bearer tokenqw.qweqweqe.qwesaid0@OI#U!sf09a" |
Response | [ { "id": "3", "username":"username" }...] | --- |
Error Response | { "message": "Some text" } | --- |