Code Monkey home page Code Monkey logo

vite-remix's Introduction

Remix + Vite Template

๐Ÿ“– See the Remix docs and the Remix Vite docs for details on supported features.

This template is similar to the Blues Stack, written at a time when that stack didn't support Vite yet.

What's in the Stack

First-Time Setup

  • Copy .env.sample to .env and update it as needed.
  • You'll need a Postgres server running somewhere for development and unit tests. For convenience, you can use the one provided by Docker Compose in this repo:
    docker-compose up -d db
    Otherwise, update .env and .env.test as needed to change your database URLs.

Much of the code here just illustrates how to use the various tools in the template. You'll probably want to delete most of it! In particular, refer to Prisma's guide on getting starting for an example of how to create your own database schema and initial migration.

Development

Run the Vite dev server:

npm run dev

Test

npm test

Database Access in Tests

The tests have access to Postgres, so you don't need to mock Prisma. Each test suite receives its own database on the Postgres server, with as many databases as there are test workers in the pool. The databases are migrated one time at the beginning of test execution. Tables are cleared out after each test.

This means you can run multiple suites in parallel, as Vitest does by default. You may not be able to run tests concurrently within a single suite, though.

The convenience of using Postgres in your tests comes with some overhead. If your tests are running slowly, set VERBOSE_TEST_HARNESS=true in .env.test to see some extra logging output to check whether Postgres setup and teardown is slowing them down more than you'd like.

vite-remix's People

Contributors

klanchman avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.