DEV Community

Mat
Mat

Posted on • Edited on • Originally published at cronusmonitoring.com

Create a React Go Server in 2 minutes

I made this awesome template that comes with a well structured go server and a react frontend and i think its worth sharing.

I created this because I reached the limits of Next.js in my projects and was looking for a good Go alternative. Surprisingly this was really difficult to get set up, and examples were hard to come by.

If you have repo cloned it's 2-3 commands (depending if you have dependencies) to get it running.

For development

  1. Running the frontend vite server
make app
Enter fullscreen mode Exit fullscreen mode
  1. Running the backend go server
make server
Enter fullscreen mode Exit fullscreen mode

Thats it! The site will now be reachable on port 3000 by default.

For production

  1. Building docker image
make build
Enter fullscreen mode Exit fullscreen mode
  1. Running the docker image
make run
Enter fullscreen mode Exit fullscreen mode

I can definitely make improvements to the UI of the pages, however from my experience of using things like Vite and React. I end up ripping out all the extras anyway.

Top comments (0)