• This repository has been archived on 20/Dec/2023
  • Stars
    star
    117
  • Rank 299,835 (Top 6 %)
  • Language
    JavaScript
  • Created over 4 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

πŸ“‹ a modern, open-source pastebin with latex and markdown rendering support

ctrl-v

A modern, open-source pastebin with latex and markdown rendering support

Frontend is in React + Next.js and backend is in Go. Deployed via Vercel and Google Cloud Run.

Go Paste Example Markdown Rendering Showing off another theme! Latex Rendering

Public API

The 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/.

GET /health

# get the health of the API
curl https://api.ctrl-v.app/health

# 200 OK
# > "status ok"

POST /api

# create a new paste
curl -L -X POST 'https://api.ctrl-v.app/api' \
    -F 'expiry=2021-03-09T01:02:43.082Z' \
    -F 'content=print(\"test content\")' \
    -F 'title=test paste' \
    -F 'language=python'

# or with a password
curl -L -X POST 'https://api.ctrl-v.app/api' \
    -F 'expiry=2021-03-09T01:02:43.082Z' \
    -F 'content=print(\"test content\")' \
    -F 'title=test paste' \
    -F 'language=python' \
    -F 'password=hunter2'

# 200 OK
# > { "hash": "6Z7NVVv" }

# 400 BAD_REQUEST
# happens when title/body is too long, password couldnt
# be hashed, or expiry is not in RFC3339 format

GET /api/{hash}

# get unprotected hash
curl https://api.ctrl-v.app/api/1t9UybX

# 200 OK
# > {
# >   "content": "print(\"test content\")",
# >   "expiry": "2021-03-09T01:02:43.082Z",
# >   "language": "python",
# >   "timestamp": "2021-03-02T01:06:16.209501971Z",
# >   "title": "test paste"
# > }

# 401 BAD_REQUEST
# happens when paste is password protected. when this happens, try the authenticated alternative using POST
# 404 NOT_FOUND
# no paste with that ID found

POST /api/{hash}

# get unprotected hash
curl -L -X POST 'https://api.ctrl-v.app/api/1t9UybX' \
  -F 'password=hunter2'

# 200 OK
# > {
# >   "content": "print(\"test content\")",
# >   "expiry": "2021-03-09T01:02:43.082Z",
# >   "language": "python",
# >   "timestamp": "2021-03-02T01:06:16.209501971Z",
# >   "title": "test paste"
# > }

# 401 BAD_REQUEST
# wrong password
# 404 NOT_FOUND
# no paste with that ID found

Developing

when 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

Common

make dev β€” starts React development server on :3000 and backend on :8080

Frontend

make fe-run β€” starts React development server on :3000

make fe-build β€” builds development release of frontend in frontend/build

Backend

make run β€” starts backend on :8080

make lint β€” lints all Go files

make docker-build β€” builds Docker image of current backend

make docker-run β€” runs built Docker image on :8080

More Repositories

1

quartz

🌱 a fast, batteries-included static-site generator that transforms Markdown content into fully functional websites
TypeScript
6,508
star
2

portal

πŸ”— zero-config peer-to-peer encrypted live folder syncing that respects your `.gitignore`
TypeScript
364
star
3

cursor-chat

πŸ’¬ cursor chat Γ  la Figma for digital co-existing + presence
TypeScript
219
star
4

bft-json-crdt

🏰 the first JSON-like Byzantine Fault Tolerant CRDT
Rust
201
star
5

hugo-obsidian

simple GitHub action to parse Markdown Links into a .json file for Hugo
Go
148
star
6

docker-explained

πŸ‹ wtf is docker and why is everyone talking about it
Dockerfile
121
star
7

tabspace

✍️ A scratchspace for your new Tab page
TypeScript
115
star
8

jackyzha0.github.io

✨ website v3
TypeScript
97
star
9

telescopic-text

πŸ”­ an open-source library to help with creating expandable text
TypeScript
88
star
10

nanoDB

πŸ’Ύ a simple, easy, and debuggable document database for prototyping and hackathons
Go
74
star
11

miniraft

πŸš£β€β™€οΈ <1kloc, well-documented Raft consensus algorithm implementation
Rust
46
star
12

DroneNet

Decentralized drone swarm communication for search and rescue missions
Python
35
star
13

min-react

Yet another minimal React template
JavaScript
17
star
14

paypaya

[πŸ† 5th place + Best Fintech at HackWestern] PayPaya -- SMS Money Transfer for Low Bandwidth Regions with Biometric Authentication
Python
15
star
15

rs-openai

A Rust crate for easy serving of OpenAI's API with rate limiting and token use tracking out of the box
Rust
12
star
16

discord-steward

🌿 A pace-layered approach to high-volume Discord Servers.
TypeScript
10
star
17

lite.css

a dead-simple just-add-water css library
HTML
10
star
18

template-react

For when create-react-app just doesn't give you what you want.
JavaScript
9
star
19

PacketBook

[πŸ† Top 30 at nwHacks 2018, SAP iXP Prize] PacketBook SMS financial inclusion platform powered by the Stellar Blockchain
JavaScript
7
star
20

play

artifact from interact circle on hackathon culture + play
JavaScript
7
star
21

NEAT-genetic-algo

BIOL111 Group Project
Python
6
star
22

treehacks2020-backend

[πŸ† Azure Prize at TreeHacks] readAR -- 🌲 TreeHacks 2020 Backend
Python
5
star
23

hruid

human-readable base16 IDs
JavaScript
5
star
24

hackTheNorth2018

πŸ“± Tapp.it! - Cryptopayments over NFC
Java
5
star
25

Speech2Braille

[πŸ† Silver Medal at CWSF] Tensorflow Implementation of TIMIT Deep BLSTM-CTC with Tensorboard Support
Python
5
star
26

go-auth-w-mongo

Simple session based authentication with Mux and MongoDB
Go
4
star
27

lhd-build-python-webapp

The Python Webapp workshop at UBC LHD 2019!
HTML
3
star
28

go-remote-debug

A quick tutorial on debugging containerized Go applications!
Go
3
star
29

htn22

HTN22 - Intro to Computer Networking and Peer-to-peer
HTML
3
star
30

front-proxy-PoC

Simple Envoy Service Mesh with External Authorization and Custom Header Injection.
Go
3
star
31

blog

some mildly coherent ramblings
CSS
3
star
32

jackyzha0

a cool readme
TypeScript
3
star
33

dotfiles

dotfiles n things
Lua
3
star
34

monGo-driver-wrapper

A small Go wrapper to reduce boilerplate of using the official Go Mongo Driver
Go
2
star
35

curius-viz

JavaScript
2
star
36

website-v2

✨ now with templating and other cool stuff ✨
CSS
2
star
37

riverbed

TypeScript
2
star
38

groupCalendar

A Group Web Calendar created with Meteor
JavaScript
1
star
39

python-spacegame

2D Top Down Space Shooter
Python
1
star
40

y-webrtc-signalling

a simple y-webrtc signalling server for use in serverless environments
JavaScript
1
star
41

apcs-spaceshooter

Short project for APCS A
Java
1
star
42

wholesome-bot

A fun little web scrapping project to bring some happiness to the world
HTML
1
star
43

dailycodingproblem

Python
1
star
44

gameoflife

Java Implementation of Conway's Game of Life
Java
1
star