A community-driven repository showcasing examples using Remix 💿

Overview

Remix Examples

Welcome to @remix-run/examples!

If you have an example you'd like to share, please submit a pull request!

This is a community-driven repository.. Here you'll find various examples of using Remix to accomplish certain tasks. Each example is a complete application including a build and even a button to preview a live instance of the app so you can play with it.

Also, remember to check out the README for each example before getting started.

You can also initialize a new project with any of these examples using the --template flag of the create-remix CLI. For example:

npx create-remix@latest --template https://github.com/remix-run/examples/tree/main/<example-dir>

Enjoy!

Contributing

Thanks for your willingness to contribute an example to Remix. Examples are incredibly helpful to people like you who are trying to figure out how to use Remix to solve certain problems and integrate with other tools.

What makes a good example is focus. There's certainly room for examples that show off a whole app experience and we do have some examples like that. But the vast majority of useful examples are focused on a specific use-case. Otherwise it's hard for people to know what to look for in the code.

This means you should avoid adding stuff that isn't absolutely necessary for the example. Start with bare bones and add only what you need.

Most examples should:

  • Not use a database
  • Have no more than one or two routes (some may not even need any routes)
  • Have only necessary deps
  • Not use complex validation
  • Be as practical as reasonable (balanced with the focus). Just, no foo/bar please.

To create an example, simply copy/paste the _template directory into a new one with a sensible name, make the changes you need for your example, update the README.md and open a PR.

