DEV Community

Mat
Mat

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

2

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.

Sentry blog image

How I fixed 20 seconds of lag for every user in just 20 minutes.

Our AI agent was running 10-20 seconds slower than it should, impacting both our own developers and our early adopters. See how I used Sentry Profiling to fix it in record time.

Read more

Top comments (0)

AWS Security LIVE!

Join us for AWS Security LIVE!

Discover the future of cloud security. Tune in live for trends, tips, and solutions from AWS and AWS Partners.

Learn More

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay