A fully configurable & customizable Remix PWA stack.

Overview

Remix RockSpec Stack

The Remix RockSpec Stack

Learn more about Remix Stacks.

npx create-remix --template ShafSpecs/rockspec-stack

What's in the stack

Not a fan of bits of the stack? Want to improve it? Fork it, change it, and create a PR!

Getting Started

  • Buckle your seatbelts and get ready to get blown by Remix!

Development

  • Create a .env file and copy the content from the .env.example file, delete the .env.example file afterwards.

  • Provision the database and connect it to the app using the DATABASE_URL environment variable.

Skip if you're using Fly Postgres database (more info below).

If you don't have Postgres database already, you could quickly provision one for free using Railway.

  • Set up Prisma and connect it to the database:

    npm run prisma
  • Generate VAPID Keys for the Push API subscription service:

    npm run push-keys

    Store the Public key in the VAPID_PUBLIC_KEY and the private key in the VAPID_PRIVATE_KEY environment variable.

  • Start dev server:

    npm run dev

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

Relevant code:

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

For more info on building a powerful Progressive Web App, checkout remix-pwa

Deployment

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 rockspec-stack-template
    fly create rockspec-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 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 rockspec-stack-template
    fly secrets set SESSION_SECRET=$(openssl rand -hex 32) --app rockspec-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 'rockspec-stack-template-staging' does not match app name in config file 'rockspec-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.

  • Add VAPID_PUBLIC_KEY and VAPID_PRIVATE_KEY environment variables to your fly secrets too:

    fly secrets set VAPID_PRIVATE_KEY=<VAPID_PRIVATE_KEY> --app rockspec-stack-template
    fly secrets set VAPID_PRIVATE_KEY=<VAPID_PRIVATE_KEY> --app rockspec-stack-template-staging
    
    fly secrets set VAPID_PUBLIC_KEY=<VAPID_PUBLIC_KEY> --app rockspec-stack-template
    fly secrets set VAPID_PUBLIC_KEY=<VAPID_PULIC_KEY> --app rockspec-stack-template-staging

    Set your DATABASE_URL this way too if you aren't using the Fly Postgres database

  • Create a persistent volume for the postgresql database for both your staging and production environments (skip if you already set one up!). Run the following:

    # Skip this part if you already have a non-Fly PostgreSQL database.
    fly postgres create --name blues-stack-template-db
    fly postgres attach --postgres-app rockspec-stack-template-db --app blues-stack-template
    
    fly postgres create --name blues-stack-template-staging-db
    fly postgres attach --postgres-app rockspec-stack-template-staging-db --app blues-stack-template-stagin

    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!

Getting Help with Deployment

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.

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.

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.

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.

You might also like...

Remix indie-stack walkaround

Remix indie-stack walkaround

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

Mar 20, 2022

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

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

Remix Supa Fly Stack Learn more about Remix Stacks. npx create-remix --template rphlmr/supa-fly-stack What's in the stack Fly app deployment with Doc

Jan 7, 2023

Remix Blues Stack

Remix Blues Stack

Remix Blues Stack Learn more about Remix Stacks. npx create-remix --template remix-run/blues-stack What's in the stack Multi-region Fly app deploymen

Mar 18, 2022

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

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

Jan 2, 2023

Remix Blues Stack - Community discussions web app

Remix Blues Stack - Community discussions web app

Remix Blues Stack - Community discussions web app

Jul 16, 2022

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

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

Dec 30, 2022

Clone of a certain microblogging site. Based on Remix Indie Stack.

Clone of a certain microblogging site. Based on Remix Indie Stack.

Microblog No guarantees that any of this works. I'm new at this and experimenting. Built on top of Remix's Indie Stack. Database query organisation mi

Nov 18, 2022

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

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

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

Jan 2, 2023

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

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

Dec 13, 2022
Comments
  • chore: remove lockfile

    chore: remove lockfile

    For more info, see https://github.com/remix-run/remix/pull/3110.

    You should probably also implement something similar in remix.init for only ignoring these files in the repo but not when the project is created like we did in https://github.com/remix-run/indie-stack/pull/79, https://github.com/remix-run/blues-stack/pull/67 & https://github.com/remix-run/grunge-stack/pull/53.

    enhancement 
    opened by MichaelDeBoey 0
  • chore: minor enhancements

    chore: minor enhancements

    • add docker-compose for Postgres for a better local development experience, and add a script for the same
    • sort npm scripts in package.json for a better development experience
    • add remix.init script which will be called by the Remix CLI on creating the project which can be used to generate a unique Fly app name and copy .env.example to .env. One less hurdle to get started! 😅
    enhancement 
    opened by Girish21 0
  • chore: Remove build file from git and minor enhancements

    chore: Remove build file from git and minor enhancements

    • public/entry.worker.js seems to be built during the build step, thus can be safely removed and added to .gitignore so it never gets committed to a repository
    • mark Remix versions as * in package.json so that the Remix CLI can swap them out for the latest Remix version
    • minor: commit the modified tsconfig generated by Remix CLI
    opened by Girish21 0
Owner
Abdur-Rahman
....learning something new everyday, one step at a time.
Abdur-Rahman
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
A lightweight, standalone package to integrate full PWA features into Remix 💿

Remix PWA PWA integration & support for Remix Remix PWA is a lightweight, standalone npm package that adds full Progressive Web App support to Remix ?

Abdur-Rahman 220 Jan 3, 2023
This is a full-stack exercise tracker web application built using the MERN (MongoDB, ExpressJS, ReactJS, NodeJS) stack. You can easily track your exercises with this Full-Stack Web Application.

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

WMouton 2 Dec 25, 2021
BVSelect-VanillaJS - BVSelect - Vanilla Javascript Fully Customizable SelectBox

BVSelect - Vanilla JS Replaces native select elements with fully customizable dropdowns. Demo: https://bmsvieira.github.io/BVSelect-VanillaJS/ Feature

Bruno Vieira 107 Dec 26, 2022
LogTure - A minimal designed, fully customizable, and extensible modern personal blogging framework, built with Nextjs.

LogTure - A minimal designed, fully customizable, and extensible modern personal blogging framework, built with Nextjs.

Sam Zhang 14 Aug 26, 2022
The Remix version of the fakebooks app demonstrated on https://remix.run. Check out the CRA version: https://github.com/kentcdodds/fakebooks-cra

Remix Fakebooks App This is a (very) simple implementation of the fakebooks mock app demonstrated on remix.run. There is no database, but there is an

Kent C. Dodds 61 Dec 22, 2022
Remix enables you to build fantastic user experiences for the web and feel happy with the code that got you there. In this workshop, we'll look at some more advanced use cases when building Remix applications.

?? Advanced Remix Workshop Remix enables you to build fantastic user experiences for the web and feel happy with the code that got you there. In this

Frontend Masters 167 Dec 9, 2022
Remix enables you to build fantastic user experiences for the web and feel happy with the code that got you there. Get a jumpstart on Remix with this workshop.

?? Remix Fundamentals Build Better websites with Remix Remix enables you to build fantastic user experiences for the web and feel happy with the code

Frontend Masters 204 Dec 25, 2022
simple-remix-blog is a blog template built using Remix and TailwindCSS. Create your own blog in just a few minutes!

simple-remix-blog is a blog template built using remix.run and TailwindCSS. It supports markdown and MDX for the blog posts. You can clone it and star

José Miguel Álvarez Vañó 8 Dec 8, 2022
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