cachix / devenv

Fast, Declarative, Reproducible, and Composable Developer Environments
https://devenv.sh
Apache License 2.0
3.56k stars 259 forks source link

Remix nodejs+postgres example #948

Open frontsideair opened 3 months ago

frontsideair commented 3 months ago

I created a basic Remix example that uses PostgreSQL.

I couldn't find a simple enough full-stack Remix template so I created my own. It can be regularly rebased on top of the official default template, and I feel comfortable about transferring repo ownership to cachix organization.

The test seems to be passing on my machine, but I'm open to improvements. I based everything on Ruby on Rails example and my own experimental project where I started using devenv.

A Next.js example can be built based on this relatively easily if needed.

frontsideair commented 3 months ago

@domenkozar I cleaned the create-remix output a bit.

There are many failing tests, at least one is because of prisma dependency on libssl. I could simplify the template to use PostgreSQL with a simpler library, but this is a pretty typical Remix setup so it has testing and example value.

Especially since the docker compose setup I replaced had binary incompatibilities between native macOS I'm using and the docker linux environment caused by Prisma, which worked with devenv out of the box.

domenkozar commented 3 months ago

Would be great to fix the tests so it can be merged.

frontsideair commented 3 months ago

I would find some direction immensely helpful, as there are 71 tests failing and many of them are not related to this PR as far as I can tell. Would rebasing on main help? And the question about Prisma dependency on libssl remains, which solution would you recommend?

domenkozar commented 2 months ago

Ideally we'd fix prisma in nixpkgs so that it works.

frontsideair commented 2 months ago

I rebased my changes in case it helps. I'd be really happy to get this merged, I plan to write a blog post about using devenv to manage dependencies for a Node.js project and it'd be nice to have an official example in place for that.

domenkozar commented 2 months ago

@frontsideair happy to merge once tests pass, can you make sure those work?

frontsideair commented 2 months ago

I think I fixed them @domenkozar, running devenv shell devenv-test-example remix locally passes.

frontsideair commented 2 months ago

Every test is failing for a separate reason, one failing because of libssl, one is getting 403 from GitHub, two because they can't find npm. I'm very much lost.

domenkozar commented 2 months ago

I'm currently focusing effort to get #1005 out, once it's done I can help you take a look.

domenkozar commented 1 month ago

@frontsideair hey, can you rebase and see where we're at?

frontsideair commented 1 month ago

@domenkozar Rebased, thanks for keeping tabs on this!