Skip to content

Commit 7c890aa

Browse files
committed
improved read me
1 parent e5ce36f commit 7c890aa

File tree

2 files changed

+31
-10
lines changed

2 files changed

+31
-10
lines changed

README.md

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,23 @@
77

88
## 🚀 Template Repository
99

10-
This is a **template repository** for building production-ready and easily extendible REST APIs using Go. Click the "Use this template" button above to create your own repository based on this template.
10+
This is a **template repository** for building REST APIs with Go. Click the "Use this template" button above to create your own repository based on this template.
1111

1212
## Overview
1313

14-
This template follows best practices and includes a standardized project structure with all necessary components for building scalable microservices.
14+
This template includes everything you need to build a REST API with Go - logging, middleware, database setup, testing, and deployment configs.
1515

1616
## Features
1717

1818
- Structured logging
19-
- Middleware support (authentication, etc.)
20-
- Configuration management
21-
- API documentation with Swagger
22-
- Docker support
23-
- CI/CD pipeline with GitHub Actions
19+
- Middleware (auth, CORS, etc.)
20+
- Config management
21+
- API docs with Swagger
22+
- Docker setup
23+
- GitHub Actions CI/CD
2424
- Database migrations
25-
- End-to-end testing
26-
- Makefile for common operations
25+
- Tests
26+
- Makefile for common tasks
2727

2828
The main ones are:
2929

@@ -44,26 +44,31 @@ The main ones are:
4444
## 🎯 Quick Start (Using Template)
4545

4646
### 1. Create Repository from Template
47+
4748
Click the **"Use this template"** button at the top of this repository, or use GitHub CLI:
4849

4950
```bash
5051
gh repo create my-go-api --template MitulShah1/golang-rest-api-template
5152
```
5253

5354
### 2. Clone Your New Repository
55+
5456
```bash
5557
git clone https://github.com/YOUR_USERNAME/my-go-api.git
5658
cd my-go-api
5759
```
5860

5961
### 3. Update Project Details
62+
6063
After creating your repository, update these files:
64+
6165
- `go.mod` - Update module name
6266
- `README.md` - Update project name and description
6367
- `.github/workflows/go.yml` - Update repository references if needed
6468
- `docker-compose.yml` - Update service names if needed
6569

6670
### 4. Start Development
71+
6772
```bash
6873
make help # See all available commands
6974
make env # Create .env file
@@ -110,7 +115,7 @@ golang-microservice-template/
110115

111116
### Prerequisites
112117

113-
- Go 1.21 or higher
118+
- Go 1.21+
114119
- Docker and Docker Compose
115120
- Make
116121

TEMPLATE_SETUP.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ This guide helps you set up your new repository after creating it from this temp
55
## 🚀 Initial Setup
66

77
### 1. Update Module Name
8+
89
Edit `go.mod` and change the module name:
10+
911
```go
1012
// Change from:
1113
module github.com/MitulShah1/golang-rest-api-template
@@ -15,61 +17,74 @@ module github.com/YOUR_USERNAME/YOUR_REPO_NAME
1517
```
1618

1719
### 2. Update Repository References
20+
1821
Search and replace these references in your codebase:
22+
1923
- `github.com/MitulShah1/golang-rest-api-template``github.com/YOUR_USERNAME/YOUR_REPO_NAME`
2024
- `MitulShah1/golang-rest-api-template``YOUR_USERNAME/YOUR_REPO_NAME`
2125

2226
### 3. Update README.md
27+
2328
- Change the project title
2429
- Update badges to point to your repository
2530
- Modify the description to match your project
2631

2732
### 4. Update GitHub Actions
33+
2834
In `.github/workflows/go.yml`, update the repository name in badges if needed.
2935

3036
### 5. Update Docker Configuration
37+
3138
In `docker-compose.yml`, consider updating service names to match your project.
3239

3340
## 🔧 Customization Options
3441

3542
### Database Configuration
43+
3644
- Update database connection settings in `config/config.go`
3745
- Modify migration files in `package/database/migrations/`
3846
- Update database driver if switching from MySQL
3947

4048
### API Endpoints
49+
4150
- Modify existing handlers in `internal/handlers/`
4251
- Add new endpoints following the established pattern
4352
- Update Swagger documentation for new endpoints
4453

4554
### Middleware
55+
4656
- Customize middleware in `package/middleware/`
4757
- Add authentication/authorization as needed
4858
- Configure CORS settings for your domain
4959

5060
### Environment Variables
61+
5162
- Update `.env.example` with your specific configuration
5263
- Add new environment variables as needed
5364
- Document all required environment variables
5465

5566
## 📝 Best Practices for Template Usage
5667

5768
### 1. Keep the Structure
69+
5870
- Maintain the established project structure
5971
- Follow the existing patterns for handlers, services, and repositories
6072
- Use the provided middleware and utilities
6173

6274
### 2. Testing
75+
6376
- Write tests for all new functionality
6477
- Follow the existing test patterns
6578
- Maintain high test coverage
6679

6780
### 3. Documentation
81+
6882
- Update Swagger documentation for new endpoints
6983
- Keep README.md up to date
7084
- Document any new configuration options
7185

7286
### 4. CI/CD
87+
7388
- The GitHub Actions workflow is ready to use
7489
- Update repository secrets as needed
7590
- Configure deployment targets
@@ -105,6 +120,7 @@ make build
105120
## 🤝 Support
106121

107122
If you encounter issues with the template:
123+
108124
1. Check the existing issues in this repository
109125
2. Create a new issue with detailed information
110126
3. Consider contributing back improvements

0 commit comments

Comments
 (0)