To run Storyden locally via the repository, it's pretty easy! You can use this approach for testing, experimenting and contributing.
For full development and contribution documentation, please visit the GitHub repository.
To run Storyden locally, you need to have the following installed:
- Go - the API is written in Go!
- Node.js - the frontend is built with Next.js
- pnpm - the package manager for the frontend
- Task - task runner for code generation and development workflows
If anything is missing from this list, please open an issue!
First, clone the repository:
git clone https://github.com/Southclaws/storyden.git
cd storydenFrom inside the Storyden directory, you can run the API service:
go run ./cmd/backendThis will start the API server with default configuration. You'll get:
./data/data.dbSQLite database./data/assetsto store assets (avatars, images, files, etc.)- A local server running at
http://localhost:8000 - OpenAPI documentation at
http://localhost:8000/api/docs - CORS and cookie rules configured to support localhost
You can also run the frontend service:
cd web
pnpm
pnpm devThe frontend will be available at http://localhost:3000 and will by default automatically connect to the API at http://localhost:8000.
# Run all Go tests
go test ./...
# Run specific test package
go test ./tests/thread/...
# Run tests with verbose output
go test -v ./...
# Run end-to-end tests - automatically boots fresh backend and frontend on ports 8001/3001 then shuts them down after the tests finish
task test:e2eStoryden uses heavy code generation. After modifying schemas or API specs, run:
# Regenerate everything
task generate
# Or manually:
# Generate database bindings
task generate:db
# Generate OpenAPI code (backend + frontend + docs)
task generate:openapi# Seed database with test data
go run ./cmd/seed
# Clean database
go run ./cmd/cleanNote: Storyden automatically handles database migrations on startup, so you don't need to run migrations manually.
cd web
# Install dependencies
pnpm install
# Start development server
pnpm dev
# Build for production
pnpm build
# Lint code
pnpm lint
# Type check
pnpm tsc --noEmit
# Regenerate API client from OpenAPI spec
pnpm openapiCreate a .env file in the root directory for custom configuration:
# Database
DATABASE_URL=sqlite://data/data.db
# Server
LISTEN_ADDR=0.0.0.0:8000
PUBLIC_WEB_ADDRESS=http://localhost:3000
PUBLIC_API_ADDRESS=http://localhost:8000
# Log Level
LOG_LEVEL=debug
LOG_FORMAT=dev
# Development helpers
DEV_CHAOS_SLOW_MODE=0s
DEV_CHAOS_FAIL_RATE=0For a full list of configuration options, see ./internal/config/config.yaml.
If port 8000 or 3000 is already in use:
# Change backend port
LISTEN_ADDR=0.0.0.0:8080 go run ./cmd/backend
# Change frontend port
cd web
PORT=3001 pnpm devIf you change ports or need to run on different addresses, make sure to update the address configuration:
PUBLIC_WEB_ADDRESS=http://localhost:3001 \
PUBLIC_API_ADDRESS=http://localhost:8080 \
LISTEN_ADDR=0.0.0.0:8080 \
go run ./cmd/backendThese environment variables control CORS and cookie settings. See ./internal/config/config.yaml for all available configuration options.
If you encounter database issues, you can reset it:
rm -rf ./data/data.db
go run ./cmd/backend # Will create fresh database
go run ./cmd/seed # Optional: add test dataIf you see errors about missing generated files, regenerate the code:
task generateThe OpenAPI documentation is available at:
- Local:
http://localhost:8000/api/docs - Interactive testing via Scalar UI
You can also use tools like:
- Postman - import from
api/openapi.yaml - curl - for quick testing
- httpie - for human-friendly HTTP requests
The frontend has built-in hot reload with Next.js when running pnpm dev.
- Official Documentation
- GitHub Repository
- API Reference (when running locally)
- Community
If you encounter issues:
- Check the documentation
- Search existing issues
- Open a new issue with details about your environment and the problem