{"id":19149290,"url":"https://github.com/glebegor/ton-work-back","last_synced_at":"2026-04-08T22:31:13.675Z","repository":{"id":207919523,"uuid":"675818683","full_name":"Glebegor/Ton-Work-Back","owner":"Glebegor","description":"This is example of UpWork where you can use Ton coin.","archived":false,"fork":false,"pushed_at":"2023-12-10T14:55:48.000Z","size":106,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-22T20:32:04.845Z","etag":null,"topics":["api","backend","docker","gin","golang","postgresql"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Glebegor.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-08-07T19:53:49.000Z","updated_at":"2024-06-19T22:09:11.000Z","dependencies_parsed_at":"2025-01-03T23:45:27.886Z","dependency_job_id":null,"html_url":"https://github.com/Glebegor/Ton-Work-Back","commit_stats":null,"previous_names":["glebegor/ton-work-back"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Glebegor/Ton-Work-Back","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Glebegor%2FTon-Work-Back","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Glebegor%2FTon-Work-Back/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Glebegor%2FTon-Work-Back/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Glebegor%2FTon-Work-Back/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Glebegor","download_url":"https://codeload.github.com/Glebegor/Ton-Work-Back/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Glebegor%2FTon-Work-Back/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271415496,"owners_count":24755639,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-21T02:00:08.990Z","response_time":74,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","backend","docker","gin","golang","postgresql"],"created_at":"2024-11-09T08:07:29.444Z","updated_at":"2026-04-08T22:31:13.638Z","avatar_url":"https://github.com/Glebegor.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Backend of TonWork service.\nTonWork that's platform/marketplace where you can find work, team, and interesting project that rooted with IT(and not also).\nIf you need team, you will can create a find order on, for example, data sciences developer or another. \nAnd you can pay for work by crypto currency(in our plan start from TON coint and move to another SOL, ETH, BTC...).\n\n\u003ch3\u003eStart project by cmd\u003c/h3\u003e\n\u003ch4\u003e1-Start database:\u003c/h4\u003e\nYou need to download a docker image(postgres).\u003cbr\u003e\nAnd after create database:\u003cbr\u003e\n\u003ccode\u003edocker run --name=name-of-database -e POSTGRES_PASSWORD=\"password\" -p 5436:5432 -d --rm postgres\u003c/code\u003e\n\u003ch4\u003e2-Create migrations:\u003c/h4\u003e\n\u003ccode\u003emigrate -path ./schema -database \"postgres://postgres:password@localhost:5436/postgres?sslmode=disable\" up\u003c/code\u003e\n\u003ch4\u003e3-Create .env file:\u003c/h4\u003e\nDB_PASSWORD='password'\u003cbr\u003e\nSecret_Key='SECRET-KEY'\n\u003ch4\u003e4-Run project:\u003c/h4\u003e\n\n\u003ch3\u003eRun project by Makefile:\u003c/h3\u003e\n\u003ch4\u003einstalldb:\u003c/h4\u003e\nThis command will install docker image to your computer.\u003cbr\u003e\n\u003ccode\u003edocker pull postgres\u003c/code\u003e\n\u003ch4\u003ebuild:\u003c/h4\u003e\nThis command will run docker database(PostgresSQL). \u003cbr\u003e\n\u003ccode\u003edocker run --name=name-of-database -e POSTGRES_PASSWORD='password' -p 5436:5432 -d --rm postgres\u003c/code\u003e\n\u003ch4\u003emigrate:\u003c/h4\u003e\nThis command will create migrations for your database.\u003cbr\u003e\n\u003ccode\u003emigrate -path ./schema -database \"postgres://postgres:password@localhost:5436/postgres?sslmode=disable\" up\u003c/code\u003e\n\u003ch4\u003erun:\u003c/h4\u003e\nThis command will run project.\u003cbr\u003e\n\u003ccode\u003ego run cmd/main.go\u003c/code\u003e\n\n\u003ch3\u003eLoading by docker compose\u003c/h3\u003e\n\u003ccode\u003edocker compose build\u003c/code\u003e\u003cbr\u003e\n\u003ccode\u003edocker compose up\u003c/code\u003e\n\n\u003ch3\u003eWork with API\u003c/h3\u003e\n\n1. \"/auth\":\n      - \"/register\"   POST\n      - \"/login\"      POST\n      - \"/profile/:username\"    GET\n      - \"/updateProfile\"    PUT\n2. \"/api/v2/\":\n      - \"/work\":\n          - \"/\"       POST\n          - \"/\"       GET\n          - \"/:id\"    GET\n          - \"/:id\"    PATCH\n          - \"/:id\"    DELETE\n      - \"/posts\":\n          - \"/\"       POST\n          - \"/\"       GET\n          - \"/:id\"    GET\n          - \"/:id\"    PATCH\n          - \"/:id\"    DELETE\n      - \"/subscribe\":\n          - \"/buy\"    POST\n          - \"/cancel\" POST\n          - \"/timetoend\" GET\n      - \"/chat\":\n          - \"/CreateRoom\" POST\n          - \"/GetRooms\" GET\n          - \"/JoinRoom/:roomId\" WebSocket\n          - \"/GetClients/:roomId\" Get\n         \n\u003ch4\u003eOr you can see it in this format(Handler is realizated if has \"+\" on the right side):\u003c/h4\u003e\u003cbr\u003e\n\"/auth\":\u003cbr\u003e\n\"/auth/updateProfile\"             PUT\u003cbr\u003e\n\"/auth/register\"                  POST+\u003cbr\u003e\n\"/auth/login\"                     POST+\u003cbr\u003e\n\"/auth/profile\"                   GET+\u003cbr\u003e\n\u003cbr\u003e\n\"/api/v2/\":\u003cbr\u003e\n\u003cbr\u003e\n\"/api/v2/work\":\u003cbr\u003e\n\"/api/v2/work/\"                   POST+\u003cbr\u003e\n\"/api/v2/work/\"                   GET+\u003cbr\u003e\n\"/api/v2/work/:id\"                GET+\u003cbr\u003e\n\"/api/v2/work/:id\"                PATCH+\u003cbr\u003e\n\"/api/v2/work/:id\"                DELETE+\u003cbr\u003e\n\u003cbr\u003e\n\"/api/v2/posts\":\u003cbr\u003e\n\"/api/v2/posts/\"                  POST+\u003cbr\u003e\n\"/api/v2/posts/\"                  GET+\u003cbr\u003e\n\"/api/v2/posts/:id\"               GET+\u003cbr\u003e\n\"/api/v2/posts/:id\"               PATCH+\u003cbr\u003e\n\"/api/v2/posts/:id\"               DELETE+\u003cbr\u003e\n\u003cbr\u003e\n\"/api/v2/subscribe\":\u003cbr\u003e\n\"/api/v2/subscribe/buy\"           POST+\u003cbr\u003e\n\"/api/v2/subscribe/cancel\"        POST+\u003cbr\u003e\n\"/api/v2/subscribe/timetoend\"     GET+\u003cbr\u003e\n\u003cbr\u003e\n\"/api/v2/chat:\u003cbr\u003e\n\"/api/v2/chat/CreateRoom\"         POST+\u003cbr\u003e\n\"/api/v2/chat/GetRooms\"           GET+\u003cbr\u003e\n\"/api/v2/chat/JoinRoom/:roomId\"   WebSocket+\u003cbr\u003e\n\"/api/v2/chat/GetClients/:roomId\" GET+\u003cbr\u003e\n\u003ch3\u003eJWT token and his structure\u003c/h3\u003e\n\u003chr\u003e\nJWT token looks like this:\n\u003ccode\u003eqweioucu34ioslk1j23lkjds.dkowjrlekwjriodfslvvldkwsjqr.dsfouqweopriuoiu3oi3o2uadflsk\u003c/code\u003e\nAnd has three parts: header.payload.signature\u003cbr\u003e\nClaims of our JWT token: userId, userUsername, userName, userSurname.\u003cbr\u003e\nPlease, save in cookies or session storage. \u003cbr\u003e\nHeader for token: Authorization.\u003cbr\u003e \n\n\u003ch3\u003eRequests and responses on every link\u003c/h3\u003e\n\u003ch3\u003eAUTH\u003c/h3\u003e\n\u003chr\u003e\n\u003ch4\u003e\"/auth/register\", method:POST.\u003c/h4\u003e\n\nType | JSON \n--- | ---\nRequest | { \"username\": \"User Name\", \"password_hash\": \"123456789\", \"email\": \"nickname@gmail.com\" }\nResponse | { \"Status\": \"OK\" } \nError Response | { \"message\": \"Some text\" } \n\n\u003ch4\u003e\"/auth/login\", method:POST.\u003c/h4\u003e\n\nType | JSON \n--- | ---\nRequest | { \"username\": \"User Name\", \"password_hash\": \"123456789\" }\nResponse | { \"token\": \"wqewqeqwr123o1kepo2k-c439!(#_$I(#$.@)#@!O)$K@J)!$.!@(#JWJDWADISIADOUI\" }\nError Response | { \"message\": \"Some text\" } \n\n\u003ch4\u003e\"/auth/profile/${Username}\", method:GET.\u003c/h4\u003e\n\nType | JSON | Headers\n--- | --- | ---\nRequest | write param to url, example: \"/auth/profile/Glebegor\" | Headers\nResponse | { \"username\": \"User name\", \"email\": \"email@gmail.com\", \"telefon\": \"+3242 3242 432\", \"position\": \"Position\", \"description\": \"Description text\", \"subscribe\": \"Subscribe\", \"companies\": \"Companies\", \"name\": \"name\", \"surname\": \"Surname\", \"id\": \"Id\" } | Headers\nError Response | { \"message\": \"Some text\" } | Headers\n\n\u003ch3\u003ePOSTS\u003c/h3\u003e\n\u003chr\u003e\n\u003ch4\u003e\"/api/v2/posts/\", method:GET.\u003c/h4\u003e\n\nType | JSON | Headers \n--- | --- | --- \nRequest | --- | --- \nResponse | {data: [{ \"title\": \"Title\", \"description\": \"Title\", \"text\": \"aqweqweqwesd\", \"tags\": \"['asdasd','asdasd','asdasd']\", \"rating\": 1, \"id\": 2 }... ]}| --- \nError Response | { \"message\": \"Some text\" } | --- \n\n\u003ch4\u003e\"/api/v2/posts/\", method:POST.\u003c/h4\u003e\n\nType | JSON | Headers \n--- | --- | --- \nRequest | { \"title\": \"Title\", \"description\": \"Title\", \"text\": \"aqweqweqwesd\", \"tags\": \"['asdasd','asdasd','asdasd']\", \"rating\": 1} | Authorization: \"Bearer tokenqw.qweqweqe.qwesaid0@OI#U!sf09a\" \nResponse | { \"Status\": \"OK\" }| --- \nError Response | { \"message\": \"Some text\" } | --- \n\n\u003ch4\u003e\"/api/v2/posts/:id\", method:GET.\u003c/h4\u003e\n\nType | JSON | Headers \n--- | --- | --- \nRequest | --- | ---\nResponse | { \"title\": \"Title\", \"description\": \"Title\", \"text\": \"aqweqweqwesd\", \"tags\": \"['asdasd','asdasd','asdasd']\", \"rating\": 1}| --- \nError Response | { \"message\": \"Some text\" } | --- \n\n\u003ch4\u003e\"/api/v2/posts/:id\", method:PUT.\u003c/h4\u003e\n\nType | JSON | Headers \n--- | --- | --- \nRequest | { \"title\": \"Title\", \"description\": \"Title\", \"text\": \"aqweqweqwesd\", \"tags\": \"['asdasd','asdasd','asdasd']\", \"rating\": 1} | Authorization: \"Bearer tokenqw.qweqweqe.qwesaid0@OI#U!sf09a\" \nResponse | { \"Status\": \"OK\" } | --- \nError Response | { \"message\": \"Some text\" } | --- \n\n\u003ch4\u003e\"/api/v2/posts/:id\", method:DELETE.\u003c/h4\u003e\n\nType | JSON | Headers \n--- | --- | --- \nRequest | --- | Authorization: \"Bearer tokenqw.qweqweqe.qwesaid0@OI#U!sf09a\" \nResponse | { \"Status\": \"OK\" } | --- \nError Response | { \"message\": \"Some text\" } | --- \n\n\u003ch3\u003eWORKS\u003c/h3\u003e\n\u003chr\u003e\n\u003ch4\u003e\"/api/v2/posts/\", method:GET.\u003c/h4\u003e\n\nType | JSON | Headers \n--- | --- | --- \nRequest | --- | --- \nResponse | { \"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 } ] }| --- \nError Response | { \"message\": \"Some text\" } | --- \n\n\u003ch4\u003e\"/api/v2/work/\", method:POST.\u003c/h4\u003e\n\nType | JSON | Headers \n--- | --- | --- \nRequest | { \"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\" \nResponse | { \"Status\": \"OK\" }| --- \nError Response | { \"message\": \"Some text\" } | --- \n\n\u003ch4\u003e\"/api/v2/work/:id\", method:GET.\u003c/h4\u003e\n\nType | JSON | Headers \n--- | --- | --- \nRequest | --- | ---\nResponse | { \"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 }| --- \nError Response | { \"message\": \"Some text\" } | --- \n\n\u003ch4\u003e\"/api/v2/work/:id\", method:PUT.\u003c/h4\u003e\n\nType | JSON | Headers \n--- | --- | --- \nRequest | { \"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\" \nResponse | { \"Status\": \"OK\" } | --- \nError Response | { \"message\": \"Some text\" } | --- \n\n\u003ch4\u003e\"/api/v2/work/:id\", method:DELETE.\u003c/h4\u003e\n\nType | JSON | Headers \n--- | --- | --- \nRequest | --- | Authorization: \"Bearer tokenqw.qweqweqe.qwesaid0@OI#U!sf09a\" \nResponse | { \"Status\": \"OK\" } | --- \nError Response | { \"message\": \"Some text\" } | --- \n\n\u003ch3\u003eSUBSCRIBES\u003c/h3\u003e\n\u003chr\u003e\n\u003ch4\u003e\"/api/v2/subscribe/buy\", method:POST.\u003c/h4\u003e\n\nType | JSON | Headers \n--- | --- | --- \nRequest | --- | Authorization: \"Bearer tokenqw.qweqweqe.qwesaid0@OI#U!sf09a\" \nResponse | { \"Status\": \"OK\" } | --- \nError Response | { \"message\": \"Some text\" } | --- \n{ \"name\":\"qweqwe\", \"id\":\"qweqew\" }\n\u003ch4\u003e\"/api/v2/subscribe/cancel\", method:POST.\u003c/h4\u003e\n\nType | JSON | Headers \n--- | --- | --- \nRequest | --- | Authorization: \"Bearer tokenqw.qweqweqe.qwesaid0@OI#U!sf09a\" \nResponse | { \"Status\": \"OK\" } | --- \nError Response | { \"message\": \"Some text\" } | --- \n\n\u003ch4\u003e\"/api/v2/subscribe/timetoend\", method:GET.\u003c/h4\u003e\n\nType | JSON | Headers \n--- | --- | --- \nRequest | --- | Authorization: \"Bearer tokenqw.qweqweqe.qwesaid0@OI#U!sf09a\" \nResponse | { \"TimeToEnd\": -1, \"Username\": \"username\"} | --- \nError Response | { \"message\": \"Some text\" } | --- \n\n\u003ch3\u003eCHAT\u003c/h3\u003e\n\u003chr\u003e\n\u003ch4\u003e\"/api/v2/chat/CreateRoom\", method:POST\u003c/h4\u003e\n\nType | JSON | Headers\n--- | --- | ---\nRequest | { \"name\":\"qweqwe\", \"id\":\"qweqew\" } |  Authorization: \"Bearer tokenqw.qweqweqe.qwesaid0@OI#U!sf09a\"\nResponse | { \"name\":\"qweqwe\", \"id\":\"qweqew\" } | ---\nError Response | { \"message\": \"Some text\" } | ---\n\n\u003ch4\u003e\"/api/v2/chat/JoinRoom/:roomId\", method:WEBSOCKET\u003c/h4\u003e\n\nType | JSON | Headers\n--- | --- | ---\nRequest | --- |  Authorization: \"Bearer tokenqw.qweqweqe.qwesaid0@OI#U!sf09a\"\nResponse | { --- } | ---\nError Response | { \"message\": \"Some text\" } | ---\n\n\u003ch4\u003e\"/api/v2/chat/GetRooms\", method:GET\u003c/h4\u003e\n\nType | JSON | Headers\n--- | --- | ---\nRequest | --- |  Authorization: \"Bearer tokenqw.qweqweqe.qwesaid0@OI#U!sf09a\"\nResponse | [ { \"id\": \"room1\", \"name\": \"room1\" }...] | ---\nError Response | { \"message\": \"Some text\" } | ---\n\n\u003ch4\u003e\"/api/v2/chat/GetClients/:roomId\", method:GET\u003c/h4\u003e\n\nType | JSON | Headers\n--- | --- | ---\nRequest | --- |  Authorization: \"Bearer tokenqw.qweqweqe.qwesaid0@OI#U!sf09a\"\nResponse | [ { \"id\": \"3\", \"username\":\"username\" }...] | ---\nError Response | { \"message\": \"Some text\" } | ---\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fglebegor%2Fton-work-back","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fglebegor%2Fton-work-back","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fglebegor%2Fton-work-back/lists"}