Skip to content
This repository was archived by the owner on Jul 25, 2024. It is now read-only.

nlynzaad/remix-mikroorm

Repository files navigation

Remixing Mikro-orm

This is a bare-bones test project to implement mikro-orm and Remix (vite plugin).

This generally just works the only real quirk is the requirement by the CLI, to include the file extension for ESM projects.

Given that remix uses vite and hence the project is bundled with esbuild the requirement for file extensions does not really make sense.

Using tsx instead of ts-node resolves all the pain points, so I have added an extra script in package.json to call the mikro-orm esm cli tool via tsx instead of the default ts-node usage. There is talk of possibly replacing ts-node in future releases of mikro-orm discussion.

This test is now feature complete as it answers all the questions I had in implementing this stack.

NOTE: I'm making this public in the hope it can assist someone that wants to do a similar stack. No support can and will be given on this.

Getting started

  1. run the following to install all your dependencies
npm install
  1. run to following to create the first migration
npm run mikro-orm migration:create
  1. run the following to create the database and apply the migration
npm run mikro-orm migration:up

Development

Run the dev server:

npm run dev

Deployment

First, build your app for production:

npm run build

Then run the app in production mode:

npm start

Now you'll need to pick a host to deploy it to.

DIY

If you're familiar with deploying Node applications, the built-in Remix app server is production-ready.

Make sure to deploy the output of npm run build

  • build/server
  • build/client

Styling

This template comes with Tailwind CSS already configured for a simple default starting experience. You can use whatever css framework you prefer. See the Vite docs on css for more information.

About

This is a bare-bones test project to implement mikro-orm and Remix (vite plugin).

Topics

Resources

Stars

Watchers

Forks