The Remix Stack for deploying to Fly with PostgreSQL, authentication, testing, linting, formatting, etc.

Overview

Remix Blues Stack

The Remix Blues Stack

Learn more about Remix Stacks.

npx create-remix --template remix-run/blues-stack

What's in the stack

Not a fan of bits of the stack? Fork it, change it, and use npx create-remix --template your/repo! Make it your own.

Development

  • Start the Postgres Database in Docker:

    npm run docker

    Note: The npm script will complete while Docker sets up the container in the background. Ensure that Docker has finished and your container is running before proceeding.

  • Initial setup:

    npm run setup
  • Run the first build:

    npm run build
  • Start dev server:

    npm run dev

This starts your app in development mode, rebuilding assets on file changes.

The database seed script creates a new user with some data you can use to get started:

If you'd prefer not to use Docker, you can also use Fly's Wireguard VPN to connect to a development database (or even your production database). You can find the instructions to set up Wireguard here, and the instructions for creating a development database here.

Relevant code:

This is a pretty simple note-taking app, but it's a good example of how you can build a full stack app with Prisma and Remix. The main functionality is creating users, logging in and out, and creating and deleting notes.

Deployment

This Remix Stack comes with two GitHub Actions that handle automatically deploying your app to production and staging environments.

Prior to your first deployment, you'll need to do a few things:

  • Install Fly

  • Sign up and log in to Fly

    fly auth signup

    Note: If you have more than one Fly account, ensure that you are signed into the same account in the Fly CLI as you are in the browser. In your terminal, run fly auth whoami and ensure the email matches the Fly account signed into the browser.

  • Create two apps on Fly, one for staging and one for production:

    fly create blues-stack-template
    fly create blues-stack-template-staging
  • Initialize Git.

    git init
  • Create a new GitHub Repository, and then add it as the remote for your project. Do not push your app yet!

    git remote add origin <ORIGIN_URL>
  • Add a FLY_API_TOKEN to your GitHub repo. To do this, go to your user settings on Fly and create a new token, then add it to your repo secrets with the name FLY_API_TOKEN.

  • Add a SESSION_SECRET to your fly app secrets, to do this you can run the following commands:

    fly secrets set SESSION_SECRET=$(openssl rand -hex 32) --app blues-stack-template
    fly secrets set SESSION_SECRET=$(openssl rand -hex 32) --app blues-stack-template-staging

    Note: When creating the staging secret, you may get a warning from the Fly CLI that looks like this:

    WARN app flag 'blues-stack-template-staging' does not match app name in config file 'blues-stack-template'
    

    This simply means that the current directory contains a config that references the production app we created in the first step. Ignore this warning and proceed to create the secret.

    If you don't have openssl installed, you can also use 1password to generate a random secret, just replace $(openssl rand -hex 32) with the generated secret.

  • Create a database for both your staging and production environments. Run the following:

    fly postgres create --name blues-stack-template-db
    fly postgres attach --postgres-app blues-stack-template-db --app blues-stack-template
    
    fly postgres create --name blues-stack-template-staging-db
    fly postgres attach --postgres-app blues-stack-template-staging-db --app blues-stack-template-staging

    Note: You'll get the same warning for the same reason when attaching the staging database that you did in the fly set secret step above. No worries. Proceed!

Fly will take care of setting the DATABASE_URL secret for you.

Now that every is set up you can commit and push your changes to your repo. Every commit to your main branch will trigger a deployment to your production environment, and every commit to your dev branch will trigger a deployment to your staging environment.

If you run into any issues deploying to Fly, make sure you've followed all of the steps above and if you have, then post as many details about your deployment (including your app name) to the Fly support community. They're normally pretty responsive over there and hopefully can help resolve any of your deployment issues and questions.

Multi-region deploys

Once you have your site and database running in a single region, you can add more regions by following Fly's Scaling and Multi-region PostgreSQL docs.

Make certain to set a PRIMARY_REGION environment variable for your app. You can use [env] config in the fly.toml to set that to the region you want to use as the primary region for both your app and database.

Testing your app in other regions

Install the ModHeader browser extension (or something similar) and use it to load your app with the header fly-prefer-region set to the region name you would like to test.

You can check the x-fly-region header on the response to know which region your request was handled by.

GitHub Actions

We use GitHub Actions for continuous integration and deployment. Anything that gets into the main branch will be deployed to production after running tests/build/etc. Anything in the dev branch will be deployed to staging.

Testing

Cypress

We use Cypress for our End-to-End tests in this project. You'll find those in the cypress directory. As you make changes, add to an existing file or create a new file in the cypress/e2e directory to test your changes.

We use @testing-library/cypress for selecting elements on the page semantically.

