Project Templates¶
The plugin ships 16 project templates that scaffold production-shaped ReScript apps — not just “Hello World”. Each template is a working, buildable project with modern tooling (pnpm/npm/yarn support, ESM, Vite+ where applicable, GitHub Actions CI) and documentation that answers the common day-two question: “How do I add the next thing?”
Opening the Wizard¶
File → New → Project… in IntelliJ IDEA
Select ReScript from the list on the left
Pick a template and a package manager
Click Create
You can also launch npm create rescript@latest from the terminal to get the same set of templates without the IDE.
Category: Basic¶
Minimal ReScript + Node.js starter with Args (argv parsing) and Files (node:fs/promises) modules. Useful as the smallest working reference for a non-browser ReScript project.
Node.js
Split-module library (Index, ListUtils, Fetcher) with per-module Vitest suites and fetchWithTimeout (AbortController). Publish-ready to npm via pnpm publish.
Node.js Testing
Subcommand dispatcher (greet, init) with its own Args parser and a Commands/ directory. Demonstrates how to grow a CLI without a heavyweight framework.
Node.js
Category: Frontend¶
Single-page React app using Vite+ with a form, useState, and a fetch('/api/greet') round-trip (offline fallback included). Includes src/Api.res as a reusable fetch wrapper.
Vite+ pre-1.0
App router with a Server Component (app/page.tsx), a Client Component (app/client/GreetForm.tsx), and a Route Handler (app/api/greet/route.ts). ReScript components are exposed via genType.
genType
Desktop app with preload.cjs + contextBridge + ipcMain.handle. src/Electron.res binds the exposed electronAPI so renderer-process ReScript code can query system info.
Desktop
Expo-managed app with an interactive todo list (useState + TextInput + Button + FlatList). src/ReactNative.res wraps the core RN component set. Extend the bindings to add more.
Mobile
Bare-workflow React Native template aimed at Android Studio / Xcode users. Ships only the JS/TS + ReScript surface plus a metro.config.js that resolves .res.mjs; native projects are produced by @react-native-community/cli after creation.
Mobile Bare workflow
Category: Backend¶
Hono + Drizzle (SQLite) + Zod + @hono/zod-openapi with Scalar UI at /docs. Ships a complete users CRUD (src/Routes/Users.res), migrations via drizzle-kit, and an /openapi.json spec.
REST OpenAPI SQLite
Hono hosting graphql-yoga at /graphql with GraphiQL built in. SDL lives in src/schema.graphql, resolvers in src/Resolvers/Users.res, storage in Drizzle. Run pnpm docs:graphql for human-readable docs.
GraphQL SQLite
Category: Serverless¶
wrangler.jsonc + a KV-backed greetings endpoint (POST/GET) using the GREETINGS binding. src/Kv.res binds the KV API so you can extend to Durable Objects or R2.
Edge
API Gateway-friendly handler with POST /orders (JSON body) and GET /orders/:id (path param). README includes a DynamoDB recipe using @aws-sdk/lib-dynamodb.
Serverless
Containerized Hono service with PORT env reading, a POST /echo route, and a Dockerfile. README includes a Cloud SQL recipe via @google-cloud/cloud-sql-connector.
Containers
Category: Full-Stack¶
pnpm/npm/yarn workspaces with packages/shared, packages/server (Hono + Drizzle), packages/client (Vite+/React). Types flow from @<project>/shared into both sides via the workspace protocol.
Workspaces Shared types
Single-package alternative to Monorepo: one package.json, src/{shared,server,client}, Hono + Drizzle backend, Vite+/React client, concurrently for dev, Vite+ proxy for /api/*.
Single package Shared types
Server-driven web app built with rescript-x (JSX rendered on the server) and HTMX for client-side interactivity. Ships a Counter with hx-post increment/decrement endpoints and a Todo form that validates input through zod or sury. Runs on Bun + Vite.
Bun required HTMX Server-driven
Which Template Should I Choose?¶
Situation |
Template |
|---|---|
I’m new to ReScript and just want to try it |
Basic |
I’m writing a reusable npm package |
npm Library |
I’m building a CLI tool |
CLI Tool |
I need a React SPA |
Vite+ + React |
I need SSR / Server Components / SEO |
Next.js |
I’m building a desktop app |
Electron |
I’m building a mobile app |
React Native |
I need a REST API with typed docs |
Hono (REST) |
I need a GraphQL API |
Hono + GraphQL |
I’m deploying to Cloudflare’s edge |
Cloudflare Workers |
I’m deploying to AWS Lambda |
AWS Lambda |
I’m deploying a container to GCP |
Google Cloud Run |
I want multiple packages sharing types (scales to more) |
Monorepo |
I want one package with backend + frontend (simpler) |
Full-Stack |
I want server-rendered HTML with HTMX on Bun |
res-x (HTMX on Bun) |
Tip
Each row above links to a per-template detail page covering generated layout, dependencies, key files, npm scripts, and day-two extension pointers. Use the toctree at the bottom of the page (or the “Project Templates” section in the left sidebar) to jump straight to one.
Day-Two Recipes¶
When you need to extend a generated project, these recipes pick up where the template README leaves off:
Add a Hono endpoint — adding routes, validation, and shared types
Add a GraphQL resolver — expanding the schema and regenerating docs
Set up Drizzle — schema changes, migrations, and Turso
Add OpenAPI docs — wiring Scalar UI and Zod schemas
Notes on Vite+¶
The Vite+ based templates (Vite+ + React, Monorepo client, Full-Stack) pin vite-plus and @voidzero-dev/vite-plus-core at pre-1.0 versions. If a command breaks after an upgrade, replace vite-plus with vite in vite.config.mjs and swap the vp scripts for vite to fall back to classic Vite.