{"id":35483522,"url":"https://github.com/joseph-ogutu/ai-capstone-project","last_synced_at":"2026-01-03T14:05:16.727Z","repository":{"id":329095386,"uuid":"1118088242","full_name":"Joseph-Ogutu/AI-Capstone-Project","owner":"Joseph-Ogutu","description":"A beginner-friendly Go web development project showcasing fundamental HTTP server implementation using Go's net/http package. This project demonstrates how to build simple yet robust web services with clean, idiomatic Go code.","archived":false,"fork":false,"pushed_at":"2025-12-17T08:57:00.000Z","size":4407,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-12-20T21:58:33.424Z","etag":null,"topics":["backend","beginner","go","golang","http","tutorial","webserver"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Joseph-Ogutu.png","metadata":{"files":{"readme":"ReadMe.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-12-17T08:45:24.000Z","updated_at":"2025-12-17T09:19:27.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/Joseph-Ogutu/AI-Capstone-Project","commit_stats":null,"previous_names":["joseph-ogutu/ai-capstone-project"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/Joseph-Ogutu/AI-Capstone-Project","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Joseph-Ogutu%2FAI-Capstone-Project","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Joseph-Ogutu%2FAI-Capstone-Project/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Joseph-Ogutu%2FAI-Capstone-Project/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Joseph-Ogutu%2FAI-Capstone-Project/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Joseph-Ogutu","download_url":"https://codeload.github.com/Joseph-Ogutu/AI-Capstone-Project/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Joseph-Ogutu%2FAI-Capstone-Project/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28190272,"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","status":"online","status_checked_at":"2026-01-03T02:00:06.471Z","response_time":75,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["backend","beginner","go","golang","http","tutorial","webserver"],"created_at":"2026-01-03T14:04:31.405Z","updated_at":"2026-01-03T14:05:16.721Z","avatar_url":"https://github.com/Joseph-Ogutu.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Getting Started with Go HTTP Programming – A Beginner's Guide\n\n## 1. Title \u0026 Objective\n\n**Technology I used:**  \nGo (Golang) HTTP programming\n\n**Why I chose it:**  \nGo is a modern, statically-typed programming language designed for simplicity and efficiency. I chose Go HTTP programming because it provides built-in libraries for creating web servers with minimal boilerplate code, making it perfect for beginners who want to understand backend development fundamentals.\n\nAdditionally, Go powers many essential DevOps tools including:\n- Docker (containerization)\n- Kubernetes (container orchestration) \n- Terraform (infrastructure as code)\n- Prometheus (monitoring)\n- Jenkins-X (CI/CD)\n- Grafana (visualization)\n- ArgoCD (GitOps)\n- Istio (service mesh)\n\nThis makes Go skills highly valuable in DevOps and cloud-native development roles.\n\n**My end goal:**  \nCreate a simple HTTP web server that responds to HTTP requests and demonstrate core Go programming concepts including packages, functions, and the net/http library.\n\n## 2. Quick Summary of the Technology\n\nGo (Golang) is a compiled programming language developed by Google that emphasizes simplicity, concurrency, and performance. The net/http package provides built-in support for HTTP servers and clients.\n\n**What is it?**  \nA programming language with native HTTP capabilities for building web servers and applications.\n\n**Where is it used?**  \nBackend services, APIs, microservices, and web applications (used by companies like Uber, Netflix, and Dropbox).\n\n**One real-world example:**  \nNetflix uses Go for their edge services and content delivery networks due to its efficiency in handling concurrent connections.\n\n## 3. System Requirements\n\n**OS:** Linux/Mac/Windows  \n**Tools/Editors required:** VS Code, GoLand, or any text editor  \n**Go Version:** Go 1.19 or later  \n**Packages:** Standard library only (no external dependencies required)\n\n## 4. Installation \u0026 Setup Instructions\n\n### Step 1: Install Go\n\n**Windows:**\n1. Download installer from https://golang.org/dl/\n2. Run the MSI installer\n3. Verify installation:\n```bash\ngo version\n```\n\n**macOS:**\n```bash\n# Using Homebrew\nbrew install go\n\n# Verify installation\ngo version\n```\n\n**Linux (Ubuntu/Debian):**\n```bash\nsudo apt update\nsudo apt install golang-go\n\n# Verify installation\ngo version\n```\n\n### Step 2: Set Up Your Workspace\n\n1. Create a project directory:\n```bash\nmkdir go-http-demo\ncd go-http-demo\n```\n\n2. Initialize Go module:\n```bash\ngo mod init go-http-demo\n```\n\n### Step 3: Create Your First HTTP Server\n\nCreate a file called `main.go` with the following content:\n\n```go\npackage main\n\nimport (\n    \"fmt\"\n    \"net/http\"\n)\n\nfunc main() {\n    // Register a handler function for the root path\n    http.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n        fmt.Fprintf(w, \"Hello, World!\")\n    })\n\n    fmt.Println(\"Server starting on http://localhost:8080\")\n    \n    // Start the server on port 8080\n    http.ListenAndServe(\":8080\", nil)\n}\n```\n\n### Step 4: Run Your Server\n\n```bash\ngo run main.go\n```\n\nYou should see: \"Server starting on http://localhost:8080\"\n\n### Step 5: Test Your Server\n\nOpen your browser and visit: http://localhost:8080\n\nYou should see: \"Hello, World!\"\n\n## 5. Minimal Working Example\n\n**What the example does:**  \nCreates a simple HTTP server that listens on port 8080 and responds to all HTTP requests with \"Hello, World!\"\n\n**Expected output:**  \n- Terminal: \"Server starting on http://localhost:8080\"\n- Browser: \"Hello, World!\"\n\n**Code with inline comments:**\n\n```go\npackage main\n\nimport (\n    \"fmt\"        // For formatted I/O (printing)\n    \"net/http\"   // HTTP server and client functionality\n)\n\nfunc main() {\n    // Register a handler function for the root path \"/\"\n    http.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n        // Write \"Hello, World!\" to the response\n        fmt.Fprintf(w, \"Hello, World!\")\n    })\n\n    // Print startup message to console\n    fmt.Println(\"Server starting on http://localhost:8080\")\n    \n    // Start HTTP server on port 8080, nil uses default router\n    http.ListenAndServe(\":8080\", nil)\n}\n```\n\n**Key Concepts I learned:**\n\n1. **package main**: Defines this as an executable program\n2. **import**: Imports necessary libraries\n3. **http.HandleFunc**: Registers a function to handle HTTP requests\n4. **http.ResponseWriter**: Interface for writing HTTP responses\n5. **http.Request**: Structure containing request details\n6. **http.ListenAndServe**: Starts the HTTP server\n\n## 6. AI Prompt Journal\n\n### Prompt 1: Basic Go HTTP Server Setup\n**Prompt I used:**  \n\"Give me a simple Go program that creates an HTTP server and responds with 'Hello, World!'\"\n\n**AI's response summary:**  \nThe AI provided a complete, working example using the net/http package with proper package structure and error handling.\n\n**Brief part of the response that addresses the problem:**  \n```go\nhttp.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n    fmt.Fprintf(w, \"Hello, World!\")\n})\n```\n\n**My evaluation of its helpfulness:**  \nVery helpful - provided exactly what I needed with clear, idiomatic Go code. The response included proper imports and the fundamental pattern for creating HTTP handlers.\n\n### Prompt 2: Understanding Go HTTP Concepts\n**Prompt I used:**  \n\"Explain how the net/http package works in Go and what http.HandleFunc does\"\n\n**AI's response summary:**  \nThe AI explained the HTTP handler pattern, how the ResponseWriter and Request interfaces work, and the role of the default router.\n\n**My evaluation of its helpfulness:**  \nVery helpful - clarified the HTTP programming model in Go and helped me understand the relationship between handlers, requests, and responses.\n\n### Prompt 3: Go Project Structure\n**Prompt I used:**  \n\"How should I organize a Go project and what's the difference between go run and go build?\"\n\n**AI's response summary:**  \nExplained Go module structure, the purpose of go.mod files, and the difference between running and building Go applications.\n\n**My evaluation of its helpfulness:**  \nHelpful - provided context for project organization and build processes, though I needed to experiment with both commands to fully understand the difference.\n\n## 7. Common Issues \u0026 Fixes\n\n### Issue 1: \"go: cannot find main module\"\n**Problem:** Trying to run Go files outside a proper module structure  \n**Error:** `go: cannot find main module`  \n**Fix:** Initialize a Go module first:\n```bash\ngo mod init project-name\n```\n\n### Issue 2: Port Already in Use\n**Problem:** Another application is using port 8080  \n**Error:** `listen tcp :8080: bind: address already in use`  \n**Fix:** \n1. Find and stop the process using port 8080\n2. Or change the port number to something else like `:8081`\n\n### Issue 3: Go Not Found\n**Problem:** Go is not installed or not in PATH  \n**Error:** `go: command not found`  \n**Fix:** \n1. Install Go from https://golang.org/dl/\n2. Add Go to your system PATH\n3. Restart your terminal\n\n### Issue 4: Program Starts but Browser Shows Nothing\n**Problem:** Server not running or accessing wrong URL  \n**Troubleshooting:**\n1. Check terminal for startup message\n2. Ensure you're visiting http://localhost:8080 (not https)\n3. Check if port 8080 is accessible\n\n## 8. References\n\n### Official Documentation\n- [Go Official Website](https://golang.org/)\n- [Go net/http Package Documentation](https://golang.org/pkg/net/http/)\n- [Go Tour Tutorial](https://tour.golang.org/)\n\n### Video Links\n- [Go Programming Language Tutorial by TechWithTim](https://www.youtube.com/watch?v=YS4e4q9oBaU)\n- [Golang HTTP Server by Web Dev Simplified](https://www.youtube.com/watch?v=yyUHQIec81I)\n\n### Helpful Blog Posts\n- [A Simple Go Web Server](https://www.alexedwards.net/blog/a-simple-web-server)\n- [Go HTTP Package by Example](https://pkg.go.dev/net/http#example-HandleFunc)\n- [Building Web Applications with Go](https://www.mongodb.com/languages/go)\n\n### Stack Overflow References\n- [Go HTTP Server Questions](https://stackoverflow.com/questions/tagged/go+http)\n- [Common Go HTTP Patterns](https://stackoverflow.com/questions/tagged/go+net-http)\n\n---\n\n## Project Structure\n\n```\ngo-http-demo/\n├── main.go          # Main HTTP server code\n├── go.mod           # Go module file\n└── README.md        # This documentation\n```\n\n## Next Steps\n\n1. **Add More Routes**: Create additional endpoints like `/about`, `/contact`\n2. **Add HTML Templates**: Serve dynamic HTML content\n3. **Add JSON Responses**: Return JSON instead of plain text\n4. **Add Logging**: Implement request logging\n5. **Add Middleware**: Add authentication or rate limiting\n\nThis toolkit provides a solid foundation for learning Go HTTP programming and can be extended to build more complex web applications.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoseph-ogutu%2Fai-capstone-project","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjoseph-ogutu%2Fai-capstone-project","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoseph-ogutu%2Fai-capstone-project/lists"}