Welcome to the Deno template for Remix! 🦕
For more, check out the Remix docs.
npx create-remix@latest --template denoRead about how we recommend to manage dependencies for Remix projects using Deno.
-
✅ You should use
npmto install NPM packagesnpm install react
import { useState } from 'react'
-
✅ You may use inlined URL imports or deps.ts for Deno modules.
import { copy } from 'https://deno.land/std@0.138.0/streams/conversion.ts'
-
❌ Do not use import maps.
From your terminal:
npm run devThis starts your app in development mode, rebuilding assets on file changes.
This template provides type hinting to VS Code via a dedicated import map.
To get types in another editor, use an extension for Deno that supports import
maps and point your editor to ./.vscode/resolve_npm_imports.json.
For more, see our decision doc for interop between Deno and NPM.
First, build your app for production:
npm run buildThen run the app in production mode:
npm startBuilding the Deno app (npm run build) results in two outputs:
build/(server bundle)public/build/(browser bundle)
You can deploy these bundles to any host that runs Deno, but here we'll focus on deploying to Deno Deploy.
Deploy Classic projects are not transferred automatically. To configure this app on the current Deno Deploy platform:
- Sign in at console.deno.com and create an organization.
- Create a new app and connect the
senar-ai/webGitHub repository. Grant the Deno Deploy GitHub app access to the repository if it is not listed. - Keep the app directory at the repository root. Build configuration is read
from
deno.json: dependencies are installed withnpm ci, the app is built withnpm run build, andbuild/index.jsis run as a dynamic app. The GitHub integration builds pushes and preview branches; no push deployment workflow is required. - If the Classic app uses environment variables, recreate each one in the new app settings and assign it to the appropriate Production, Development, and/or Build contexts. This app currently requires none for its build or runtime.
- If the Classic app uses a custom domain, add it to the new app, configure the
_acme-challengeCNAME shown by the dashboard, then update the domain's CNAME/ANAME. Allow up to 48 hours for propagation before removing it from Deploy Classic.
The app does not use Deno KV, queues, or application cron jobs, so no data or API migration is required for those services.
Normal production and preview deployments are handled by the GitHub integration. For a manual deployment, authenticate and select the new app once:
deno deploy switch
npm run deploydeno deploy prompts for browser authentication and stores its token in the
system keyring. For non-interactive use, provide DENO_DEPLOY_TOKEN instead.
Never commit a deploy token.
The app fetches its public directory data during each build. The
Scheduled Deploy workflow preserves the existing daily refresh at 09:00 UTC
while push deployments are handled by Deno Deploy itself. Configure these
GitHub Actions settings after creating the app:
- Repository secret
DENO_DEPLOY_TOKEN: a token accepted bydeno deploy - Repository variable
DENO_DEPLOY_ORG: the new organization slug - Repository variable
DENO_DEPLOY_APP: the new app slug
The workflow can also be run manually from the Actions tab.
This project uses SVG sprites with FontAwesome icons through a custom <Icon /> component system.
- Search FontAwesome Icons
- Include the icons in the senarai icon kit. (please ask @zainfathoni to do it for you)
- Upload the new SVG sprites to the
/public/images/directory - Use the
<Icon />component and pass the icon set and id as props
Component Location: app/components/icon.tsx
import { Icon } from '~/components/icon'
<Icon
set="solid" // "solid" | "light" | "duotone"
id="chevron-right" // FontAwesome icon name
className="h-6 w-6" // Standard SVG props
/>- Sprite Files: Located in
/public/images/(solid.svg, light.svg, duotone.svg) - Implementation: Uses SVG
<use>element to reference sprite symbols - Styling: Icons inherit color via
fill="currentColor" - Performance: All icons in a set load as single HTTP request
Learn more about this Prisma schema file in the docs: https://pris.ly/d/prisma-schema
Commands to know:
npx prisma generate- update TypeScript definitions based on this schemanpx prisma db push- push the schema changes to the databasenpx prisma studio- open the Studio, which allows you to edit the schema.npx prisma migrate reset- reset the migrations to the last version. This will reset the DB and run the seed scriptnpx prisma migrate dev --name <descriptive-name>- generate a migration file for any changes you make to the schema (this will be committed).
Learn more about Planetscale CLI in the docs: https://docs.planetscale.com/reference/planetscale-cli
Commands to know:
pscale connect <DATABASE_NAME> <BRANCH_NAME> --port 3309- create a secure connection to a database branch for a local clientpscale database dump <DATABASE_NAME> <BRANCH_NAME> --output prisma/dumps/xx- backup and dump the specified database
Thanks goes to these wonderful people (emoji key):
Zain Fathoni 💻 📖 🎨 🚇 🚧 🔧 |
This project follows the all-contributors specification. Contributions of any kind welcome!