{"id":20471140,"url":"https://github.com/apotox/go-encrynote","last_synced_at":"2026-04-15T16:02:52.227Z","repository":{"id":127158949,"uuid":"526326785","full_name":"apotox/go-encrynote","owner":"apotox","description":"share encrypted notes - simple web app with react and serverless lambda function with Golang","archived":false,"fork":false,"pushed_at":"2022-08-27T15:59:31.000Z","size":423,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-13T12:50:08.153Z","etag":null,"topics":["aws","aws-lambda","golang","react","sqs-queue"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/apotox.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":"2022-08-18T18:20:18.000Z","updated_at":"2022-08-27T16:26:17.000Z","dependencies_parsed_at":null,"dependency_job_id":"5d214088-f553-458a-826e-c0221f981f16","html_url":"https://github.com/apotox/go-encrynote","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/apotox/go-encrynote","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apotox%2Fgo-encrynote","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apotox%2Fgo-encrynote/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apotox%2Fgo-encrynote/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apotox%2Fgo-encrynote/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/apotox","download_url":"https://codeload.github.com/apotox/go-encrynote/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apotox%2Fgo-encrynote/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31848664,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-15T15:24:51.572Z","status":"ssl_error","status_checked_at":"2026-04-15T15:24:39.138Z","response_time":63,"last_error":"SSL_read: 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":["aws","aws-lambda","golang","react","sqs-queue"],"created_at":"2024-11-15T14:15:05.026Z","updated_at":"2026-04-15T16:02:52.193Z","avatar_url":"https://github.com/apotox.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"## [Encrynote Website](https://encrynote.safidev.de) \n\n\n![arch](https://github.com/apotox/go-encrynote/blob/master/client/app/public/screen.png?raw=true)\n\n**Encrynote** – an application Built on AWS Lambda and other next-gen cloud services, that auto-scale and only charge you when they run. This is a working example about how to lowers the total cost of running and operating your apps, enabling you to build more and manage less.\n\nEncrynote is a web application tool that uses serverless framework to deploy both react frontend and cloud infrastructure needed to make the serverless **Go** backend works. using Reactjs, Typescript, Go, Mongodb, Github actions, and SQS service.\nyou can find database migrations, unit tests , e2e tests and how to mock aws services, also check the github actions to find how to use test and deploy Docker containers with custom github action.\n\nthe purpose of this Application is to encrypt notes (messages) and share a one-time link with another party, i used aes for encryption. you cant use this app for production its just a POC.\n\n## AWS Lambda Functions:\n### in `/functions`\n- create_note function // called from API gateway by a POST request to create new Note\n- read_note function // called from API gateway by a GET request to read a note by its id and secretKey\n- delete_note function // triggred by SQS queue (QueueDeleteNote), the read_function publishs to the queue a NoteId after reading the note. delete_note function will consume this id and delete the Note.\n\neach function will get compiled to a **Go** binary and deployed as a lambda function (see Makefile).\n\n## SQS \nthe `delete_function` triggred by an `SQS` message, which is published after the user read a note.\nthe message is the note's `_id`.\n\n## Github Actions and CI/CD\n\n### Testing:\n\nevery `function` will be tested separately using a common docker image `action_tester.Dockerfile` , and by usign github action Matrix we can test all function in parallel ,\nyou can add more functions to be tested in `.github/workflows/main.yml` \n\n``` yaml\ntest_functions_job:\n    runs-on: ubuntu-latest\n    name: Test functions\n    strategy:\n      fail-fast: true\n      matrix:\n        function:\n          [\n            # { functionName: \"\u003cfunction package name\u003e\" },\n            { functionName: \"create_note\" },\n            { functionName: \"read_note\" },\n            { functionName: \"delete_note\" },\n          ]\n```\n\nthe custom github action `.github/actions/function-test` will be responsible for creating/running the test docker containers.\n\n## Deployment:\n\nafter a successful tests, a deploy job will be started to deploy all the compiled lambda functions. i used `serverless framework v3` to make that easier. you can see the `serverless.yaml`.\n\nthe Deploy action uses `action_deployer.Dockerfile` to:\n\n  - build the `Go` functions\n  - install the necessary `Nodejs` dependencies to make the serverless framework works.\n  - create a production config json file (decoding base64 secrets to a new file config.prod.json) this file used by the `serverless cli` to set all the required envirenment var during the deploy-to-aws process.\n\nthe `entrypoint shell scripts` used to handle the diffrent args from the custom github actions.\n\n## Database\n- Mongodb database\n\n## Migrations\n- you can add new migrations to `./migrations`\n```go\n// ...\nmigrate.Register(func(db *mongo.Database) error {\n\t\terr := db.CreateCollection(context.Background(), \"\u003ccollection name\u003e\", nil)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\treturn nil\n\t}, func(db *mongo.Database) error {\n\t\tfmt.Printf(\"Dropping %s collection\\n\", \"notes\")\n\t\terr := db.Collection(\"\u003ccollection name\u003e\").Drop(context.TODO())\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t})\n```\n\n## Tests\nbeside the `unit tests` , there are the e2e tests to test the function behavior with mocked requests/events.\n\n\nmaintained by [Safi](https://dz.linkedin.com/in/safi-eddine-bouhentala).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapotox%2Fgo-encrynote","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fapotox%2Fgo-encrynote","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapotox%2Fgo-encrynote/lists"}