Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend this template to include the backend as well? #2

Open
pmiddend opened this issue Nov 25, 2019 · 2 comments
Open

Extend this template to include the backend as well? #2

pmiddend opened this issue Nov 25, 2019 · 2 comments

Comments

@pmiddend
Copy link

Could this be easily extended?

@thalesmg
Copy link
Owner

Good question!
Since I'm still learning both Reflex and Nix, I still don't know exactly how people usually structure such projects.

My guess is that one could organize the frontend and backend in folders like:

├── backend
│   └── src
└── frontend
    └── src

And then modify default.nix to something like:

{ pkgs ? import <nixpkgs> {}
, reflex-platform ? import ./nix/reflex-platform.nix
, compiler ? "ghcjs"
}:

reflex-platform.project (_: {
  withHoogle = false;
  useWarp = true;

  packages = {
    backend = ./backend;
    frontend = ./frontend;
  };

  shells = {
    ghc   = [
      "backend"
      "frontend"
    ];
    ghcjs = [
      "backend"
      "frontend"
    ];
  };
})

But I'm not sure what to do with the compiler argument. Perhaps override that in a default.nix inside ./backend?

Once I get more acquainted with both Nix and Reflex, I'll probably update this template with my findings.

Thanks for the idea!

@pmiddend
Copy link
Author

pmiddend commented Nov 27, 2019

Not sure how to solve this, but I got the idea from:

https://github.com/ElvishJerricco/reflex-project-skeleton

I think it'd be very desirable. Using Haskell "full-stack" (or any language, for that matter) sounds pretty enticing. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants