Grazie! is a themeable, standalone, and general purpose publishing platform built with React Router 7, Prisma, Mantine, and an SQLite database. Grazie's theme and routing system allow overriding features by placing them in the /site folder (see site docs). Use Grazie! as it comes or extend it with your own themes and features.
Grazie! supports SQLite. To setup the database:
- Set .env
DATABASE_URLvariable:DATABASE_URL="file:../data/data.db"
Use of the /data folder for SQLite databases is optional, but recommended. If the /data folder is used for other purposes, internally, the name will be configurable, so you can obfuscate the folder name if you wish.
- DATABASE_URL - The database connection string or path to the SQLite database file, relative to the
/prismafolder. Default is in the/datafolder. - AWS_ACCESS_KEY_ID - AWS access key ID
- AWS_SECRET_ACCESS_KEY - AWS secret access key
- AWS_DEFAULT_REGION - AWS default region
- AWS_S3_BUCKET - AWS S3 bucket name
- S3_PROVIDER - "linode" or "aws"
- MAIL_NO_REPLY - Email address to use for the "no reply" email address
- MAIL_SUPPORT - Email address to use for support emails
- SMTP_HOST - SMTP host
- SMTP_PORT - SMTP port
- SMTP_USER - SMTP user
- SMTP_PASSWORD - SMTP password
- SMTP_SECURE - SMTP secure ("true"/"false")
- SESSION_NAME - Session name for the cookie
- SESSION_DOMAIN - Session domain for the cookie
- SESSION_SECURE - Session secure for the cookie ("true"/"false")
- SESSION_SECRET - Session secret for the cookie
- SESSION_TTL - Session TTL in seconds
- ADMINS - Comma separated list of email addresses to auto assign as admins
git clone https://github.com/daviddyess/grazie.gitcp .env.default .envDATABASE_URLwill put your database in the/datafolder by default.AWS_andS3_variables are required for image uploads - tested on Linode, but should work with AWSMAIL_andSMTP_variables are required for performing user password resets.- Update
SESSION_variables as appropriate, most importantly theSESSION_SECRET ADMINScan be a comma separated list of email addresses to automatically assign the admin role upon account registration
npm installnpx prisma migrate deploynpx prisma generatenpm run buildnpm startOpen your browser to http://localhost:3000
Backup a copy of your database. Follow the installation instructions above, starting with npm install.
There are 3 parts of the configuration:
.env- Environment variablesgrazie.config.js- Application configuration- Settings in the application, found in the Admin Dashboard
See the Environment Variables section for more information on the .env file.
The grazie.config.ts file is used to configure the application. Copy the grazie.config.default.ts file and name it grazie.config.ts.
cp grazie.config.default.ts grazie.config.tsThe default configuration is:
import { Theme } from 'app/theme';
export { Theme } from 'app/theme';
// Default page name - string
export const pageName = 'Page';
// Theme Object
export const theme = Theme.theme;
// Site Settings
export const site = {
name: 'Grazie!',
slogan: 'Powered by Grazie!',
description: 'My Grazie! Site',
copyright: 2024,
owner: 'David Dyess II',
separator: ' | ',
url: 'http://localhost:3000'
};
// Site Links
export const siteLinks = [];
// SEO Settings
export const metaSettings = {
home: {
title: 'Home'
}
};
// Page components
export const Pages = {
root: 'Page',
dashboard: 'Dashboard'
};To override the default favicon, import an image file from the /site folder and use it as the href attribute in the exported siteLinks array.
import favicon from '/site/favicon.png';
// rest of grazie.config.ts
// Site Links
export const siteLinks = [
{
rel: 'icon',
type: 'image/png',
href: favicon
}
];The Settings section in the Admin dashboard can be used to configure the site settings and override the grazie.config.ts settings. The settings are stored in the database and cached at runtime or as they are updated.
If a setting is not found in the database, the grazie.config.ts settings are used as a fallback. If a setting is not found in the grazie.config.ts settings, a default value is used. If only the grazie.config.default.ts file is present, that file will be used instead of the preferred config file. To avoid conflicts in the future, it is recommended to never edit the default config file.
From your terminal:
npm run devIf you prefer not to use vite dev, you can run a development variation of the production server with a watcher:
npm run dThis starts your app in development mode, rebuilding assets on file changes.
Replace "setup" below with a name for the migration:
npx prisma migrate dev --name setupnpx prisma migrate dev --create-onlynpx prisma migrate devnpx prisma migrate deploynpx prisma generateIf you're familiar with deploying Node applications, the built-in app server is production-ready.
Make sure to deploy the output of npm run build
├── package.json
├── package-lock.json (or pnpm-lock.yaml, or bun.lockb)
├── build/
│ ├── client/ # Static assets
│ └── server/ # Server-side code
Grazie! comes with Mantine.