Project Templates
Creating a New Coral Module
Section titled “Creating a New Coral Module”Coral provides templates to help you build new modules. All Coral modules follow the same architecture and conventions.
Recommended: use the CLI
Section titled “Recommended: use the CLI”The fastest path is the official scaffolder:
pnpm create coral@latestnpm create coral@latestbun create coral@latestOr provide the module name up front:
pnpm create coral@latest my-moduleThe 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.
Template Repositories
Section titled “Template Repositories”Coral Module Template
Section titled “Coral Module Template”The standard template for building a new Coral module with TanStack Start, React, Tailwind CSS, and Jellyfin integration.
What’s Included
Section titled “What’s Included”- 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
Creating Your Module
Section titled “Creating Your Module”1. Scaffold from the Template
Section titled “1. Scaffold from the Template”Recommended:
pnpm create coral@latest my-modulecd my-moduleManual fallback:
# Click "Use this template" on GitHub# Or clone and customizegit clone https://github.com/Get-Coral/template.git my-modulecd my-module2. Rename Your Module
Section titled “2. Rename Your Module”If you used the CLI, this step is already handled for you.
If you cloned manually, replace coral-module throughout:
# In package.json{ "name": "@get-coral/my-module"}
# In .github/workflows/docker-publish.ymlIMAGE_NAME=ghcr.io/Get-Coral/my-module
# In README.md# My Module3. Set Up Dependencies
Section titled “3. Set Up Dependencies”pnpm install4. Create Your App
Section titled “4. Create Your App”The template includes:
src/routes/├── index.tsx # Home page├── api/│ └── example.ts # API endpoint└── components/ # Reusable componentsAdd your pages and components following TanStack Start conventions.
5. Configure Jellyfin Connection
Section titled “5. Configure Jellyfin Connection”JELLYFIN_URL=http://your-server:8096JELLYFIN_API_KEY=your-api-keyJELLYFIN_USER_ID=your-user-idOr use local SQLite setup like other modules.
6. Test Locally
Section titled “6. Test Locally”pnpm devRuns on http://localhost:3000
Module Structure
Section titled “Module Structure”Key Directories
Section titled “Key Directories”src/routes/- Page components and API routessrc/components/- Reusable UI componentssrc/lib/- Utilities and helperssrc/integrations/- External service integrationpublic/- Static assets.github/workflows/- CI/CD pipelines
Configuration Files
Section titled “Configuration Files”package.json- Dependenciestsconfig.json- TypeScript configbiome.json- Linting rulesvite.config.ts- Build configDockerfile- Container image.env.example- Environment template
Development Workflows
Section titled “Development Workflows”Local Development
Section titled “Local Development”pnpm dev # Start dev serverpnpm build # Build for productionpnpm preview # Preview production buildpnpm lint # Run linterpnpm format # Format codepnpm typecheck # Check typesUsing TanStack Start
Section titled “Using TanStack Start”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
Building with Jellyfin
Section titled “Building with Jellyfin”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'})Styling with Tailwind
Section titled “Styling with Tailwind”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.
Docker Deployment
Section titled “Docker Deployment”The template includes a Dockerfile for containerization:
# Build imagedocker build -t my-module .
# Run containerdocker run -p 3000:3000 \ -e JELLYFIN_URL=http://jellyfin:8096 \ -e JELLYFIN_API_KEY=key \ -e JELLYFIN_USER_ID=id \ my-moduleGitHub Actions
Section titled “GitHub Actions”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.
Publishing
Section titled “Publishing”npm (for libraries)
Section titled “npm (for libraries)”If creating a library like the Jellyfin client:
- Update
package.jsonwith public scope - Configure npm publishing in workflows
- Create releases on GitHub
- Package is published to npm
Docker Registry
Section titled “Docker Registry”For applications and modules:
- Configure container registry credentials
- Docker image is built and pushed on release
- Pull with
docker pull image-name:version
Vercel (optional)
Section titled “Vercel (optional)”For web applications:
- Connect GitHub repo to Vercel
- Set environment variables
- Automatic deployments on push
Example Implementations
Section titled “Example Implementations”Reference existing modules:
Maintenance
Section titled “Maintenance”Keeping Up
Section titled “Keeping Up”- Update dependencies regularly:
pnpm update - Monitor security advisories
- Update Tailwind CSS v4
- Update TanStack packages
Upgrading TanStack Start
Section titled “Upgrading TanStack Start”pnpm add -u @tanstack/startpnpm add -u @tanstack/routerCheck release notes for breaking changes.
Getting Help
Section titled “Getting Help”- Refer to TanStack Start docs
- Check Tailwind CSS v4 docs
- Open a GitHub Discussion
- Join Jellyfin community
Next Steps
Section titled “Next Steps”- Run
pnpm create coral@latest - Rename your module
- Build your feature
- Deploy and share
- Open a PR to list in Coral ecosystem
Submit to Coral
Section titled “Submit to Coral”When ready to share:
- Push to GitHub
- Create releases with version tags
- Submit to ecosystem for listing
Happy building! 🚀