{"id":21871092,"url":"https://github.com/isaka-james/go-server","last_synced_at":"2025-04-14T23:55:33.020Z","repository":{"id":243827812,"uuid":"813554181","full_name":"isaka-james/go-server","owner":"isaka-james","description":"Your One to Go golang server template","archived":false,"fork":false,"pushed_at":"2024-06-11T11:17:40.000Z","size":13,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-14T23:55:19.322Z","etag":null,"topics":["api","backend","go-server","postgres","server","server-template"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/isaka-james.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2024-06-11T09:47:50.000Z","updated_at":"2025-01-23T13:51:36.000Z","dependencies_parsed_at":"2024-06-12T11:00:24.028Z","dependency_job_id":null,"html_url":"https://github.com/isaka-james/go-server","commit_stats":null,"previous_names":["isaka-james/go-server"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/isaka-james%2Fgo-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/isaka-james%2Fgo-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/isaka-james%2Fgo-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/isaka-james%2Fgo-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/isaka-james","download_url":"https://codeload.github.com/isaka-james/go-server/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248981261,"owners_count":21193144,"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","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":["api","backend","go-server","postgres","server","server-template"],"created_at":"2024-11-28T06:13:22.769Z","updated_at":"2025-04-14T23:55:33.001Z","avatar_url":"https://github.com/isaka-james.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Go Server Template\n\nWelcome to the Go Server Template repository! 🎉\n\n*This repository serves as a template for creating a new Golang server. It is designed to save you time and effort by providing a solid starting point so that you don't have to write your Golang server from scratch every time.*\n\n## Features\n\n- **Structured Project Layout**: A well-organized project structure that follows best practices.\n- **Router Setup**: Pre-configured routing using popular routing libraries.\n- **Middleware**: Basic middleware included for logging, authentication, etc.\n- **Configuration Management**: Easy configuration management using environment variables.\n- **Error Handling**: Standardized error handling across the application.\n- **Database Integration**: Boilerplate code for PostgreSQL integration.\n- **Testing**: Example unit and integration tests to get you started.\n- **Docker Support**: Dockerfile included for containerized deployments.\n\n## Getting Started\n\n### Prerequisites\n\n- [Go](https://golang.org/doc/install) (version 1.22+)\n- [Git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git)\n- [Docker](https://docs.docker.com/get-docker/) (optional, for containerization)\n\n### Installation\n\n1. **Clone the repository:**\n\n    ```sh\n    git clone https://github.com/isaka-james/go-server.git\n    cd go-server\n    ```\n\n2. **Install dependencies:**\n\n    ```sh\n    go mod tidy\n    ```\n\n3. **Set up environment variables:**\n\n    Edit the `.env` file in the root directory with your configurations:\n\n    ```env\n    # THESE ARE POSTGRES CONFIG\n    SERVERNAME_DB=localhost\n    USERNAME_DB=admin\n    PASSWORD_DB=group7\n    DATABASE=mydb\n    PORT_DB=5432\n\n    PORT_SERVER=80\n    ```\n\n4. **Run the server:**\n\n    ```sh\n    go run main.go\n    ```\n\n    The server should now be running on `http://localhost:80`.\n\n\n### Using Docker\n\n1. **Build the Docker image:**\n\n    ```sh\n    docker build -t go-server-template .\n    ```\n\n2. **Run the Docker container:**\n\n    ```sh\n    docker run -p 80:80 go-server-template\n    ```\n\n    The server should now be running on `http://localhost:80`.\n\n## Project Structure\n\n```plaintext\ngo-server/\n├── README.md\n├── api\n│   ├── config\n│   │   └── config.go\n│   ├── handlers\n│   │   ├── login_handler.go\n│   │   └── notification_handler.go\n│   ├── models\n│   │   ├── credentials.go\n│   │   ├── post.go\n│   │   ├── responses.go\n│   │   └── user.go\n│   ├── routes.go\n│   ├── scripts\n│   │   └── mydb.sql\n│   └── utils\n│       └── database.go\n├── go.mod\n├── go.sum\n└── main.go\n```\n\n- `api/`: Main directory for API-related code.\n  - `config/`: Configuration management.\n  - `handlers/`: Request handlers.\n  - `models/`: Database models.\n  - `scripts/`: SQL scripts.\n  - `utils/`: Utility functions.\n- `go.mod` and `go.sum`: Go modules files.\n- `main.go`: Entry point of the application.\n\n\n\n## Contributing\n\nContributions are welcome! Feel free to open an issue or submit a pull request.\n\n\n  \u003cp\u003e\n    \u003cimg src=\"https://komarev.com/ghpvc/?username=go-server\u0026label=Project%20views\u0026color=0e75b6\u0026style=flat\" alt=\"since 15 May,2024\" /\u003e\n  \u003c/p\u003e\n\n## License\n\nThis project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fisaka-james%2Fgo-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fisaka-james%2Fgo-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fisaka-james%2Fgo-server/lists"}