Skip to content

Project Templates

Coral provides templates to help you build new modules. All Coral modules follow the same architecture and conventions.

The fastest path is the official scaffolder:

Terminal window
pnpm create coral@latest
npm create coral@latest
bun create coral@latest

Or provide the module name up front:

Terminal window
pnpm create coral@latest my-module

The CLI pulls the latest template/, renames the module, and keeps the standard Coral TypeScript, Biome, and release automation setup intact. See create-coral CLI for the dedicated command reference.

The standard template for building a new Coral module with TanStack Start, React, Tailwind CSS, and Jellyfin integration.

Get started with the template

  • TanStack Start - React SSR framework
  • File-based routing - Simple route organization
  • Tailwind CSS v4 - Styling
  • TypeScript - Full type safety
  • Jellyfin API integration - Ready to connect
  • Docker - Container deployment
  • GitHub Actions - CI/CD workflows
  • Biome - Linting and formatting
  • pnpm - Package management

Recommended:

Terminal window
pnpm create coral@latest my-module
cd my-module

Manual fallback:

Terminal window
# Click "Use this template" on GitHub
# Or clone and customize
git clone https://github.com/Get-Coral/template.git my-module
cd my-module

If you used the CLI, this step is already handled for you.

If you cloned manually, replace coral-module throughout:

Terminal window
# In package.json
{
"name": "@get-coral/my-module"
}
# In .github/workflows/docker-publish.yml
IMAGE_NAME=ghcr.io/Get-Coral/my-module
# In README.md
# My Module
Terminal window
pnpm install

The template includes:

src/routes/
├── index.tsx # Home page
├── api/
│ └── example.ts # API endpoint
└── components/ # Reusable components

Add your pages and components following TanStack Start conventions.

.env
JELLYFIN_URL=http://your-server:8096
JELLYFIN_API_KEY=your-api-key
JELLYFIN_USER_ID=your-user-id

Or use local SQLite setup like other modules.

Terminal window
pnpm dev

Runs on http://localhost:3000

  • src/routes/ - Page components and API routes
  • src/components/ - Reusable UI components
  • src/lib/ - Utilities and helpers
  • src/integrations/ - External service integration
  • public/ - Static assets
  • .github/workflows/ - CI/CD pipelines
  • package.json - Dependencies
  • tsconfig.json - TypeScript config
  • biome.json - Linting rules
  • vite.config.ts - Build config
  • Dockerfile - Container image
  • .env.example - Environment template
Terminal window
pnpm dev # Start dev server
pnpm build # Build for production
pnpm preview # Preview production build
pnpm lint # Run linter
pnpm format # Format code
pnpm typecheck # Check types

TanStack Start provides:

  • File-based routing - Files in src/routes/ become routes
  • API routes - Create src/routes/api/ endpoints
  • Server functions - Call server code from client
  • React Server Components - Components that run on server

Import the client:

import { createClient, getLibraryItems } from '@get-coral/jellyfin'
const client = createClient({
url: process.env.JELLYFIN_URL,
apiKey: process.env.JELLYFIN_API_KEY,
userId: process.env.JELLYFIN_USER_ID
})
const items = await getLibraryItems(client, {
parentId: 'library-id'
})

The template includes Tailwind CSS v4 with:

  • Modern utility classes
  • Dark mode support
  • Responsive design
  • Custom configuration

Edit src/styles.css to customize colors and theme.

The template includes a Dockerfile for containerization:

Terminal window
# Build image
docker build -t my-module .
# Run container
docker run -p 3000:3000 \
-e JELLYFIN_URL=http://jellyfin:8096 \
-e JELLYFIN_API_KEY=key \
-e JELLYFIN_USER_ID=id \
my-module

The template includes workflows for:

  • Docker publish - Build and push to container registry
  • Release - Automated release management (with release-please)
  • Tests - Run tests on PR

Update .github/workflows/ for your module.

If creating a library like the Jellyfin client:

  1. Update package.json with public scope
  2. Configure npm publishing in workflows
  3. Create releases on GitHub
  4. Package is published to npm

For applications and modules:

  1. Configure container registry credentials
  2. Docker image is built and pushed on release
  3. Pull with docker pull image-name:version

For web applications:

  1. Connect GitHub repo to Vercel
  2. Set environment variables
  3. Automatic deployments on push

Reference existing modules:

  • Aurora - Full video client
  • Fathom - Reading interface
  • KAPOW - Complex real-time app
  • Update dependencies regularly: pnpm update
  • Monitor security advisories
  • Update Tailwind CSS v4
  • Update TanStack packages
Terminal window
pnpm add -u @tanstack/start
pnpm add -u @tanstack/router

Check release notes for breaking changes.

  1. Run pnpm create coral@latest
  2. Rename your module
  3. Build your feature
  4. Deploy and share
  5. Open a PR to list in Coral ecosystem

When ready to share:

  1. Push to GitHub
  2. Create releases with version tags
  3. Submit to ecosystem for listing

Happy building! 🚀