• Stars
    star
    434
  • Rank 100,274 (Top 2 %)
  • Language
    TypeScript
  • License
    MIT License
  • Created almost 3 years ago
  • Updated about 2 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

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

Remix Grunge Stack

The Remix Grunge Stack

Learn more about Remix Stacks.

npx create-remix@latest --template remix-run/grunge-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.

Quickstart

Click this button to create a Gitpod workspace with the project set up

Gitpod Ready-to-Code

Development

  • First run this stack's remix.init script and commit the changes it makes to your project.

    npx remix init
    git init # if you haven't already
    git add .
    git commit -m "Initialize project"
  • Validate the app has been set up properly (optional):

    npm run validate
  • 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 app with Architect and Remix. The main functionality is creating users, logging in and out, and creating and deleting notes.

The database that comes with arc sandbox is an in memory database, so if you restart the server, you'll lose your data. The Staging and Production environments won't behave this way, instead they'll persist the data in DynamoDB between deployments and Lambda executions.

Deployment

This Remix Stack comes with two GitHub Actions that handle automatically deploying your app to production and staging environments. By default, Arc will deploy to the us-west-2 region, if you wish to deploy to a different region, you'll need to change your app.arc

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

  • Create a new GitHub repo

  • Sign up and login to your AWS account

  • Add AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY to your GitHub repo's secrets. Go to your AWS security credentials and click on the "Access keys" tab, and then click "Create New Access Key", then you can copy those and add them to your repo's secrets.

  • Install the AWS CLI.

  • Create an AWS credentials file.

  • Along with your AWS credentials, you'll also need to give your CloudFormation a SESSION_SECRET variable of its own for both staging and production environments, as well as an ARC_APP_SECRET for Arc itself.

    npx arc env --add --env staging ARC_APP_SECRET $(openssl rand -hex 32)
    npx arc env --add --env staging SESSION_SECRET $(openssl rand -hex 32)
    npx arc env --add --env production ARC_APP_SECRET $(openssl rand -hex 32)
    npx arc env --add --env production SESSION_SECRET $(openssl rand -hex 32)

    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.

Where do I find my CloudFormation?

You can find the CloudFormation template that Architect generated for you in the sam.yaml file.

To find it on AWS, you can search for CloudFormation (make sure you're looking at the correct region!) and find the name of your stack (the name is a PascalCased version of what you have in app.arc, so by default it's RemixGrungeStackStaging and RemixGrungeStackProduction) that matches what's in app.arc, you can find all of your app's resources under the "Resources" tab.

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

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.

More Repositories

1

react-router

Declarative routing for React
TypeScript
53,037
star
2

remix

Build Better Websites. Create modern, resilient user experiences with web fundamentals.
TypeScript
29,808
star
3

history

Manage session history with JavaScript
JavaScript
8,292
star
4

indie-stack

The Remix Stack for deploying to Fly with SQLite, authentication, testing, linting, formatting, etc.
TypeScript
1,104
star
5

examples

A community-driven repository showcasing examples using Remix πŸ’Ώ
TypeScript
1,055
star
6

blues-stack

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

remix-website

TypeScript
325
star
8

example-trellix

A partial trello board clone with Remix
TypeScript
283
star
9

remix-jokes

TypeScript
197
star
10

react-router-website

The React Router website
TypeScript
148
star
11

starter-express

Starter project for using Remix with Express
TypeScript
111
star
12

example-movies

Data loading demo in Remix
JavaScript
76
star
13

starter-vercel

Remix Starter for Vercel
TypeScript
51
star
14

advanced-remix-2023

TypeScript
49
star
15

remix-discord-bot

TypeScript
40
star
16

remix-webpack-demo

TypeScript
37
star
17

starter-architect

Remix Starter for Architect (AWS CloudFormation with arc.codes)
TypeScript
24
star
18

meetup-guides

A collection of guides for Remix meetup organizers
14
star
19

release-comment-action

A GitHub Action to automatically comment on Pull Requests and related issues about a release. Used by Remix and React Router.
TypeScript
11
star
20

v1-compat-utils

Packages that enable v1 APIs in Remix v2 to enable easier upgrades.
TypeScript
11
star
21

remix-replit-template

replit
TypeScript
6
star
22

jamstack-conf-workshop

TypeScript
4
star
23

changelog-github

TypeScript
3
star
24

react-router-api-docs

HTML
2
star