A modern, production-ready template for full-stack web applications using Go (Gin) for the backend and React (TypeScript + Vite) for the frontend.
- 🚀 Modular Go architecture with clean separation of concerns
- 🔍 Built-in health checks and monitoring
- 📝 Swagger/OpenAPI documentation
- 🧪 Comprehensive test suite
- 🛠️ Development and production Docker configurations
- 🔒 Middleware support (logging, recovery, CORS)
- ⚡️ Vite for lightning-fast development
- 🎨 Modern UI components
- 📱 Responsive layout structure
- 🔄 API client with axios
- 🛣️ React Router for navigation
- 🐳 Docker support for development and production
- 📋 Standardized PR templates for different types of changes
- 📊 Project structure for maintainable, scalable applications
- 🔄 Clear contribution guidelines
- Docker and Docker Compose
- Go 1.24 or later (for local development)
- Node.js 20 or later (for local development)
- Make (optional, for using Makefile commands)
-
Clone the template:
git clone <repository-url> your-project-name cd your-project-name
-
Install dependencies (if developing locally):
make install
-
Start the application:
Full stack (recommended):
make dev
Backend only:
make dev-backend
Frontend only:
make dev-frontend
The services will be available at:
- Frontend: http://localhost:3000
- Backend: http://localhost:8081
- API Documentation: http://localhost:8081/swagger/index.html
.
├── backend/ # Go backend service
│ ├── api/ # API entry point
│ ├── internal/ # Internal packages
│ │ ├── api/ # API implementation
│ │ ├── config/ # Configuration
│ │ ├── health/ # Health checks
│ │ └── models/ # Data models
│ └── pkg/ # Public packages
├── frontend/ # React frontend
│ ├── src/
│ │ ├── api/ # API integration
│ │ ├── components/ # Reusable components
│ │ ├── pages/ # Page components
│ │ └── services/ # Business logic
│ └── public/ # Static assets
└── docker-compose.yml # Docker services configuration
make dev- Start both services in development modemake dev-backend- Start backend in development modemake dev-frontend- Start frontend in development modemake install- Install dependenciesmake test- Run all testsmake test-backend- Run backend testsmake test-frontend- Run frontend testsmake docs- Generate API documentationmake fmt- Format codemake lint- Run linters
make prod- Start both services in production modemake prod-backend- Start backend in production modemake prod-frontend- Start frontend in production mode
make clean- Stop and remove containersmake prune- Clean up Docker resources
Backend:
GO_ENV- Environment (development/production)GIN_MODE- Gin framework mode (debug/release)BACKEND_PORT- Backend port (default: 8081)
Frontend:
NODE_ENV- Environment (development/production)PORT- Frontend port (default: 3000 in dev, 80 in prod)VITE_API_URL- Backend API URL
The API documentation is automatically generated using Swagger/OpenAPI. You can access it at:
- Development: http://localhost:8081/swagger/index.html
- Production: http://[your-domain]/swagger/index.html
To regenerate the API documentation:
make docsThe template includes comprehensive testing setups for both frontend and backend:
# Run all tests
make test
# Run backend tests only
make test-backend
# Run frontend tests only
make test-frontendBoth services include health check endpoints:
- Backend: http://localhost:8081/health/live
- Frontend: Built into the Docker container
We welcome contributions to this project! Please check out our Contributing Guidelines for detailed information on how to get started.
This repository includes a comprehensive set of templates and workflows to streamline the development process:
- Default Template: Used automatically when creating a PR
- Bug Fix Template: For PRs that fix bugs (
?template=bugfix.md) - Feature Template: For PRs that add new features (
?template=feature.md) - Documentation Template: For PRs that update docs (
?template=documentation.md)
To use a specialized template, add the query parameter to the PR URL:
https://github.com/username/application_template/compare/main...your-branch?template=feature.md
- Bug Report: For reporting bugs and unexpected behavior
- Feature Request: For suggesting new features or improvements
- Documentation Issue: For reporting issues with documentation
- Code of Conduct: Our Code of Conduct outlines expectations for participation
- CODEOWNERS: Automatically assigns reviewers based on the files changed
- GitHub Actions: Automatically validates pull requests with linting, testing, and security scans
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'feat: add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request using one of our templates
- Default Template: Used automatically when creating a PR
- Bug Fix Template: For PRs that fix bugs (
?template=bugfix.md) - Feature Template: For PRs that add new features (
?template=feature.md) - Documentation Template: For PRs that update docs (
?template=documentation.md)
To use a specialized template, add the query parameter to the PR URL:
https://github.com/your-username/application_template/compare/main...your-branch?template=feature.md
This project is licensed under the MIT License - see the LICENSE file for details