sepora-backend

Crates.iosepora-backend
lib.rssepora-backend
version0.1.1
created_at2025-11-24 08:54:02.507521+00
updated_at2025-11-24 08:54:02.507521+00
descriptionRust backend API for Sepora: provides endpoints for managing todos, calendars, and diaries with pluggable storage.
homepage
repositoryhttps://github.com/sepora-dev/sepora-backend
max_upload_size
id1947547
size57,186
Q0tzly (Q0tzly)

documentation

README

Sepora-Backend

Sepora-backend is a Rust backend API for Sepora. It provides endpoints for managing todos, calendars, and diaries, with pluggable storage backends.

Features

  • RESTful API endpoints for todos, diary entries, and calendar events
  • CRUD operations (Create, Read, Update, Delete)
  • Pluggable storage backends (local JSON files, GitHub)
  • CORS support for web frontend integration
  • Async/await with Tokio runtime

Setup

Prerequisites

  • Rust 1.70+ (edition 2024)
  • Cargo

Installation

# Clone the repository
git clone https://github.com/sepora-dev/sepora-backend.git
cd sepora-backend

# Build the project
cargo build --features local

# Run the server
cargo run --features local --bin server

The server will start on http://localhost:8080.

API Endpoints

Todos

  • GET /todos - List all todos
  • POST /todos - Create a new todo
    • Body: { "title": "string", "completed": false }
  • PUT /todos/{id} - Update a todo (partial update supported)
    • Body: { "title": "string" } or { "completed": true } or both
  • DELETE /todos/{id} - Delete a todo

Diaries

  • GET /diaries - List all diary entries
  • POST /diaries - Create a new diary entry
    • Body: { "content": "string" }
  • PUT /diaries/{id} - Update a diary entry
  • DELETE /diaries/{id} - Delete a diary entry

Calendars

  • GET /calendars - List all calendar events
  • POST /calendars - Create a new calendar event
    • Body: { "title": "string", "date": "YYYY-MM-DD" }
  • PUT /calendars/{id} - Update a calendar event
  • DELETE /calendars/{id} - Delete a calendar event

Storage Backends

Local Storage

Stores data in JSON files under the ./data directory.

cargo run --features local --bin server

GitHub Storage

Store data in a GitHub repository.

cargo run --features github --bin server

Development

Running Tests

# Run tests
cargo test --features local

# Run with test script
sh test.sh

Project Structure

sepora-backend/
├── bin/
│   ├── server_main.rs    # Server entry point
│   └── worker_main.rs    # Worker entry point (placeholder)
├── src/
│   ├── lib.rs           # Library root
│   └── server.rs        # API handlers and routes
├── data/                # Local storage directory (gitignored)
├── Cargo.toml
└── README.md

Dependencies

  • actix-web - Web framework
  • actix-cors - CORS middleware
  • sepora-core - Core data structures and utilities
  • sepora-storage - Storage abstraction layer
  • serde - Serialization/deserialization
  • anyhow - Error handling

License

MIT License © 2025 sepora-dev, Q0tzly

Commit count: 0

cargo fmt