Updated 23 November 2026
You can run a template with email and password accounts, an admin area and its own database by following the steps below.
Which templates have features
bookshop, immigration-counsel, restaurant-stock-dashboard, solar-installation, tattoo-studio, vet-practice-dashboard and yacht-brokerage. They have accounts, an admin area, their own database and pages such as bookings, orders, member portals or dashboards. No template in version 1.0.0 uses a payment processor.
First run
- Copy the settings file with
cp .env.example .env. - Fill in
.envusing the list below. - Install the packages with
npm install. - Create the tables with
npm run db:migrate. - Add sample records with
npm run db:seed. This step is optional. - Start the site with
npm run dev.
Settings in .env
DATABASE_URLis the database address. See the next section.DATABASE_TOKENis the token for Turso. Leave it out for the other databases.SITE_URLis the public address of the site. It is used in the links inside emails.SITE_HOSTSlists other addresses of the site, separated by commas.AUTH_SECRETis a random string of at least 32 characters. Create one withopenssl rand -base64 32.ADMIN_EMAILandADMIN_PASSWORDare the first admin account.MAIL_PROVIDER,MAIL_FROM,RESEND_API_KEYandSMTP_URLset up email. See Email.IP_HEADERis the header that carries the visitor's IP address, used for rate limits. Usex-forwarded-for. Behind Cloudflare, usecf-connecting-ip.FILES_DIRis the folder for uploads.STORAGE_QUOTA_BYTESis the storage limit.
Choose a database
The same code runs on all three.
- SQLite is the default:
DATABASE_URL=file:./data/site.db. - Turso:
DATABASE_URL=libsql://…with yourDATABASE_TOKEN. - PostgreSQL:
DATABASE_URL=postgres://user:password@host:5432/name.
Sign in as the first admin
There is no admin account until the first sign-in.
- Put your own email and a password of at least 10 characters in
ADMIN_EMAILandADMIN_PASSWORD. - Start the site and go to
/admin/sign-in. - Sign in with those values. This creates the account, verified, with the admin role.
- Change the password.
Visitors sign up at /account/sign-up and sign in at /account/sign-in.
Change the tables
- Edit
db/schema.ts. - Run
npm run db:generate. It writes new migrations for both databases, indb/migrations/sqliteanddb/migrations/postgres. - Run
npm run db:migrate.
Put it online
Feature templates run on a Node host. See Deploy a Node site.
