{"id":13622456,"url":"https://github.com/jackyzha0/ctrl-v","last_synced_at":"2025-04-15T09:32:31.078Z","repository":{"id":42657920,"uuid":"262635344","full_name":"jackyzha0/ctrl-v","owner":"jackyzha0","description":"📋 a modern, open-source pastebin with latex and markdown rendering support","archived":true,"fork":false,"pushed_at":"2023-07-09T22:05:15.000Z","size":934,"stargazers_count":118,"open_issues_count":17,"forks_count":6,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-11-08T10:47:25.539Z","etag":null,"topics":["go","nextjs","open-source","pastebin","react","vercel"],"latest_commit_sha":null,"homepage":"https://ctrl-v.app/","language":"JavaScript","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/jackyzha0.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}},"created_at":"2020-05-09T18:36:39.000Z","updated_at":"2024-10-19T17:29:57.000Z","dependencies_parsed_at":"2023-02-08T03:31:43.884Z","dependency_job_id":"f57913d7-1b28-4b37-8a12-0b38ec3572d1","html_url":"https://github.com/jackyzha0/ctrl-v","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jackyzha0%2Fctrl-v","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jackyzha0%2Fctrl-v/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jackyzha0%2Fctrl-v/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jackyzha0%2Fctrl-v/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jackyzha0","download_url":"https://codeload.github.com/jackyzha0/ctrl-v/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249043037,"owners_count":21203402,"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","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":["go","nextjs","open-source","pastebin","react","vercel"],"created_at":"2024-08-01T21:01:19.540Z","updated_at":"2025-04-15T09:32:30.642Z","avatar_url":"https://github.com/jackyzha0.png","language":"JavaScript","readme":"# ctrl-v\n### A modern, open-source pastebin with latex and markdown rendering support\nFrontend is in React + Next.js and backend is in Go. Deployed via Vercel and Google Cloud Run.\n\n![Go Paste Example](https://user-images.githubusercontent.com/23178940/83225601-06f0bb80-a135-11ea-9af2-9f2946459fe7.png)\n![Markdown Rendering](https://user-images.githubusercontent.com/23178940/83225605-0821e880-a135-11ea-9efd-e7242ebde265.png)\n![Showing off another theme!](https://user-images.githubusercontent.com/23178940/83225610-0a844280-a135-11ea-8c7c-4a0ecb13f379.png)\n![Latex Rendering](https://user-images.githubusercontent.com/23178940/83225613-0c4e0600-a135-11ea-9f27-e5653cf9f343.png)\n\n## Public API\nThe ctrl-v API is provided for free for other developers to easily develop on top of it. It can be reached at `https://api.ctrl-v.app/`.\n\n### `GET /health`\n```bash\n# get the health of the API\ncurl https://api.ctrl-v.app/health\n\n# 200 OK\n# \u003e \"status ok\"\n```\n\n### `POST /api`\n```bash\n# create a new paste\ncurl -L -X POST 'https://api.ctrl-v.app/api' \\\n    -F 'expiry=2021-03-09T01:02:43.082Z' \\\n    -F 'content=print(\\\"test content\\\")' \\\n    -F 'title=test paste' \\\n    -F 'language=python'\n\n# or with a password\ncurl -L -X POST 'https://api.ctrl-v.app/api' \\\n    -F 'expiry=2021-03-09T01:02:43.082Z' \\\n    -F 'content=print(\\\"test content\\\")' \\\n    -F 'title=test paste' \\\n    -F 'language=python' \\\n    -F 'password=hunter2'\n\n# 200 OK\n# \u003e { \"hash\": \"6Z7NVVv\" }\n\n# 400 BAD_REQUEST\n# happens when title/body is too long, password couldnt\n# be hashed, or expiry is not in RFC3339 format\n```\n### `GET /api/{hash}`\n```bash\n# get unprotected hash\ncurl https://api.ctrl-v.app/api/1t9UybX\n\n# 200 OK\n# \u003e {\n# \u003e   \"content\": \"print(\\\"test content\\\")\",\n# \u003e   \"expiry\": \"2021-03-09T01:02:43.082Z\",\n# \u003e   \"language\": \"python\",\n# \u003e   \"timestamp\": \"2021-03-02T01:06:16.209501971Z\",\n# \u003e   \"title\": \"test paste\"\n# \u003e }\n\n# 401 BAD_REQUEST\n# happens when paste is password protected. when this happens, try the authenticated alternative using POST\n# 404 NOT_FOUND\n# no paste with that ID found\n```\n\n### `POST /api/{hash}`\n```bash\n# get unprotected hash\ncurl -L -X POST 'https://api.ctrl-v.app/api/1t9UybX' \\\n  -F 'password=hunter2'\n\n# 200 OK\n# \u003e {\n# \u003e   \"content\": \"print(\\\"test content\\\")\",\n# \u003e   \"expiry\": \"2021-03-09T01:02:43.082Z\",\n# \u003e   \"language\": \"python\",\n# \u003e   \"timestamp\": \"2021-03-02T01:06:16.209501971Z\",\n# \u003e   \"title\": \"test paste\"\n# \u003e }\n\n# 401 BAD_REQUEST\n# wrong password\n# 404 NOT_FOUND\n# no paste with that ID found\n```\n\n## Developing\nwhen doing local backend development, make sure you change the backend address to be localhost. You can find this on Line 4 of `frontend/src/http/shared.js`\n\n### Common\n`make dev` \u0026mdash; starts React development server on `:3000` and backend on `:8080`\n\n### Frontend\n`make fe-run` \u0026mdash; starts React development server on `:3000`\n\n`make fe-build` \u0026mdash; builds development release of frontend in `frontend/build`\n\n### Backend\n`make run` \u0026mdash; starts backend on `:8080`\n\n`make lint` \u0026mdash; lints all Go files \n\n`make docker-build` \u0026mdash; builds Docker image of current backend\n\n`make docker-run` \u0026mdash; runs built Docker image on `:8080`","funding_links":[],"categories":["JavaScript","go","Go"],"sub_categories":["AWS Amplify"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjackyzha0%2Fctrl-v","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjackyzha0%2Fctrl-v","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjackyzha0%2Fctrl-v/lists"}