No description
Find a file
2026-01-30 16:08:35 -06:00
cmd/server Init 2026-01-30 16:08:35 -06:00
docs Init 2026-01-30 16:08:35 -06:00
internal Init 2026-01-30 16:08:35 -06:00
.dockerignore Init 2026-01-30 16:08:35 -06:00
.gitignore Init 2026-01-30 16:08:35 -06:00
AGENTS.md Initial commit: Set up project structure with SolidJS frontend and Go backend 2026-01-21 11:17:55 -06:00
docker-compose.yml Init 2026-01-30 16:08:35 -06:00
Dockerfile Init 2026-01-30 16:08:35 -06:00
go.mod Init 2026-01-30 16:08:35 -06:00
go.sum Init 2026-01-30 16:08:35 -06:00
PROJECT_SKELETON_PROMPT.md Initial commit: Set up project structure with SolidJS frontend and Go backend 2026-01-21 11:17:55 -06:00
README.md Init 2026-01-30 16:08:35 -06:00
USER_STORIES.md Init 2026-01-30 16:08:35 -06:00

Scríobh

Scríobh is a minimal writing platform that mimics Write Freely. It features a set of themes, uses markdown for input, and is designed for simple writing needs.

Project Structure

Scríobh/
├── cmd/server/ 
│   ├── main.go          # Entry point & HTTP server
│   ├── package.json     # Frontend dependencies
│   ├── build.js         # esbuild bundler configuration
│   ├── src/             # SolidJS source code
│   │   ├── index.jsx    # Frontend entry point
│   │   └── App.jsx      # Main App component
│   └── static/          # Build output + index.html
│       └── index.html   # HTML template with bootstrap injection
├── internal/ 
│   ├── db/              # Database layer (SQLite + Migrations)
│   │   └── db.go
│   ├── models/          # Domain models
│   └── auth/            # Authentication logic
├── go.mod               # Go dependencies
├── Dockerfile           # Multi-stage build (Node -> Go -> Alpine)
├── docker-compose.yml   # Local development & deployment
└── .dockerignore        # Docker ignore rules

Requirements

  • Go 1.23+ (for local development)
  • Node.js 20+ (for building the frontend)
  • Docker & Docker Compose (for containerized deployment)

Getting Started

Local Development

  1. Install Frontend Dependencies:

    cd cmd/server
    npm install
    
  2. Build the Frontend:

    npm run build
    

    Or use npm run watch for automatic rebuilding.

  3. Run the Backend:

    go mod tidy
    go mod vendor
    go run cmd/server/main.go
    

Docker Deployment

To build and run the entire stack using Docker:

docker-compose up --build

The application will be available at http://localhost:8080.

Usage Guide

Writing Posts

  1. Register/Login: Create an account to start writing.
  2. Create a Blog: From the dashboard, create a new blog with a custom name and URL slug.
  3. New Post: Click "New Post" on your blog card.
  4. Editor:
    • The editor is distraction-free and supports Markdown.
    • YAML Frontmatter: Use --- at the top of your post to define metadata.
      ---
      title: My First Post
      description: A brief summary
      ---
      
    • Publish: Click "Publish" to save your post. It will be publicly accessible via your blog's URL.

Managing Content

  • Dashboard: View all your blogs and create new ones.
  • Edit/Delete: Navigate to your blog's public page while logged in to see "Edit" and "Delete" controls for your posts.
  • Discovery: Visit /discovery to see all public blogs on the platform.
  • Search: Visit /search to search through public posts by title or content.

Technical Details

  • Backend: Go with chi router and modernc.org/sqlite (CGO-free).
  • Frontend: SolidJS bundled with esbuild.
  • Markdown: Uses marked for rendering and js-yaml for frontmatter.
  • Data Injection: Server-side bootstrap data injection via window.__BOOTSTRAP_DATA__.
  • Database: SQLite with a custom migration system in internal/db/db.go.
  • Logging: Structured logging using Go's slog package.

Engineering Principles

This project follows strict engineering principles to ensure it is production-ready and maintainable:

  • Production-Ready Code: Idiomatic Go and JavaScript with comprehensive error handling.
  • No External Dependencies at Runtime: No external API calls or internet-dependent services.
  • Minimal Dependencies: Dependencies are kept to a minimum. Go modules should be vendored (go mod vendor).
  • Documentation: Comprehensive inline documentation for all major components.
  • Graceful Shutdown: Implements proper signal handling and context cancellation for clean exits.
  • Structured Logging: Uses slog for consistent, machine-readable logs.
  • Security Best Practices: Includes input validation, prepared statements for SQL, and secure header management.
  • Self-Contained: The frontend is embedded into the Go binary using go:embed.
  • Testing: Unit tests are required for all core functionality to ensure reliability and prevent regressions.
  • Testing: Unit tests are required for all core functionality to ensure reliability and prevent regressions.