Go app with Gin and SQLite + React typescript with tailwind, which can easily be deployed to Heroku.
Make sure you have Go version 1.17 or newer, the Heroku CLI installed, gcc compiler for SQLite and NodeJS for react.
- Make sure env in root folder have
APPS_MODE
is set todevelopment
. - Run
go run .
in your terminal (make sure your terminal in current go project folder) to start backend Go. - Your app should now be running on localhost:11001.
note: You can change the port in .env
in root folder.
REPEAT=10
APPS_MODE=development
APPS_PORT=11001
- Open terminal in frontend project folder
cd frontend
(assumption: your terminal in root go project). - Install npm package for our frontend project
npm i
ornpm install
. - Run frontend with
npm run start
. - Your app should now be running on localhost:12001.
note: your frontend is send request to golang backend via proxy, if you change your backend port you need to update the proxy in the frontend package.json
.
{
"proxy": "http://localhost:11001",
}
note: make sure env in root folder have APPS_MODE
is set to production
.
$ heroku create
$ git push heroku main
$ heroku open
or
For more information about using Go on Heroku, see these Dev Center articles: