Skip to content

Refactor backend to Gin.#3

Merged
NaoCoding merged 10 commits into
mainfrom
gin/refactor-go
Sep 28, 2025
Merged

Refactor backend to Gin.#3
NaoCoding merged 10 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 and updates all related tooling, configuration, and documentation accordingly. The changes remove all Node.js/TypeScript-specific code and dependencies, introduce Go equivalents, and refactor CI/CD, linting, and development workflows for Go.

Key changes include:

Migration to Go Backend

  • Replaced all Node.js/TypeScript/Express code and dependencies with a Go backend using the Gin framework, including Firebase Firestore integration and Go-based project structure (src/app.ts, package.json, eslint.config.js, README.md, .env.example, .lintstagedrc, .husky/pre-commit, go.mod). [1] [2] [3] [4] [5] [6] [7] [8] [9]

  • Updated the documentation to describe the new Go tech stack, development, build, and deployment processes, and removed references to Node.js, TypeScript, and related tools. [1] [2] [3]

CI/CD and Tooling Updates

  • Refactored GitHub Actions workflows for CI and testing to use Go (setup, dependency caching, formatting, vetting, building, and testing), removing Node.js and pnpm steps. [1] [2]

  • Updated pre-commit hooks and lint-staged configuration to perform Go formatting, vetting, and dependency tidying instead of JS/TS linting and formatting. [1] [2]

Environment and Firebase Configuration

  • Changed environment variable and Firebase credential handling to use Go conventions (e.g., xueer-dev.json for service account credentials), and added a firebase.json for local emulator configuration. [1] [2]

Project Cleanup

  • Removed all Node.js/TypeScript-related configuration and code, including package.json, eslint.config.js, and the entire Express app implementation. [1] [2] [3]

Go Module Initialization

  • Added go.mod and go.sum files with necessary dependencies for Gin, Firebase, and related Go libraries.

These changes fully transition the backend stack to Go, streamline the project for Go development, and ensure all supporting tooling and documentation reflect the new architecture.

- Deleted main application file (src/app.ts) along with its middleware and routes.
- Removed environment configuration file (src/config/env.ts) that handled environment variables.
- Eliminated Firebase configuration file (src/config/firebase.ts) and its initialization logic.
- Removed server entry point (src/index.ts) that started the Express server.
- Deleted API tests (src/test/api.test.ts) and configuration tests (src/test/config.test.ts).
- Removed test setup file (src/test/setup.ts) for initializing test environment.
- Deleted TypeScript configuration file (tsconfig.json) and Vitest configuration file (vitest.config.ts).
@NaoCoding NaoCoding merged commit f332187 into main Sep 28, 2025
2 checks 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