{"id":36885262,"url":"https://github.com/braginantonev/gcalc-server","last_synced_at":"2026-01-12T15:29:17.448Z","repository":{"id":268405669,"uuid":"903908997","full_name":"braginantonev/gcalc-server","owner":"braginantonev","description":"Go calculator server","archived":false,"fork":false,"pushed_at":"2025-05-17T12:35:22.000Z","size":445,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-17T10:55:50.672Z","etag":null,"topics":["calculator","go","golang","server"],"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/braginantonev.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,"zenodo":null}},"created_at":"2024-12-15T21:30:30.000Z","updated_at":"2025-05-17T12:35:25.000Z","dependencies_parsed_at":"2024-12-16T15:40:15.771Z","dependency_job_id":"274d4855-c37f-4fa0-a7cd-b4d1c23e7192","html_url":"https://github.com/braginantonev/gcalc-server","commit_stats":null,"previous_names":["antibrag/gcalc-server","braginantonev/gcalc-server"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/braginantonev/gcalc-server","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/braginantonev%2Fgcalc-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/braginantonev%2Fgcalc-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/braginantonev%2Fgcalc-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/braginantonev%2Fgcalc-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/braginantonev","download_url":"https://codeload.github.com/braginantonev/gcalc-server/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/braginantonev%2Fgcalc-server/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28340789,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-12T12:22:26.515Z","status":"ssl_error","status_checked_at":"2026-01-12T12:22:10.856Z","response_time":98,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["calculator","go","golang","server"],"created_at":"2026-01-12T15:29:17.374Z","updated_at":"2026-01-12T15:29:17.431Z","avatar_url":"https://github.com/braginantonev.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gcalc-server\nA web service that accepts a complex expression in the form of JSON and returns the result. Available actions: +, -, *, /. And the precedence operators ().\n\n## Installation\n1. Install [Go](https://go.dev/doc/install)\n2. Install [Git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git)\n3. Clone repository: ```git clone https://github.com/braginantonev/gcalc-server```\n\n## Usage\n### Run Server\n1. Go to installed repository\n2. Install dependencies: ```go mod tidy```\n3. Setup your server:\n   - Create ```.env``` file: \n     * For Linux: ```touch .env```\n     * For Windows: ```echo.  \u003e .env``` (P.S. У меня нет винды, простите если не сработает. Создайте файл другим образом)\n   - In ```.env``` write the following environments: \n``` .env\nPORT=8080\nGRPCPort=5000\nCOMPUTING_POWER=5\nJWTSecretSignature=\"your_super_secret_signature\"\n```\n4. For run http server: ```go run cmd/main.go``` (For Windows use Git Bash or WSL).\n   * If you have error:\n```\n!!! Attention !!!\nJWT signature in env JWTSecretSignature not found.\nPlease go to README.md - Usage, and follow the instruction!\n```\n   Run server with next command: ``` PORT=8080 GRPCPort=5000 COMPUTING_POWER=5 JWTSecretSignature=\"your_super_secret_signature\" go run cmd/main.go ```\n\n5. To stop server use ```Ctrl+C```\n\n### Available request (examples)\n1. Registration (```localhost:\u003cyour port\u003e/api/v1/register```):\n   * Curl: ```curl localhost:8080/api/v1/register -X POST --header 'Content-Type: application/json' --data '{\"name\": \"Anton\",\"password\": \"12345\"}'```\n   * Postman: ![](./docs/screens/regestration_example.png)\n   * In result you get ```JWT``` token. Use him for calculate and get expressions\n2. Login (```localhost:\u003cyour port\u003e/api/v1/login```): \n   * Curl: ```curl localhost:8080/api/v1/login -X POST --header 'Content-Type: application/json' --data '{\"name\": \"Anton\",\"password\": \"12345\"}'```\n   * Postman: ![](./docs/screens/login_example.png)\n   * In result you get ```JWT``` token. Use him for calculate and get expressions\n3. Calculate (```localhost:\u003cyour port\u003e/api/v1/calculate```):\n   * If you authorized (have ```JWT``` token):\n      - Curl: ```curl localhost:\u003cyour port\u003e/api/v1/calculate -X POST -H 'Content-Type: application/json' -H \"Authorization: \u003cYour JWT token\u003e\" --data '\u003cвыражение\u003e'```. \n      - Example: ```curl localhost:8080/api/v1/calculate -X POST -H 'Content-Type: application/json' -H \"Authorization: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3NDcwNzk3MDcsImlhdCI6MTc0Njk5MzMwNywibmFtZSI6IkFudG9uIiwibmJmIjoxNzQ2OTkzMzA3fQ.TgJoztS5R0neg_Am6fKTVoXNEexz53ev1g36rZvjqgg\" --data '{\"expression\": \"1+1\"}'```\n      - Postman: ![](./docs/screens/calculate_jwt_example.png) ![](./docs/screens/calculate_example.png)\n   * If you not authorized:\n      - Curl: ```curl localhost:\u003cyour port\u003e/api/v1/calculate -X POST -H 'Content-Type: application/json' --data '\u003cвыражение\u003e'```\n      - Example: ```curl localhost:8080/api/v1/calculate -X POST -H 'Content-Type: application/json' --data '{\"expression\": \"1+1\"}'```\n      - Postman: ![](./docs/screens/calculate_example.png)\n4. Get all your expressions (```localhost:\u003cyour port\u003e/api/v1/expressions```):\n   * If you authorized (have ```JWT``` token):\n      - Curl: ```curl localhost:\u003cyour port\u003e/api/v1/expressions -X GET -H \"Authorization: \u003cYour JWT token\u003e\"```\n      - Example: ```curl localhost:8080/api/v1/expressions -X GET -H \"Authorization: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3NDcwNzk3MDcsImlhdCI6MTc0Njk5MzMwNywibmFtZSI6IkFudG9uIiwibmJmIjoxNzQ2OTkzMzA3fQ.TgJoztS5R0neg_Am6fKTVoXNEexz53ev1g36rZvjqgg\"```\n      - Postman: ![](./docs/screens/expressions_jwt_example.png)\n   * If you not authorized:\n      - Curl: ```curl localhost:\u003cyour port\u003e/api/v1/expressions -X GET```\n      - Example: ```curl localhost:8080/api/v1/expressions -X GET```\n      - Postman: ![](./docs/screens/expressions_example.png)\n5. Get expression (```localhost:\u003cyour port\u003e/api/v1/expressions/\u003cid your expression\u003e```):\n   * If you authorized (have ```JWT``` token):\n      - Curl: ```curl localhost:\u003cyour port\u003e/api/v1/expressions/\u003cid your expression\u003e -X GET -H \"Authorization: \u003cYour JWT token\u003e\"```\n      - Example: ```curl localhost:8080/api/v1/expressions/0 -X GET -H \"Authorization: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3NDcwNzk3MDcsImlhdCI6MTc0Njk5MzMwNywibmFtZSI6IkFudG9uIiwibmJmIjoxNzQ2OTkzMzA3fQ.TgJoztS5R0neg_Am6fKTVoXNEexz53ev1g36rZvjqgg\"```\n      - Postman: ![](./docs/screens/expression_jwt_example.png)\n   * If you not authorized:\n      - Curl: ```curl localhost:\u003cyour port\u003e/api/v1/expressions/\u003cid your expression\u003e -X GET```\n      - Example: ```curl localhost:8080/api/v1/expressions/0 -X GET```\n      - Postman: ![](./docs/screens/expression_example.png) \n\n## Documentation\nFor documentation on the library, usage examples and possible errors, follow the link: \n* [Русская](https://github.com/Antibrag/gcalc-server/blob/main/docs/ru/index.md)\n* [English](https://github.com/Antibrag/gcalc-server/blob/main/docs/en/index.md)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbraginantonev%2Fgcalc-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbraginantonev%2Fgcalc-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbraginantonev%2Fgcalc-server/lists"}