Skip to content

Refactor backend to Gin version#4

Merged
Darrin-Lin merged 5 commits into
mainfrom
gin/refactor-go
Nov 20, 2025
Merged

Refactor backend to Gin version#4
Darrin-Lin merged 5 commits into
mainfrom
gin/refactor-go

Conversation

@Darrin-Lin
Copy link
Copy Markdown
Member

This pull request migrates the project from a Node.js/TypeScript/Express backend to a Go backend using the Gin framework. It removes all Node.js/TypeScript-specific configuration, code, and tooling, replacing them with Go equivalents for dependency management, code quality, CI/CD, and documentation. The README and workflow files are rewritten to reflect the new Go-based stack and development practices.

Migration to Go backend:

  • All Node.js, TypeScript, and Express-related files and configurations are removed, including package.json, eslint.config.js, and the main application code in src/app.ts. [1] [2] [3]
  • Go module initialization is added via go.mod, specifying dependencies for Gin, Firebase, and supporting libraries.
  • The README is completely rewritten to document the new Go-based backend, its structure, setup, development, and deployment instructions. [1] [2] [3]

CI/CD and workflow changes:

  • GitHub Actions workflows (ci.yml and test.yml) are updated to use Go instead of Node.js, including dependency caching, formatting, vetting, and building/testing with Go tools. Node.js and pnpm steps are removed. [1] [2]

Code quality and pre-commit hooks:

  • Husky pre-commit hook now runs Go formatting, vetting, and dependency tidy commands instead of lint-staged with ESLint/Prettier.
  • lint-staged configuration is updated to format only Go files.

Environment and Firebase setup:

  • .env.example is simplified for Go, and a new firebase.json is added for Firestore emulator configuration. [1] [2]

Summary of most important changes:

1. Migration to Go backend

  • Removed all Node.js/TypeScript/Express code and configuration, including package.json, eslint.config.js, and src/app.ts. [1] [2] [3]
  • Added Go module (go.mod) with dependencies for Gin, Firebase, and related libraries.
  • Rewrote README.md to document Go stack, project structure, and development workflow. [1] [2] [3]

2. CI/CD and workflow updates

  • Updated GitHub Actions workflows to use Go for building, formatting, vetting, and testing, removing Node.js and pnpm steps. [1] [2]

3. Code quality and pre-commit

  • Changed Husky pre-commit hook to run Go code quality checks (go fmt, go vet, go mod tidy).
  • Updated lint-staged to format Go files only.

4. Environment and Firebase configuration

  • Simplified .env.example for Go and added firebase.json for Firestore emulator. [1] [2]

Comment thread .env.example
Comment thread .gitignore Outdated
Comment thread README.md Outdated
Comment thread src/lib/testOnly/CourseTestAPI.go
@NaoCoding NaoCoding self-requested a review November 4, 2025 07:57
Comment thread README.md Outdated
Comment thread README.md Outdated
Comment thread src/lib/testOnly/CourseTestAPI.go
Comment thread src/lib/testOnly/FirestoreEmulator.go
Comment thread src/main.go Outdated
@Darrin-Lin
Copy link
Copy Markdown
Member Author

Now have prd/test/dev mode can select in APP_ENV in .env, only test mode will open test api.
And also have option of use firestore emulator or not.
Credential file change to env and put in credentials dir.

Copy link
Copy Markdown
Contributor

@NaoCoding NaoCoding left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Try to resolve the conversation once you completed the changes.
So I can easily know the status of your PRs.

@Darrin-Lin Darrin-Lin merged commit 327ee3a into main Nov 20, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants