Learn more about Remix Stacks.
npx create-remix@latest --template inshore/eight-bit
- AWS deployment with Architect
- Styling with Tailwind
- ChtGPT with [OpneAI] (https://platform.openai.com)
- End-to-end testing with Cypress
- Linting with ESLint
- Static Types with TypeScript
Not a fan of bits of the stack? Fork it, change it, and use npx create-remix --template your/repo
! Make it your own.
-
Init Arc so that you can then run dev:
npx arc inti
-
Add you https://platform.openai.com api key to the .en after copying the example.
cp env.exampl .env vi .env
-
Start dev server:
npm run dev
This starts your app in development mode, rebuilding assets on file changes.
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
andAWS_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 anARC_APP_SECRET
for Arc itself.npx arc env --add --env staging ARC_APP_SECRET $(openssl rand -hex 32) npx arc env --add --env staging PROMPT_MODE "development" npx arc env --add --env production OPEN_AI_API_SECRET_KEY $(openssl rand -hex 32) npx arc env --add --env staging OPENAPI-API-KEY [YOUR API KEY] npx arc env --add --env production ARC_APP_SECRET $(openssl rand -hex 32) npx arc env --add --env production PROMPT_MODE "live" npx arc env --add --env production OPEN_AI_API_SECRET_KEY [YOUR API KEY]
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.
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 GrungeCf7cStaging and GrungeCf7cProduction) that matches what's in app.arc
, you can find all of your app's resources under the "Resources" tab.
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.
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:
//
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
.
This project uses ESLint for linting. That is configured in .eslintrc.js
.