1
0
Fork
You've already forked pinboard
0
No description
  • Go 53.7%
  • HTML 34.9%
  • CSS 8.8%
  • Dockerfile 2.6%
natejank 800af4cbc5 Squashed commit of the following:
commit 568f61c20e9c61599bcbc38e5e8419000b9d5078
Author: natejank <njj3397@rit.edu>
Date: Fri Jun 6 09:36:39 2025 -0400
 look good
commit 27fbe13d0a629632438576f911347ae4204f813c
Author: natejank <njj3397@rit.edu>
Date: Fri Jun 6 09:21:45 2025 -0400
 remove color from stylesheet
 i am not good at making css look good, but the browser is
2025年06月06日 10:05:09 -04:00
dist also serve modernize css locally 2025年05月27日 12:43:52 -04:00
pinboard [backend] return submitted pin in /new 2025年05月26日 14:19:46 -04:00
.gitignore refactor data storage 2025年05月18日 11:45:04 -04:00
Dockerfile [Docker] store database in alternate location for volumes 2025年05月27日 14:54:55 -04:00
favicon.ico add favicon 2025年05月27日 13:51:31 -04:00
go.mod refactor data storage 2025年05月18日 11:45:04 -04:00
go.sum store and retrieve posts to sqlite 2025年03月25日 16:33:23 -04:00
icon.png add icon to readme 2025年05月27日 13:57:35 -04:00
index.html Squashed commit of the following: 2025年06月06日 09:37:27 -04:00
LICENSE readme and license 2025年03月25日 17:12:39 -04:00
README.md [Docker] store database in alternate location for volumes 2025年05月27日 14:54:55 -04:00
router.go also serve modernize css locally 2025年05月27日 12:43:52 -04:00
style.css Squashed commit of the following: 2025年06月06日 10:05:09 -04:00

Pinboard

A quick & dirty private pinboard to keep track of little bits of text. Allows you to title and categorize submissions.

Features

  • Create pins
  • Edit pins
  • Delete pins
  • Frontend
    • Basic frontend for viewing and submitting pins
    • Dynamic frontend with a stylesheet
    • Ability to set a pin title
    • Ability to select type of new pin
    • Ability to sort pins by type
    • Ability to search for pins
  • Backend
    • Search for pins
    • Delete pins
    • Edit pins
    • Query pins by parameters
    • Timestamp new pins
  • Deployment options
    • Set a port/listening address
    • Configure a database location

Building

This project uses the standard go build system. This includes pre-build steps to download frontend libraries to avoid using a CDN. There is no frontend build step. You can also use docker if you prefer :)

Docker

docker build -t pinboard:latest .

This serves HTTP on port 8080. The database is stored in /data/pins.db, which should be mounted in a volume for persistence.

Manual

go generate
go run router.go # or go build router.go -o server

Security

Although this application tries to follow best practices, it doesn't include any kind of authentication and only minimally vets user input. If you choose to deploy this, place it behind a firewall such as Tailscale.

Stack

  • Go
  • SQLite
  • Preact

Schema

/new

  • Method: POST
  • Submit a new pin

Request Body

{
 "id": 0, // this value should be supplied, but is not considered by the backend
 "title": "pin_title",
 "value": "pin_content",
 "type": "string_type",
}

Response Body

Returns the populated pin as accepted by the backend

{
 "id": 999, // id of the pin
 "title": "pin_title",
 "value": "pin_content",
 "type": "string_type",
},

/edit

  • Method: PUT
  • Update the value of a pin

Request Body

{
 "id": 999, // id of the pin to update
 "title": "pin_title",
 "value": "pin_content",
 "type": "string_type",
}

Response

OK if id corresponded to a pin, otherwise NOT FOUND.

/pins

  • Method: GET
  • Returns an array containing every pin

Request Body

None.

Response Body

[
 {
 "id": 999, // id of the pin
 "title": "pin_title",
 "value": "pin_content",
 "type": "string_type",
 },
]

/types

  • Method: GET
  • Returns the accepted types of pins

Request Body

None

Response Body

[
 "type name",
 "type name",
]

/delete

  • Method: DELETE
  • Deletes a pin

Request Body

n/a

Query Parameters

  • ?id=999
    • id of pin to delete

Response

OK if the pin was deleted. NOT FOUND if pin does not exist.