To run these tests in development, run npm run test:e2e:dev which will start the dev server for the app as well as the Cypress client. Make sure the database is running in docker as described above.

We have a utility for testing authenticated features without having to go through the login flow:

cy.login();
// you are now logged in as a new user

We also have a utility to auto-delete the user at the end of your test. Just make sure to add this in each test file:

afterEach(() => {
  cy.cleanupUser();
});

That way, we can keep your local db clean and keep your tests isolated from one another.

Vitest

For lower level tests of utilities and individual components, we use vitest. We have DOM-specific assertion helpers via @testing-library/jest-dom.

Type Checking

This project uses TypeScript. It's recommended to get TypeScript set up for your editor to get a really great in-editor experience with type checking and auto-complete. To run type checking across the whole project, run npm run typecheck.

Linting

This project uses ESLint for linting. That is configured in .eslintrc.js.

Formatting

We use Prettier for auto-formatting in this project. It's recommended to install an editor plugin (like the VSCode Prettier plugin) to get auto-formatting on save. There's also a npm run format script you can run to format all files in the project.

Comments
  • Multiple high severity vulnerabilities warnings while installing Remix Blues stack

    Multiple high severity vulnerabilities warnings while installing Remix Blues stack

    What version of Remix are you using?

    latest via npx create-remix

    Steps to Reproduce

    Run npx create-remix --template remix-run/blues-stack in console

    Expected Behavior

    No severe warnings

    Actual Behavior

    ➜  ~/Projects  npx create-remix --template remix-run/blues-stack
    Need to install the following packages:
      create-remix
    Ok to proceed? (y) y
    πŸ’Ώ Welcome to Remix! Let's get you set up with a new project.
    
    npm WARN deprecated [email protected]: This package has been deprecated and is no longer maintained. Please use @rollup/plugin-inject.
    ? Where would you like to create your app? ./my-project
    ? Do you want me to run `npm install`? Yes
    npm WARN deprecated [email protected]: See https://github.com/lydell/source-map-resolve#deprecated
    npm WARN deprecated [email protected]: This package has been deprecated and is no longer maintained. Please use @rollup/plugin-inject.
    npm WARN deprecated [email protected]: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
    npm WARN deprecated [email protected]: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
    
    > postinstall
    > remix setup node
    
    Successfully setup Remix for node.
    
    added 1212 packages, and audited 1213 packages in 53s
    
    230 packages are looking for funding
      run `npm fund` for details
    
    4 high severity vulnerabilities
    
    To address all issues (including breaking changes), run:
      npm audit fix --force
    
    Run `npm audit` for details.
    πŸ’Ώ Running remix.init script
    Setup is almost complete. Follow these steps to finish initialization:
    
    - Start the database:
      npm run docker
    
    - Run setup:
      npm run setup
    
    - You're now ready to rock and roll 🀘
      npm run dev
    πŸ’Ώ That's it! `cd` into "/Users/benjamin/Projects/my-project" and check the README for development and deploy instructions!
    ➜  ~/Projects  cd my-project
    ➜  ~/Projects/my-project  npm audit    
    # npm audit report
    
    trim-newlines  <3.0.1
    Severity: high
    Regular Expression Denial of Service in trim-newlines - https://github.com/advisories/GHSA-7p7h-4mm5-852v
    fix available via `npm audit fix --force`
    Will install @remix-run/[email protected], which is a breaking change
    node_modules/chalk-animation/node_modules/trim-newlines
      meow  3.4.0 - 5.0.0
      Depends on vulnerable versions of trim-newlines
      node_modules/chalk-animation/node_modules/meow
        chalk-animation  >=1.4.0
        Depends on vulnerable versions of meow
        node_modules/chalk-animation
          @remix-run/dev  <=0.0.0-experimental-fde68a7 || >=1.3.0-pre.1
          Depends on vulnerable versions of chalk-animation
          node_modules/@remix-run/dev
    
    4 high severity vulnerabilities
    
    To address all issues (including breaking changes), run:
      npm audit fix --force
    
    opened by binajmen 10
  • The service is no longer running immediately logged when `npm run dev`

    The service is no longer running immediately logged when `npm run dev`

    What version of Remix are you using?

    1.3.1

    Steps to Reproduce

    1. Create a new project using the blues stack.
    2. cd into the directory
    3. npm run docker
    4. npm run setup
    5. npm run dev

    Expected Behavior

    pm2 should launch the application and supporting watches with no errors displayed.

    Actual Behavior

    Eventually all applications succeed to launch, but Server fails the first time it is run with Error: The service is no longer running.

    After pm2 restarts Server it successfully runs on the second launch.

    ❯ npm run dev
    
    > dev
    > pm2-dev ./other/pm2.config.js
    
    ===============================================================================
    --- PM2 development mode ------------------------------------------------------
    Apps started         : Server,Server Build,Remix,Tailwind
    Processes started    : 4
    Watch and Restart    : Enabled
    Ignored folder       : node_modules
    ===============================================================================
    Server-0  | Debugger listening on ws://127.0.0.1:9229/9752a099-019e-4ec1-9379-ee5c5959b3f7
    Server-0  | For help, see: https://nodejs.org/en/docs/inspector
    Server Build-1  | > build:server
    Server Build-1  | > esbuild --platform=node --format=cjs ./server.ts --outdir=build "--watch"
    Server-0        | πŸ”Ά Mock server running
    Server Build-1  | [watch] build finished, watching for changes...
    Tailwind-3      | > generate:css
    Tailwind-3      | > tailwindcss -o ./app/styles/tailwind.css "--watch"
    Server-0        | /Users/furd/Code/blues-test/node_modules/esbuild/lib/main.js:658
    Server-0        |       return callback("The service is no longer running", null);
    Server-0        |              ^
    Server-0        | Error: The service is no longer running
    Server-0        |     at /Users/furd/Code/blues-test/node_modules/esbuild/lib/main.js:1375:29
    Server-0        |     at sendRequest (/Users/furd/Code/blues-test/node_modules/esbuild/lib/main.js:658:14)
    Server-0        |     at start (/Users/furd/Code/blues-test/node_modules/esbuild/lib/main.js:1373:9)
    Server-0        |     at Object.transform2 [as transform] (/Users/furd/Code/blues-test/node_modules/esbuild/lib/main.js:1430:5)
    Server-0        |     at /Users/furd/Code/blues-test/node_modules/esbuild/lib/main.js:2099:55
    Server-0        |     at new Promise (<anonymous>)
    Server-0        |     at Object.transform (/Users/furd/Code/blues-test/node_modules/esbuild/lib/main.js:2099:14)
    Server-0        |     at /Users/furd/Code/blues-test/node_modules/esbuild/lib/main.js:2253:65
    Server-0        |     at MessagePort.<anonymous> (/Users/furd/Code/blues-test/node_modules/esbuild/lib/main.js:2269:7)
    Server-0        |     at MessagePort.[nodejs.internal.kHybridDispatch] (node:internal/event_target:647:20)
    Server-0        | Debugger listening on ws://127.0.0.1:9229/5e82594d-c4cf-41d7-887d-83f1c2128eb1
    Server-0        | For help, see: https://nodejs.org/en/docs/inspector
    Remix-2         | Watching Remix app in development mode...
    Server-0        | πŸ”Ά Mock server running
    Tailwind-3      | Rebuilding...
    Remix-2         | πŸ’Ώ Built in 436ms
    Tailwind-3      | Done in 273ms.
    Server-0        | πŸ”Œ setting up prisma client to localhost:5432
    Server-0        | βœ… app ready: http://localhost:3000
    
    opened by zolrath 10
  • Some Tailwind classes were missing / were purged despite being in the JSX / HTML

    Some Tailwind classes were missing / were purged despite being in the JSX / HTML

    Have you experienced this bug with the latest version of the template?

    No, but the only changes to it are irrelevant (project created last week)

    Steps to Reproduce

    Present from the get-go.

    Expected Behavior

    I expected Tailwind UI to work out of the box.

    I pasted this page heading on the notes route, and expected it to look like this.

    image

    Actual Behavior

    A button was missing entirely, the image wasn't rounded, and other stuff. The classes that were present in the HTML didn't get included into the CSS bundle.

    I'm not sure, but I think that the problem might be related to a missing input file. I changed the command from tailwindcss -o ./app/styles/tailwind.css to tailwindcss -i ./app/input.css -o ./app/styles/tailwind.css, and created the input.css file:

    @tailwind base;
    @tailwind components;
    @tailwind utilities;
    

    and what do you know, it now looks like it should:

    image

    opened by k1sul1 8
  • User `postgres` was denied access on the database `postgres.public`

    User `postgres` was denied access on the database `postgres.public`

    Have you experienced this bug with the latest version of the template?

    Yes

    Steps to Reproduce

    Following the setup instructions in the readme:

    • npm run docker
    • wait for docker container to finish setting up
    • npm run setup

    Expected Behavior

    npm run setup completes successfully

    Actual Behavior

    npm run setup fails with the following error

    Error: P1010: User `postgres` was denied access on the database `postgres.public`
    

    Full terminal output:

    ~/Desktop/demoapp
    ❯ npm run docker
    
    > docker
    > docker-compose up -d
    
    Creating network "demoapp_default" with the default driver
    Creating demoapp_postgres_1 ... done
    
    ~/Desktop/demoapp
    ❯ npm run setup
    
    > setup
    > prisma migrate dev && prisma db seed
    
    Environment variables loaded from .env
    Prisma schema loaded from prisma/schema.prisma
    Datasource "db": PostgreSQL database "postgres", schema "public" at "localhost:5432"
    
    Error: P1010: User `postgres` was denied access on the database `postgres.public`
    
    opened by tconroy 8
  • Following session.flash guide causes all routes to log you out

    Following session.flash guide causes all routes to log you out

    Hello

    I was following along with the guide on setting up flash messages, however it seems when setting the header it wipes the user key in the session on every page load, which then causes you to be logged out.

    export const loader: LoaderFunction = async ({ request }) => {
      const session = await getSession(request);
      const message = session.get("globalMessage") || null;
    
      return json<LoaderData>(
        {
          user: await getUser(request),
          message: message,
        },
        {
          headers: {
            // this here
            "Set-Cookie": await commitSession(session),
          },
        }
      );
    };
    

    A demo repo here if you want to get started https://github.com/tbrasington/remix-flash-test/blob/6dd74dfbba3420d00d3ca3b98e92955b4fcdfb9c/app/root.tsx#L42

    opened by tbrasington 7
  • Build is failing on Github Actions.

    Build is failing on Github Actions.

    Have you experienced this bug with the latest version of the template?

    Yes

    Steps to Reproduce

    1. Push the code to dev branch.
    2. All the steps passes except the Build step.
    
    #8 [deps 2/3] ADD package.json package-lock.json .npmrc ./
    #8 ERROR: failed to calculate checksum of ref kne0msd6uexyjrhi1dqwby7iz::uk0c4v8ukx8dm5nuk4vhr6cr7: "/package-lock.json": not found
    
    #9 [build 2/6] COPY --from=deps /myapp/node_modules /myapp/node_modules
    #9 CACHED
    
    #10 [deps 3/3] RUN npm install --production=false
    #10 CACHED
    
    #11 [production-deps 3/4] ADD package.json package-lock.json .npmrc ./
    #11 ERROR: failed to calculate checksum of ref kne0msd6uexyjrhi1dqwby7iz::uk0c4v8ukx8dm5nuk4vhr6cr7: "/package-lock.json": not found
    
    #12 [base 2/2] RUN apt-get update && apt-get install -y openssl
    #12 CANCELED
    ------
     > [deps 2/3] ADD package.json package-lock.json .npmrc ./:
    ------
    ------
     > [production-deps 3/4] ADD package.json package-lock.json .npmrc ./:
    ------
    WARNING: local cache import at /tmp/.buildx-cache not found due to err: could not read /tmp/.buildx-cache/index.json: open /tmp/.buildx-cache/index.json: no such file or directory
    Dockerfile:15
    --------------------
      13 |     WORKDIR /myapp
      14 |     
      15 | >>> ADD package.json package-lock.json .npmrc ./
      16 |     RUN npm install --production=false
      17 |     
    --------------------
    ERROR: failed to solve: failed to compute cache key: failed to calculate checksum of ref kne0msd6uexyjrhi1dqwby7iz::uk0c4v8ukx8dm5nuk4vhr6cr7: "/package-lock.json": not found
    Error: buildx failed with: ERROR: failed to solve: failed to compute cache key: failed to calculate checksum of ref kne0msd6uexyjrhi1dqwby7iz::uk0c4v8ukx8dm5nuk4vhr6cr7: "/package-lock.json": not found
    
    

    Expected Behavior

    Expect the build to pass.

    Actual Behavior

    Build is failing.

    opened by vivekimsit 6
  • removed postgres volume

    removed postgres volume

    Was needed in order to resolve issue where npm run build was trying to access the postgres-data file, but can't due to permission issues. Don't think the volume is necessary

    opened by sys13 6
  • fix: remove `maxAge` from session cookie

    fix: remove `maxAge` from session cookie

    Setting maxAge: 0 will automatically expire the cookie as soon as it's sent. This should not be the default value. Otherwise, the developer will have to override this on every set-cookie header. Leaving it undefined ensures the cookie will live for the life of the browser session.

    opened by kiliman 4
  • hot reload doesn't work

    hot reload doesn't work

    Have you experienced this bug with the latest version of the template?

    Yes

    Steps to Reproduce

    npx create-remix@latest with blues stack (I chose typescript)

    no customizations, just hot reload doesn't work. I can see things rebuild but no updates in the browser.

    Expected Behavior

    The app rebuilds and the appropriate updates are displayed in the browser.

    Actual Behavior

    The app rebuilds but no changes in the browser

    opened by jrnxf 4
  • npm run dev constantly throws pm2 error on Windows Home machine

    npm run dev constantly throws pm2 error on Windows Home machine

    When I follow the instructions to setup the Blues Stack, npm run dev fails to ever start, and throws the error message which I have pasted below. It worked on my Macbook Pro, so I believe it is something related to Windows, potentially even specifically Windows Home.

    OS: Windows 10 Home OS build: 19043.1586 Version 21H1

    Reproduction steps:

    1. npx create-remix@latest
    2. Enter name-of-project
    3. Select pre-existing stack option
    4. Select Blues stack
    5. Select Y to npm install
    6. Wait for it to finish
    7. cd name-of-project
    8. npm run docker
    9. Open Docker Desktop and confirm it has finished starting up.
    10. npm run setup
    11. npm run build
    12. npm run dev
    $ npm run dev
    
    > dev
    > pm2-dev ./other/pm2.config.js
    
    [
      Error: Script not found: C:\Users\myname\Code\blues-stack-test\node --inspect --require .\node_modules\dotenv\config --require .\mocks .\build\server.js
          at Object.Common.resolveAppAttributes (C:\Users\myname\Code\blues-stack-test\node_modules\pm2\lib\Common.js:647:11)
          at C:\Users\myname\Code\blues-stack-test\node_modules\pm2\lib\API.js:1129:35
          at C:\Users\myname\Code\blues-stack-test\node_modules\async\internal\withoutIndex.js:8:40
          at replenish (C:\Users\myname\Code\blues-stack-test\node_modules\async\internal\eachOfLimit.js:81:17)
          at C:\Users\myname\Code\blues-stack-test\node_modules\async\internal\eachOfLimit.js:86:9
          at eachLimit (C:\Users\myname\Code\blues-stack-test\node_modules\async\eachLimit.js:47:43)
          at awaitable (C:\Users\myname\Code\blues-stack-test\node_modules\async\internal\awaitify.js:13:28)
          at startApps (C:\Users\myname\Code\blues-stack-test\node_modules\pm2\lib\API.js:1113:7)
          at C:\Users\myname\Code\blues-stack-test\node_modules\pm2\lib\API.js:1094:16
          at wrapper (C:\Users\myname\Code\blues-stack-test\node_modules\async\internal\once.js:12:16),
      Error: Script not found: C:\Users\myname\Code\blues-stack-test\npm run build:server -- --watch
          at Object.Common.resolveAppAttributes (C:\Users\myname\Code\blues-stack-test\node_modules\pm2\lib\Common.js:647:11)
          at C:\Users\myname\Code\blues-stack-test\node_modules\pm2\lib\API.js:1129:35
          at C:\Users\myname\Code\blues-stack-test\node_modules\async\internal\withoutIndex.js:8:40
          at replenish (C:\Users\myname\Code\blues-stack-test\node_modules\async\internal\eachOfLimit.js:81:17)
          at C:\Users\myname\Code\blues-stack-test\node_modules\async\internal\eachOfLimit.js:86:9
          at eachLimit (C:\Users\myname\Code\blues-stack-test\node_modules\async\eachLimit.js:47:43)
          at awaitable (C:\Users\myname\Code\blues-stack-test\node_modules\async\internal\awaitify.js:13:28)
          at startApps (C:\Users\myname\Code\blues-stack-test\node_modules\pm2\lib\API.js:1113:7)
          at C:\Users\myname\Code\blues-stack-test\node_modules\pm2\lib\API.js:1094:16
          at wrapper (C:\Users\myname\Code\blues-stack-test\node_modules\async\internal\once.js:12:16),
      Error: Script not found: C:\Users\myname\Code\blues-stack-test\cross-env NODE_ENV=development remix watch
          at Object.Common.resolveAppAttributes (C:\Users\myname\Code\blues-stack-test\node_modules\pm2\lib\Common.js:647:11)
          at C:\Users\myname\Code\blues-stack-test\node_modules\pm2\lib\API.js:1129:35
          at C:\Users\myname\Code\blues-stack-test\node_modules\async\internal\withoutIndex.js:8:40
          at replenish (C:\Users\myname\Code\blues-stack-test\node_modules\async\internal\eachOfLimit.js:81:17)
          at C:\Users\myname\Code\blues-stack-test\node_modules\async\internal\eachOfLimit.js:86:9
          at eachLimit (C:\Users\myname\Code\blues-stack-test\node_modules\async\eachLimit.js:47:43)
          at awaitable (C:\Users\myname\Code\blues-stack-test\node_modules\async\internal\awaitify.js:13:28)
          at startApps (C:\Users\myname\Code\blues-stack-test\node_modules\pm2\lib\API.js:1113:7)
          at C:\Users\myname\Code\blues-stack-test\node_modules\pm2\lib\API.js:1094:16
          at wrapper (C:\Users\myname\Code\blues-stack-test\node_modules\async\internal\once.js:12:16),
      Error: Script not found: C:\Users\myname\Code\blues-stack-test\npm run generate:css -- --watch
          at Object.Common.resolveAppAttributes (C:\Users\myname\Code\blues-stack-test\node_modules\pm2\lib\Common.js:647:11)
          at C:\Users\myname\Code\blues-stack-test\node_modules\pm2\lib\API.js:1129:35
          at C:\Users\myname\Code\blues-stack-test\node_modules\async\internal\withoutIndex.js:8:40
          at replenish (C:\Users\myname\Code\blues-stack-test\node_modules\async\internal\eachOfLimit.js:81:17)
          at C:\Users\myname\Code\blues-stack-test\node_modules\async\internal\eachOfLimit.js:86:9
          at eachLimit (C:\Users\myname\Code\blues-stack-test\node_modules\async\eachLimit.js:47:43)
          at awaitable (C:\Users\myname\Code\blues-stack-test\node_modules\async\internal\awaitify.js:13:28)
          at startApps (C:\Users\myname\Code\blues-stack-test\node_modules\pm2\lib\API.js:1113:7)
          at C:\Users\myname\Code\blues-stack-test\node_modules\pm2\lib\API.js:1094:16
          at wrapper (C:\Users\myname\Code\blues-stack-test\node_modules\async\internal\once.js:12:16)
    ]
    
    opened by jakexconniff 4
  • Issue with tests scanning postgres-data directory

    Issue with tests scanning postgres-data directory

    I had issues running rootless Docker in WSL2. Running postgress with user=root, postgres-data folder is created with root access, and npm run setup fails.

    ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Unhandled Error ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
    Error: EACCES: permission denied, scandir '/src/β–ˆβ–ˆβ–ˆβ–ˆβ–ˆ/postgres-data/'
        at Object.readdirSync (node:fs:1392:3)
        at Object.readdir (/src/β–ˆβ–ˆβ–ˆβ–ˆβ–ˆ/node_modules/recrawl-sync/lib/fs.js:6:25)
        at crawl (/src/β–ˆβ–ˆβ–ˆβ–ˆβ–ˆ/node_modules/recrawl-sync/lib/recrawl.js:46:35)
        at crawl (/src/β–ˆβ–ˆβ–ˆβ–ˆβ–ˆ/node_modules/recrawl-sync/lib/recrawl.js:67:25)
        at /src/β–ˆβ–ˆβ–ˆβ–ˆβ–ˆ/node_modules/recrawl-sync/lib/recrawl.js:85:9
        at exports.crawl (/src/β–ˆβ–ˆβ–ˆβ–ˆβ–ˆ/node_modules/recrawl-sync/lib/recrawl.js:15:51)
        at findProjects (/src/β–ˆβ–ˆβ–ˆβ–ˆβ–ˆ/node_modules/vite-tsconfig-paths/dist/index.js:210:35)
        at Object.configResolved (/src/β–ˆβ–ˆβ–ˆβ–ˆβ–ˆ/node_modules/vite-tsconfig-paths/dist/index.js:68:24)
        at /src/β–ˆβ–ˆβ–ˆβ–ˆβ–ˆ/node_modules/vite/dist/node/chunks/dep-9c153816.js:71056:127
        at Array.map (<anonymous>) {
      errno: -13,
      syscall: 'scandir',
      code: 'EACCES',
      path: '/src/β–ˆβ–ˆβ–ˆβ–ˆβ–ˆ/postgres-data/'
    }
    

    I solved it with this patch:

    diff --git a/package.json b/package.json
    index 3472d91..6332ca9 100644
    --- a/package.json
    +++ b/package.json
    @@ -30,7 +30,8 @@
       "eslintIgnore": [
         "/node_modules",
         "/build",
    -    "/public/build"
    +    "/public/build",
    +    "/postgres-data"
       ],
       "dependencies": {
         "@node-rs/bcrypt": "^1.6.0",
    diff --git a/vitest.config.ts b/vitest.config.ts
    index de07a32..5fa4c92 100644
    --- a/vitest.config.ts
    +++ b/vitest.config.ts
    @@ -6,10 +6,19 @@ import react from "@vitejs/plugin-react";
     import tsconfigPaths from "vite-tsconfig-paths";
     
     export default defineConfig({
    -  plugins: [react(), tsconfigPaths()],
    +  plugins: [react(), tsconfigPaths({ projects: ["tsconfig.json"] })],
       test: {
         globals: true,
         environment: "happy-dom",
         setupFiles: ["./test/setup-test-env.ts"],
    +    exclude: [
    +      "node_modules",
    +      "dist",
    +      ".idea",
    +      ".git",
    +      ".cache",
    +      "build",
    +      "postgres-data",
    +    ],
       },
     });
    
    

    I didn't solve issues with Cypress in WSL2, but I probably will not use Cypress.

    opened by Tymek 4
  • Deployment failing due to seed not working

    Deployment failing due to seed not working

    Have you experienced this bug with the latest version of the template?

    Yes

    Steps to Reproduce

    Running the CI/CD pipeline through github actions or the fly deploy and then I get error that results in failure of deployment.

    Expected Behavior

    Deployment works and seeding succeeds

    Actual Behavior

    2022-12-29T09:58:59Z app[63b7991f] sea [info]Running seed command `ts-node --require tsconfig-paths/register prisma/seed.ts` ...
    2022-12-29T09:58:59Z app[63b7991f] sea [info]An error occurred while running the seed command:
    2022-12-29T09:58:59Z app[63b7991f] sea [info]Error: Command failed with ENOENT: ts-node --require tsconfig-paths/register prisma/seed.ts
    2022-12-29T09:58:59Z app[63b7991f] sea [info]spawn ts-node ENOENT
    

    Looks like as the "prisma.seed" in the package.json and using ts-node while the Dockerfile in production image doesn't have ts-node so it just fails. I couldn't find where the prisma seed is being invoked from either in docker file or elsewhere so not sure what needs to be moved where.

    opened by zabirauf 2
  • Missing License

    Missing License

    Have you experienced this bug with the latest version of the template?

    yes

    Steps to Reproduce

    Check the repo and all surrounding information. This code has no license.

    Expected Behavior

    There should be a license, otherwise all of this code is automatically "all rights reserved" under US law, as far as I'm aware.

    Actual Behavior

    This code is unlicensed and inappropriate for anyone to use.

    opened by coder543 1
  • Make email unique constraint case insensitive

    Make email unique constraint case insensitive

    Fixes #140 by making the user.email column citext instead of text.

    Now, unlike before, if you try and sign up with [email protected] after signing up with [email protected], you will be correctly informed that a user with that email already exists.

    opened by Glazy 2
  • Email is case sensitive

    Email is case sensitive

    Have you experienced this bug with the latest version of the template?

    Yes

    Steps to Reproduce

    1. Pull down template.
    2. Run npm run setup, npm run build, npm run dev.
    3. Sign up with [email protected] and then sign out.
    4. Sign up with [email protected].

    Expected Behavior

    The email should be treat as case insensitive so it can only be used to sign up once, regardless of capitalisation.

    Actual Behavior

    You can sign up many time with the same address - all of the following are treat as separate addresses:

    [email protected]
    [email protected]
    [email protected]
    [email protected]
    ...
    
    opened by Glazy 0
  • "fly apps create" not working correctly anymore

    Have you experienced this bug with the latest version of the template?

    yes

    Steps to Reproduce

    • Follow the steps in the readme.
    • "fly apps create [...]" not working correctly.

    It creates an an app on fly.io but without an ip address. The created app has a orange wrench symbol. The app missing configurations.

    Expected Behavior

    Following the readme should lead you to have a running app.

    Actual Behavior

    Follow the readme will not working anymore, because fly.io app (remix) will not have an IP Address.

    opened by marko-x 2
  • Remix blues stack problem when npm run docker

    Remix blues stack problem when npm run docker

    What version of Remix are you using?

    1.7.3

    Steps to Reproduce

    1. follow startup instructions and install blues stack
    2. npm run docker

    Expected Behavior

    should start docker

    Actual Behavior

    sh: docker-compose: command not found

    needs-response 
    opened by natehardy 2
The Remix Stack for deploying to Fly with SQLite, authentication, testing, linting, formatting, etc.

Remix Indie Stack Learn more about Remix Stacks. npx create-remix --template remix-run/indie-stack What's in the stack Fly app deployment with Docker

Remix 688 Dec 30, 2022
The Remix Blog Stack for deploying to Fly with MDX, SQLite, testing, linting, formatting, etc.

Remix Speed Metal Stack Learn more about Remix Stacks. npx create-remix --template Girish21/speed-metal-stack Remix Blog ?? This blog starter template

Girish 141 Jan 2, 2023
The Remix Stack for deploying to AWS with DynamoDB, authentication, testing, linting, formatting, etc.

The Remix Stack for deploying to AWS with DynamoDB, authentication, testing, linting, formatting, etc.

Remix 311 Jan 1, 2023
Remix Stack for deploying to Vercel with remix-auth, Planetscale, Radix UI, TailwindCSS, formatting, linting etc. Written in Typescript.

Remix Synthwave Stack Learn more about Remix Stacks. npx create-remix --template ilangorajagopal/synthwave-stack What's in the stack Vercel deploymen

Ilango 56 Dec 25, 2022
The Remix Stack for Web2 apps and Web3 DApps with authentication with Magic, testing, linting, formatting, etc.

Remix French House Stack Learn more about Remix Stacks. npx create-remix --template janhesters/french-house-stack What's in the Stack? The French Hou

Jan Hesters 26 Dec 26, 2022
The Remix Stack for deploying to Vercel with testing, linting, formatting, structure and mock for 3rd party API integration.

Remix DnB Stack See it live: https://dnb-stack.vercel.app/ Learn more about Remix Stacks. npx create-remix --template robipop22/dnb-stack What's in th

Robert Pop 61 Dec 13, 2022
A testing focused Remix Stack, that integrates E2E & Unit testing with Playwright, Vitest, MSW and Testing Library. Driven by Prisma ORM. Deploys to Fly.io

Live Demo Β· Twitter A testing focused Remix Stack, that integrates E2E & Unit testing with Playwright, Vitest, MSW and Testing Library. Driven by Pris

Remix Stacks 18 Oct 31, 2022
An Open Source Remix template that integrates Stripe Subscriptions, Social Authentication, Testing and a few more features. PostgreSQL version. Deploys to Fly.io

Live Demo Β· Twitter An open source Remix Stack that integrates Stripe Subscriptions, Social Authentication, Testing and a few more features. PostgreSQ

xo 25 Dec 7, 2022
The Remix Stack with Clerk authentication, Supabase database, Chakra UI, testing, linting, and more.

Remix Bossa Nova Stack Learn more about Remix Stacks. What's in the stack User management with Clerk Database with Supabase Styling with Chakra UI Dep

Clerk 32 Jan 2, 2023
An Open Source Remix template that integrates Stripe Subscriptions, Social Authentication, Testing and a few more features. SQLite version. Deploys to Fly.io

Live Demo Β· Twitter An Open Source Remix template that integrates Stripe Subscriptions, Social Authentication, Testing and a few more features. SQLite

xo 135 Dec 31, 2022
Remix TypeScript monorepo with Turborepo pipelines, Prisma, PostgreSQL, Docker deploy to Fly.io, pnpm, TailwindCSS and Tsyringe for DI.

Remix template with Turborepo, TypeScript and pnpm. The remix app deploys to fly.io or build to Docker image. Example packages for Database with prisma, Tsyringe dependency injection, UI, and internal TypeScript packages.

Philippe L'ATTENTION 33 Dec 29, 2022
Visual Studio Code extension for formatting and linting Django/Jinja HTML templates using djLint

Visual Studio Code extension for formatting and linting Django/Jinja HTML templates using djLint

Almaz 25 Dec 15, 2022
A string of four operations of the library, can solve the js digital calculation accuracy of scientific notation and formatting problems, support for thousands of decimal point formatting output operations

A string of four operations of the library, can solve the js digital calculation accuracy of scientific notation and formatting problems, support for thousands of decimal point formatting output operations

null 10 Apr 6, 2022
Tiny JavaScript library (1kB) by CurrencyRate.today, providing simple way and advanced number, money and currency formatting and removes all formatting/cruft and returns the raw float value.

Zero dependency tiny JavaScript library (1kB bytes) by CurrencyRate.today, providing simple way and advanced number, money and currency formatting and removes all formatting/cruft and returns the raw float value.

Yurii De 11 Nov 8, 2022
Grupprojekt fΓΆr kurserna 'Javascript med Ramverk' och 'Agil Utveckling'

JavaScript-med-Ramverk-Laboration-3 Grupprojektet fΓΆr kurserna Javascript med Ramverk och Agil Utveckling. Utvecklingsguide FΓΆr information om hur utv

Svante Jonsson IT-HΓΆgskolan 3 May 18, 2022
Hemsida fΓΆr personer i Sverige som kan och vill erbjuda boende till mΓ€nniskor pΓ₯ flykt

Getting Started with Create React App This project was bootstrapped with Create React App. Available Scripts In the project directory, you can run: np

null 4 May 3, 2022
Kurs-repo fΓΆr kursen Webbserver och Databaser

Webbserver och databaser This repository is meant for CME students to access exercises and codealongs that happen throughout the course. I hope you wi

null 14 Jan 3, 2023
Custom Remix stack using Clerk for authentication and full user management.

New Wave Stack Learn more about Remix Stacks. For more on our thoughts on the New Wave Stack check out our blog post. To view this template in deploym

Charles Wefso 11 Oct 11, 2022
Remix+EdgeDB+Tailwind+Fly.io=πŸ–€

Remix Chop Suey Stack Forked from Supa Fly Stack. Learn more about Remix Stacks. Quickstart npx create-remix --template jkcorrea/remix-chop-suey-stack

Jake Correa 56 Dec 22, 2022