summaryrefslogtreecommitdiffstats
path: root/DESIGN.md
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--DESIGN.md113
1 files changed, 113 insertions, 0 deletions
diff --git a/DESIGN.md b/DESIGN.md
new file mode 100644
index 0000000..be60bf5
--- /dev/null
+++ b/DESIGN.md
@@ -0,0 +1,113 @@
+# endpoints
+
+## authentication
+GET /login
+POST /login
+GET /signup
+
+## user management
+POST /users
+GET /users
+GET /users/:user
+GET /users/:user/edit
+PUT /users/:user
+DELETE /users/:user
+
+## board management
+POST /boards
+GET /boards
+GET /boards/:board
+GET /boards/:board/edit
+PUT /boards/:board
+DELETE /boards/:board
+
+## pin management
+POST /pins
+GET /pins
+GET /pins/:pin
+GET /pins/:pin/edit
+PUT /pins/:pin
+DELETE /pins/:pin
+
+## files
+GET /files/:file
+
+# structures
+
+Enum Privacy {
+ Private
+ Unlisted
+ Public
+}
+
+User {
+ id int primary key
+ username string unique
+ email string unique
+ password string
+ bio text
+ site string
+ profile_picture string
+ privacy privacy
+ admin bool
+}
+
+board {
+ id int primary key
+ name string
+ description text
+ privacy privacy
+}
+
+board_ownership {
+ owner user_id
+ board board_id
+ primary key owner board
+}
+
+enum file_type {
+ image
+ audio
+ video
+ document
+ site
+ other
+}
+
+files {
+ id int primary key
+ thumbnail string (file path)
+ path string
+ type file_type
+ alt_text text
+ pin foreign key
+}
+
+// pins
+pin {
+ id int primary key
+ subject text optional
+ text text
+ notes text
+ source_url string
+}
+
+tags {
+ tag
+}
+
+pin_tags {
+ ids many to many
+}
+
+pins_boards {
+ pin pin_id foreign
+ board board_id foreign
+ primary key pin board
+}
+
+pins_owners {
+ owner user_id
+ pin pin_id
+ primary key (owner, pin)
+}