---
title: "Dave Calnan (@davecalnan) | Hashnode"
description: "Software Engineer figuring it out. Read the latest articles by Dave Calnan on Hashnode."
url: "https://hashnode.com/@davecalnan"
---

@davecalnan

# Dave Calnan

@davecalnan · Joined June 2022

Software Engineer figuring it out

## Comments

[They’re both on subdomains in my instance - so app.example.com and api.example.com. For another project, I have deployed this architecture to a single server via Laravel Forge. The Remix web app is available at the root domain via an nginx reverse proxy to port 3000. The Laravel backend is only accessible over localhost on that server so the Remix backend makes calls to localhost:8000 on that same server. That works fine for smaller projects where you don’t need to access the Laravel backend outside of the Remix backend.](https://hashnode.com/posts/adding-a-laravel-backend-to-a-remix-app/62a874fa0baf4306d9493798/comment/653b598799e256838d60981c#reply-653d9d5d8bb1c48f931a2af0)

Reply · Article · Oct 28, 2023 · [Adding a Laravel backend to a Remix App](https://hashnode.com/posts/adding-a-laravel-backend-to-a-remix-app/62a874fa0baf4306d9493798)

[Hi Jaska, I'm sorry if the article wasn't clear! The examples in this article of Remix talking to the database directly were how I did things before adding the Laravel backend. Now the all the Remix loaders do is call the API for my Laravel backend. So I only write the backend code once for exactly the reasons you mentioned. Hopefully that clears things up!](https://hashnode.com/posts/adding-a-laravel-backend-to-a-remix-app/62a874fa0baf4306d9493798/comment/63cf8bc91819c3d44449cca5#reply-6404875287595bb6fc8849ee)

Reply · Article · Mar 5, 2023 · [Adding a Laravel backend to a Remix App](https://hashnode.com/posts/adding-a-laravel-backend-to-a-remix-app/62a874fa0baf4306d9493798)

[I actually extracted this into its own npm package: https://github.com/davecalnan/typesafe-api/tree/main/packages/typesafe-api-client yarn add @davekit/typesafe-api-client It's basically just: export const api = createApiClient({ baseUrl: "https://your-app.com/api" }); const result = api.get("/some-path"); const onClick = () => api.delete("/some-other-path"); I pair it with @davekit/typesafe-api and generate types for all my backend routes that I can then import into the frontend and get type-safety over the API. But that needs a whole blog post of its own to get into.](https://hashnode.com/posts/adding-a-laravel-backend-to-a-remix-app/62a874fa0baf4306d9493798/comment/632c1e19e06c24f9f23a3d71#reply-63315f874dd8b2344a768860)

Reply · Article · Sep 26, 2022 · [Adding a Laravel backend to a Remix App](https://hashnode.com/posts/adding-a-laravel-backend-to-a-remix-app/62a874fa0baf4306d9493798)

[Route::view() is great! I also really like closures for simple stuff just like that e.g. a health check endpoint that just needs to return a 200 OK. In my actual controllers I would paginate and use Form Requests/JSON Resources, authorisation etc - just wanted to keep that example simple and comparable to the Prisma one!](https://hashnode.com/posts/adding-a-laravel-backend-to-a-remix-app/62a874fa0baf4306d9493798/comment/62b0bccf5abe3c6b79d140ef#reply-62b0e4895abe3c6b79d1457c)

Reply · Article · Jun 20, 2022 · [Adding a Laravel backend to a Remix App](https://hashnode.com/posts/adding-a-laravel-backend-to-a-remix-app/62a874fa0baf4306d9493798)
