No description
- Rust 85.1%
- Handlebars 14%
- CSS 0.9%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| db | ||
| src | ||
| static | ||
| templates | ||
| .env | ||
| .gitignore | ||
| architecture.png | ||
| Cargo.lock | ||
| Cargo.toml | ||
| hit_counter.png | ||
| LICENSE | ||
| README.md | ||
Clip Stash
Web Service that allows to paste and share clipboard content.
Features:
- Link sharing
- Clip expiration
- JSON API
- Password protected clips
Architecture
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
Setup
Database
- Install
sqlx-cli:cargo install sqlx-cli - Create DB and run initial migration:
sqlx database setup --source "db/migrations"
