No description
  • Rust 85.1%
  • Handlebars 14%
  • CSS 0.9%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2024-02-11 18:03:31 +01:00
db test sqlite queries and http requests (#10) 2022-09-20 09:22:22 +02:00
src test sqlite queries and http requests (#10) 2022-09-20 09:22:22 +02:00
static feat: implement partial web module 2022-09-17 10:11:58 +02:00
templates feat: implement partial web module 2022-09-17 10:11:58 +02:00
.env feat: can interact with API with CLI (#8) 2022-09-18 21:15:40 +02:00
.gitignore feat(web): add new clip, view raw clip content (#5) 2022-09-18 13:40:17 +02:00
architecture.png Add README 2022-09-01 14:25:52 +02:00
Cargo.lock feat: can interact with API with CLI (#8) 2022-09-18 21:15:40 +02:00
Cargo.toml feat: can interact with API with CLI (#8) 2022-09-18 21:15:40 +02:00
hit_counter.png feat: count number of clip page hits (#6) 2022-09-18 16:07:02 +02:00
LICENSE Create LICENSE 2024-02-11 18:03:31 +01:00
README.md doc: update README 2022-09-20 16:06:19 +02:00

Clip Stash

Web Service that allows to paste and share clipboard content.
Features:

  • Link sharing
  • Clip expiration
  • JSON API
  • Password protected clips

Architecture

diagram

Components

Web

  • Communicates wih outside world (clients):
    • Reports errors
    • renders pages
    • provides API
  • Manages application state
    • Establishes database connections
    • Binds ports
    • Spawn background tasks
  • Has no direct access to data layer/component. It must go through the Service component to get data.

Service

  • Intermediate layer between web requests and database.
    • can communicate with web and data components.
    • can't communicate with clients
  • Abstracts user requests and data access
  • Implements core application logic

Database

  • Manages data storage and retrieval
  • Works directly with database
  • No logic: only queries (no modification on ingoing/outgoing data)\
  • Can only communicate with service component

Domain

  • Data types shared across components
  • Enforces business rules on data
    • Domain objects cannot be created unless all rules satisfied

Hit Counter

hit counter diagram

Setup

Database

  1. Install sqlx-cli:
    cargo install sqlx-cli
    
  2. Create DB and run initial migration:
     sqlx database setup --source "db/migrations"
    

Credit

Jason Lennon Rust Course