{"id":24516271,"url":"https://github.com/roylisto/gin-golang-react","last_synced_at":"2025-04-14T09:33:15.763Z","repository":{"id":57639343,"uuid":"352981122","full_name":"roylisto/gin-golang-react","owner":"roylisto","description":"Golang+Gin with React Frontend Monorepo","archived":false,"fork":false,"pushed_at":"2021-09-16T05:01:28.000Z","size":284,"stargazers_count":15,"open_issues_count":0,"forks_count":8,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-11-16T15:38:33.662Z","etag":null,"topics":["gin-gonic","golang","monorepo","react","webpack"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/roylisto.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-03-30T11:45:25.000Z","updated_at":"2024-11-05T00:15:12.000Z","dependencies_parsed_at":"2022-08-27T20:02:26.382Z","dependency_job_id":null,"html_url":"https://github.com/roylisto/gin-golang-react","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roylisto%2Fgin-golang-react","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roylisto%2Fgin-golang-react/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roylisto%2Fgin-golang-react/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roylisto%2Fgin-golang-react/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/roylisto","download_url":"https://codeload.github.com/roylisto/gin-golang-react/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235045192,"owners_count":18927177,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["gin-gonic","golang","monorepo","react","webpack"],"created_at":"2025-01-22T01:22:44.530Z","updated_at":"2025-01-22T01:22:45.154Z","avatar_url":"https://github.com/roylisto.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Golang+Gin+React\n\n## Overview\nThis is a template project to use golang with gin and react as monolith application easier for Full Stack Developer. Don't need to deploy frontend and backend as separate service, gin will serve static content from React either it is on development (with hot reload) or production.\n\n## Main Tech Stack\n### Backend\n1. [Golang](https://golang.org/) -\u003e Programming Language\n2. [Gin Gonic](https://github.com/gin-gonic) -\u003e Backend framework\n\n### Frontend\n1. [React](https://reactjs.org/) -\u003e Frontend library\n2. [Webpack](https://webpack.js.org/) -\u003e Module bundler\n\n## Prerequesites\n1. Golang v1.16\n2. Node Js v14\n\n## Getting Started\n1. Clone the repository from Github\n2. Add `.env` file in root directory of this project\n```The template for `.env` file can be found at `.env.example`.```\n3. Install backend and frontend dependencies, use\n```make init```\n4. Or if you want to install backend dependencies only, use ```make init-server```\n5. And if you want to install frontend dependencies only, use ```make init-client```\n\n## Local Development (Hot Reload)\nBoth backend and frontend will served by hot reload, so when change the code and then save file, backend or frontend will restart automatically.\n1. To run backend only, open new terminal and run ```fresh``` at root folder\n2. To run frontend and backend concurrently, open terminal and run ```make run``` at root folder\n\nIt will run on `localhost:3000` for the frontend, and `localhost:3000/api/v1` for the backend, it depends on what port was set in the ENV\n\n## Staging \u0026 Production Build\n1. Build the frontend and backend by ```make build```\n2. Run the build version inside `bin` folder\n```./bin/app```\n\n## Important Notes\n1. Use `HashRoutes` from `react-router-dom` to avoid conflicted route between react router and gin router\n2. To make client can read the ENV value, you need to add that into `client/config/webpack.config.js`\n```\nnew webpack.DefinePlugin({\n    'process.env.APPLICATION_SERVER': JSON.stringify(process.env.APPLICATION_SERVER),\n    'process.env.APP_ENV': JSON.stringify(process.env.APP_ENV),\n    'process.env.YOUR_ENV_VALUE_TO_BE_READ': JSON.stringify(process.env.YOUR_ENV_VALUE),\n  }),\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Froylisto%2Fgin-golang-react","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Froylisto%2Fgin-golang-react","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Froylisto%2Fgin-golang-react/lists"}