DEV Community

Israel
Israel

Posted on

go-react starter

For everyone looking to get started with building web apps and auth APIs with go.

I worked on a go and react project over the weekend to help you get started on authentication with golang, complete with a postgresql database and token based authentication using JWT.

Here is the url.

GitHub logo aesrael / go-postgres-react-starter

A go, postgres API with basic jwt auth starter, complete with a react frontend

GO-React starter

This is a basic example of a go web server with a react frontend.

It uses the go fiber framework

Getting started

Running locally

Clone this repository Download and install golang

Download and install postgres

Setup your postgres database, env secrets can be changed in the .env file

Ensure you have make installed.

make run
Enter fullscreen mode Exit fullscreen mode

This will start the go server & the react frontend.

Using docker

Ensure you have docker installed

make docker-build
make docker-run
Enter fullscreen mode Exit fullscreen mode

Server is live on :8081 and UI is on :3000

Endpoints

endpoint method body description
/api/session GET GET user session
/api/login POST { email String, password String } login user
/api/register POST { email String, password String, name String } register new user

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you…

I hope you like it!

Contributions are welcome. Cheers🎉

Top comments (0)