Comments
  • Followed Remix / Stitches Example and getting FOUC

    Followed Remix / Stitches Example and getting FOUC

    What version of Remix are you using?

    1.1.3

    Steps to Reproduce

    Visit https://california-custom-tile.netlify.app/ and notice shift of logo due to FOUC. I applied example project found here and am unable to resolve the flash of unstyled content. I originally followed this tutorial as it was the only writing I could find at the time tying Stitches and Remix together.

    Here's all the relevant changes I made following the example.

    Expected Behavior

    Logo should NOT shift from left side to center from a flash of unstyled content (FOUC). Logo should be centered on load

    Actual Behavior

    Logo shifts from left side to right because of FOUC.

    needs-response 
    opened by coreybruyere 17
  • chore: update examples to be in line with templates

    chore: update examples to be in line with templates

    @chaance You last updated the chakra-ui example, so you have some experience with emotion. Could you maybe look into the emotion example as well?

    @helderberto Since you're the original creator of the emotion & stitches examples, we would like to have your help as well.

    ~@kumard3 If you have time to update the styled-components example, we would like to welcome a PR for that.~

    ~@sergiocarneiro If you could help us updating the styletron example, that would be awesome as well.~


    @chaance @machour @mcansh If this PR is too big to review, I'm happy to chop this into a separate PR for each example.

    opened by MichaelDeBoey 9
  • Official Getting Started blog-tutorial not able to seed new Post – is this a bug?

    Official Getting Started blog-tutorial not able to seed new Post – is this a bug?

    I am following this tutorial, and everything was going well until I tried to seed the new Post model using npx prisma db seed: https://remix.run/docs/en/v1/tutorials/blog

    I have added

    model Post {
      slug     String @id
      title    String
      markdown String
    
      createdAt DateTime @default(now())
      updatedAt DateTime @updatedAt
    }
    
    

    to prisma/schema.prisma, but it will not allow me to seed the new model to the schema. I have tried restarting VSCode, and deleting node_modules and rerunning npm install, but typescript is always unable to compile.

    % npx prisma db push      
    Environment variables loaded from .env
    Prisma schema loaded from prisma/schema.prisma
    Datasource "db": SQLite database "data.db" at "file:./data.db?connection_limit=1"
    
    The database is already in sync with the Prisma schema.
    
    ✔ Generated Prisma Client (4.3.1 | library) to ./node_modules/@prisma/client in 58ms`
    
    `% npx prisma db seed
    Environment variables loaded from .env
    Running seed command `ts-node --require tsconfig-paths/register prisma/seed.ts` ...
    ../blog-tutorial/node_modules/ts-node/src/index.ts:859
        return new TSError(diagnosticText, diagnosticCodes, diagnostics);
               ^
    TSError: ⨯ Unable to compile TypeScript:
    prisma/seed.ts:81:18 - error TS2339: Property 'post' does not exist on type 'PrismaClient<PrismaClientOptions, never, RejectOnNotFound | RejectPerOperation | undefined>'.
    
    81     await prisma.post.upsert({
                        ~~~~
    
        at createTSError (/blog-tutorial/node_modules/ts-node/src/index.ts:859:12)
        at reportTSError (/blog-tutorial/node_modules/ts-node/src/index.ts:863:19)
        at getOutput (/blog-tutorial/node_modules/ts-node/src/index.ts:1077:36)
        at Object.compile (/blog-tutorial/node_modules/ts-node/src/index.ts:1433:41)
        at Module.m._compile (/blog-tutorial/node_modules/ts-node/src/index.ts:1617:30)
        at Module._extensions..js (node:internal/modules/cjs/loader:1180:10)
        at Object.require.extensions.<computed> [as .ts] (/blog-tutorial/node_modules/ts-node/src/index.ts:1621:12)
        at Module.load (node:internal/modules/cjs/loader:1004:32)
        at Function.Module._load (node:internal/modules/cjs/loader:839:12)
        at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12) {
      diagnosticCodes: [ 2339 ]
    }
    
    An error occured while running the seed command:
    Error: Command failed with exit code 1: ts-node --require tsconfig-paths/register prisma/seed.ts`
    

    I am using Node v16.17.0and NPM v8.15.0.

    I am stuck here, any ideas? Thanks

    opened by twobyte 6
  • feat(firebase): add Google Account auth

    feat(firebase): add Google Account auth

    Reopening https://github.com/remix-run/remix/pull/4057 against remix-run/examples

    Firebase example - Integration with Google Sign-in Provider

    Closes: "sign-in with Google" suggestion at https://github.com/remix-run/remix/pull/1811#issuecomment-1050238130

    Adds a "Login with Google" link:

    Screenshot 2022-08-24 at 15 16 57

    ...that takes a user to the Google's auth screen:

    Screenshot 2022-08-24 at 15 17 22

     ...and then creates an account (if it doesn't yet exist) and signs them in:

    Screenshot 2022-08-24 at 15 19 26
    needs-response 
    opened by penx 6
  • Typecheck fails on blog-tutorial example

    Typecheck fails on blog-tutorial example

    When I run typechecking or have my editor open, the following errors are shown by typescript, even on a fresh clone of the example:

    > typecheck
    > tsc -b && tsc -b cypress
    
    app/routes/notes/$noteId.tsx:36:16 - error TS2352: Conversion of type 'SerializeObject<Simplify<{ note: Note; } & {}>>' to 
    type 'LoaderData' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, conv
    ert the expression to 'unknown' first.
      The types of 'note.createdAt' are incompatible between these types.
        Type 'string' is not comparable to type 'Date'.
    
    36   const data = useLoaderData() as LoaderData;
                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    app/routes/posts/$slug.tsx:23:26 - error TS2352: Conversion of type 'SerializeObject<Simplify<{ post: Post; html: string; }
     & {}>>' to type 'LoaderData' may be a mistake because neither type sufficiently overlaps with the other. If this was inten
    tional, convert the expression to 'unknown' first.
      The types of 'post.createdAt' are incompatible between these types.
        Type 'string' is not comparable to type 'Date'.
    
    23   const { post, html } = useLoaderData() as LoaderData;
                                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    app/routes/posts/admin.tsx:16:21 - error TS2352: Conversion of type 'SerializeObject<Simplify<{ posts: Post[]; } & {}>>' to
     type 'LoaderData' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, con
    vert the expression to 'unknown' first.
      Types of property 'posts' are incompatible.
        Type 'SerializeObject<Simplify<{ createdAt: Date; updatedAt: Date; title: string; slug: string; markdown: string; } & {
    }>>[]' is not comparable to type 'Post[]'.
          Type 'SerializeObject<Simplify<{ createdAt: Date; updatedAt: Date; title: string; slug: string; markdown: string; } &
     {}>>' is not comparable to type 'Post'.
    
    16   const { posts } = useLoaderData() as LoaderData;
                           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    app/routes/posts/index.tsx:18:21 - error TS2352: Conversion of type 'SerializeObject<Simplify<{ posts: Post[]; } & {}>>' to
     type 'LoaderData' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, con
    vert the expression to 'unknown' first.
      Types of property 'posts' are incompatible.
        Type 'SerializeObject<Simplify<{ createdAt: Date; updatedAt: Date; title: string; slug: string; markdown: string; } & {
    }>>[]' is not comparable to type 'Post[]'.
    
    18   const { posts } = useLoaderData() as LoaderData;
                           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    
    Found 4 errors.
    

    What seems to be happening is that createdAt is a string rather than a date somewhere in between (in Prisma, maybe). A temporary workaround is to convert the result of useLoaderData to unknown and then LoaderData, but this isn't the best solution. This problem happens regardless of the TS version (both 4.7 and 4.8 result in an error). Is there a known solution to this?

    opened by PythonCreator27 5
  • feat(firebase): deploy to Cloud Functions for Firebase

    feat(firebase): deploy to Cloud Functions for Firebase

    Reopening https://github.com/remix-run/remix/pull/3398 against remix-run/examples

    Deploy to firebase functions and hosting

    Closes: Discussion at https://github.com/remix-run/remix/pull/1811#issuecomment-1050238130

    • [x] Docs
    • [ ] Tests (I'd happily add Playwright tests if you want these on examples)

    Testing Strategy:

    • Testing locally against emulator with JS enabled and disabled
    • Testing locally against production with JS enabled and disabled
    • Following deploy instructions and testing remote with JS enabled and disabled
    needs-response 
    opened by penx 5
  • chore(actions/stale): increase days-before-close to 3 weeks

    chore(actions/stale): increase days-before-close to 3 weeks

    The default 7 days is a bit short imho. Also reworded the PR related text.

    (it was a bit sad to see all the PRs closed for some linting issue, I'd like to reopen them after we merge this)

    opened by machour 3
  • MSW example not working

    MSW example not working

    I am actually using the "indie stack" of remix, and I'm struggling to find a working setting for msw to work on both server and client side, I thought I would look into the example to find my solution but could not make this example works

    here is the step I took :

    npx create-remix@latest --template examples/msw
    
    ? TypeScript or JavaScript? (Use arrow keys)
    ❯ TypeScript 
      JavaScript
    
    ? Do you want me to run `npm install`? (Y/n) y
    

    Then running the dev server

    $ npm run dev
    
    > dev
    > remix dev
    
    Watching Remix app in development mode...
    💿 Built in 327ms
    Remix App Server started at http://localhost:3000 (http://xxx.xxx.xx.x:3000)
    

    When accessing the browser, here is what popup in my terminal :

    There was an error running the data loader for route root
    FetchError: request to https://my-mock-api.com/ failed, reason: getaddrinfo ENOTFOUND my-mock-api.com
        at ClientRequest.<anonymous> (/xxxxxx/remix-example/node_modules/@remix-run/web-fetch/src/fetch.js:111:11)
        at ClientRequest.emit (node:events:513:28)
        at TLSSocket.socketErrorListener (node:_http_client:494:9)
        at TLSSocket.emit (node:events:513:28)
        at emitErrorNT (node:internal/streams/destroy:151:8)
        at emitErrorCloseNT (node:internal/streams/destroy:116:3)
        at processTicksAndRejections (node:internal/process/task_queues:82:21)
    GET / 500 - - 112.438 ms
    GET /mockServiceWorker.js 404 - - 3.404 ms
    

    GET /mockServiceWorker.js 404 - - 3.404 ms disappear if I run the msw init command line: npx msw init public/ --save

    in the "indie stack", it looks like the initialization of msw is done differently with something like that in package.json :

    {
    ...
    "dev:remix": "cross-env NODE_ENV=development binode --require ./mocks -- @remix-run/dev:remix dev",
    ...
    }
    
    opened by SylRob 3
  • with twind example has some error

    with twind example has some error

    Error: Cannot find module '/sandbox/build/index.js' Require stack:

    • /sandbox/node_modules/@remix-run/serve/dist/index.js
    • /sandbox/node_modules/@remix-run/dev/dist/cli/commands.js
    • /sandbox/node_modules/@remix-run/dev/dist/cli/run.js
    • /sandbox/node_modules/@remix-run/dev/dist/cli/index.js
    • /sandbox/node_modules/@remix-run/dev/dist/index.js
    • /sandbox/node_modules/@remix-run/dev/dist/cli.js at Function.Module._resolveFilename (internal/modules/cjs/loader.js:902:15) at Function.Module._load (internal/modules/cjs/loader.js:746:27) at Module.require (internal/modules/cjs/loader.js:974:19) at require (internal/modules/cjs/helpers.js:101:18) at /sandbox/node_modules/@remix-run/serve/dist/index.js:43:17 at Layer.handle [as handle_request] (/sandbox/node_modules/express/lib/router/layer.js:95:5) at next (/sandbox/node_modules/express/lib/router/route.js:144:13) at next (/sandbox/node_modules/express/lib/router/route.js:140:7) at next (/sandbox/node_modules/express/lib/router/route.js:140:7) at next (/sandbox/node_modules/express/lib/router/route.js:140:7)
    opened by Alvazz 2
  • Redirect param in /new route

    Redirect param in /new route

    Inside the /new.tsx file, I have find this line of code : return redirect(/threads/${thread.id}?redirectTo=/threads/new); What is ?redirectTo inside that redirection? The Joke tutorial on the remix site don't have this url param.

    opened by AxelBriche 2
  • chore(deps-dev): bump typescript from 4.9.3 to 4.9.4

    chore(deps-dev): bump typescript from 4.9.3 to 4.9.4

    Bumps typescript from 4.9.3 to 4.9.4.

    Release notes

    Sourced from typescript's releases.

    TypeScript 4.9.4

    For release notes, check out the release announcement.

    For the complete list of fixed issues, check out the

    Downloads are available on:

    Changes:

    • e2868216f637e875a74c675845625eb15dcfe9a2 Bump version to 4.9.4 and LKG.
    • eb5419fc8d980859b98553586dfb5f40d811a745 Cherry-pick #51704 to release 4.9 (#51712)
    • b4d382b9b12460adf2da4cc0d1429cf19f8dc8be Cherry-pick changes for narrowing to tagged literal types.
    • e7a02f43fce47e1a39259ada5460bcc33c8e98b5 Port of #51626 and #51689 to release-4.9 (#51627)
    • 1727912f0437a7f367d90040fc4b0b4f3efd017a Cherry-pick fix around visitEachChild to release-4.9. (#51544)

    This list of changes was auto generated.

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies javascript 
    opened by dependabot[bot] 1
  • Chakra Error/Catch Boundaries lose ChakraContext - but only sometimes

    Chakra Error/Catch Boundaries lose ChakraContext - but only sometimes

    I have the example chakra repo as a base template, I have not modified the provided Error/Catch Boundaries in the root.tsx, and I have none elsewhere.

    I have noticed that sometimes when one of these boundaries are hit, there is no theme at all, sometimes there is.

    For example: If I navigate directly to a page that doesn't exist I get (with theme): image

    If I click a link inside my app that takes me to a page that doesn't exist (same url): image

    The Chakra Theme is missing.

    There are also other instances eg when throwing / erroring from a loader - sometimes the theme is there, sometimes it isn't there, though I haven't been able to narrow down when so can't provide replication for that.

    In all instances though, pressing "Back" on my browser will take me back BUT there is NO theme / styling whatsoever on the previous page, it's just plain text/images, it's like all the css has completely disappeared.

    I also tried following the example provided by Chakra (which uses renderToString instead of renderToPipeableStream, but then error boundaries are even worse and looking at their issues, you have to create a bunch of dunder routes and it's a real trickery to get anything working (and then of course you lose the streaming ability).

    opened by joelrozen 0
  • Framer route animation example with useLoaderData

    Framer route animation example with useLoaderData

    It seems AnimatePresence will keep outlet around causing useLoaderData to return undefined

    Can be reproduced here https://codesandbox.io/s/delicate-star-m8sx7s

    If you go to about page you get TypeError: Cannot destructure property 'data' of 'useLoaderData(...)' as it is undefined.

    This issue is likely related to https://github.com/remix-run/react-router/issues/8936

    opened by zipme 0
  • AWS S3 Sample returns object if no file selected

    AWS S3 Sample returns object if no file selected

    Why "AWS S3 Sample" returns an object if no file selected?. Can we just return empty string?

    Currenlty it returns something like: { _name: '', _lastModified: 1671726592818 }

    opened by xor83 0
  • _official-realtime-app can't be run

    _official-realtime-app can't be run

    Hi, when I run the example I get the error

    node: bad option: --watch
    ERROR: "dev:server" exited with 9.
    

    my node version is 18.9.1

    way to reproduce the error

    npm install
    npm run dev
    
    opened by SylRob 2
Owner
Remix
Remix
Demo showcasing information leaks resulting from an IndexedDB same-origin policy violation in WebKit.

Safari 15 IndexedDB Leaks Description This demo showcases information leaks resulting from an IndexedDB same-origin policy violation in WebKit (a brow

FingerprintJS 101 Nov 5, 2022
Code Playground is a online application for testing and showcasing user-created and collaborational HTML, CSS and JavaScript code snippets

Code Playground About Code Playground is a online application for testing and showcasing user-created and collaborational HTML, CSS and JavaScript cod

Arshansh Agarwal 5 Dec 17, 2022
Contains html file showcasing Earthquake related data generated in the form of VR model, ArcGIS API with real-time earthquake feed and video of simulation of earthquake generated in blender

Module-EADGI-Project-All about Earthquakes Introduction Contains html file showcasing Earthquake related data generated in the form of VR model, ArcGI

Abhishek Rawat 2 Jun 9, 2022
A collection of Aurelia 2 example applications showcasing how to build Aurelia 2 applications and other tasks.

Aurelia 2 Examples A monorepository of a treasure trove of Aurelia 2 example applications you can use as a guide to help you build your own applicatio

aurelia 12 Dec 29, 2022
'event-driven' library aims to simplify building backends in an event driven style

'event-driven' library aims to simplify building backends in an event driven style(event driven architecture). For message broker, light weight Redis Stream is used and for event store, the well known NoSQL database, MongoDB, is used.

Sihoon Kim 11 Jan 4, 2023
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
Social media platform that hosts community-driven challenges where everyone can play and compete

Komo A social media platform that hosts community-driven challenges where everyone can play and compete. How To Install Komo TBA Preview Home Screen A

null 2 Jun 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
Hasbik is a community based social token and the new paradigm in the crypto space. With the goal to build a community around a crypto token.

Hasbik is a community based social token and the new paradigm in the crypto space. With the goal to build a community around a crypto token.

null 2 Jan 5, 2022
Remix Blues Stack - Community discussions web app

Remix Blues Stack - Community discussions web app

Alex Ruheni 4 Jul 16, 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 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
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
SAP Community Code Challenge: This repository contains an empty OpenUI5 application and end-to-end tests written with wdi5. Take part in the challenge and develop an app that passes the tests.

SAP Community Code Challenge - UI5 The change log describes notable changes in this package. Description This repository is the starting point for the

SAP Samples 8 Oct 24, 2022
Examples of using various CSS-in-JS libs in Astro (repo for withastro/astro#4432)

astro + css-in-js This monorepo will show examples of various CSS-in-JS libraries in Astro. Currently only shows a basic counter example, would be nic

Mayank 15 Dec 18, 2022
Examples of how to do query, style, dom, ajax, event etc like jQuery with plain javascript.

You (Might) Don't Need jQuery Frontend environments evolve rapidly nowadays and modern browsers have already implemented a great deal of DOM/BOM APIs

NEFE 20.3k Dec 24, 2022
Functions Recipes is a library of examples to help you getting started with Salesforce Functions and get used to their main features.

Functions Recipes Introduction Salesforce Functions lets you use the Salesforce Platform for building event-driven, elastically scalable apps and expe

Trailhead Apps 172 Dec 29, 2022
🤪 A list of funny and tricky JavaScript examples

?? A list of funny and tricky JavaScript examples

Denys Dovhan 29.6k Jan 1, 2023