{"id":19004382,"url":"https://github.com/asrez/goapiblog","last_synced_at":"2025-10-12T16:24:31.861Z","repository":{"id":180991850,"uuid":"665504451","full_name":"Asrez/GoAPIBlog","owner":"Asrez","description":"This project is a RESTful API built in Go language that serves as the backend for a blogging system. It provides endpoints for creating, retrieving, updating, and deleting blog posts.","archived":false,"fork":false,"pushed_at":"2025-04-21T22:39:53.000Z","size":288,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-03T23:38:14.593Z","etag":null,"topics":["api","api-blog","api-go","blog","blog-go","go","go-api","go-blog"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Asrez.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,"zenodo":null}},"created_at":"2023-07-12T10:54:53.000Z","updated_at":"2025-04-21T22:39:51.000Z","dependencies_parsed_at":"2025-06-07T23:03:47.365Z","dependency_job_id":null,"html_url":"https://github.com/Asrez/GoAPIBlog","commit_stats":null,"previous_names":["asrez/goapiblog"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Asrez/GoAPIBlog","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Asrez%2FGoAPIBlog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Asrez%2FGoAPIBlog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Asrez%2FGoAPIBlog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Asrez%2FGoAPIBlog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Asrez","download_url":"https://codeload.github.com/Asrez/GoAPIBlog/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Asrez%2FGoAPIBlog/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279011997,"owners_count":26085040,"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":"2025-10-12T02:00:06.719Z","response_time":53,"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":["api","api-blog","api-go","blog","blog-go","go","go-api","go-blog"],"created_at":"2024-11-08T18:22:58.814Z","updated_at":"2025-10-12T16:24:31.830Z","avatar_url":"https://github.com/Asrez.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Blogging System API\n\nThis project is a RESTful API built in Go language that serves as the backend for a blogging system. It provides endpoints for creating, retrieving, updating, and deleting blog posts.\n\n## Features\n\n- User authentication and authorization using JSON Web Tokens (JWT)\n- CRUD operations for blog posts\n- Pagination and sorting of blog posts\n- Error handling and response formatting\n- Input validation and data sanitization\n- Logging and request/response middleware\n- Database integration using PostgreSQL\n\n## Installation\n\nMake sure you have Go installed on your system. You can download and install it from the official Go website: https://golang.org\n\nClone the repository:\n\n```bash\ngit clone https://github.com/Asrez/GoAPIBlog.git\n```\n\nChange to the project directory:\n\n```bash\ncd GoAPIBlog\n```\n\nInstall the project dependencies:\n\n```bash\ngo mod download\n```\n\nSet up the environment variables:\n\n- Create a `.env` file in the root directory of the project.\n\n- Define the following environment variables in the `.env` file:\n\n```plaintext\nPORT=3000\nDB_HOST=your_database_host\nDB_PORT=your_database_port\nDB_USER=your_database_user\nDB_PASSWORD=your_database_password\nDB_NAME=your_database_name\nJWT_SECRET=your_jwt_secret\n```\n\nBuild and run the application:\n\n```bash\ngo build\n./blogging-api\n```\n\nThe API will be accessible at http://localhost:3000 by default. You can change the port in the .env file if necessary.\n\n## API Endpoints\n\nThe following endpoints are available in the API:\n\n| Method | \tEndpoint | \tDescription |\n| ---- | -------- | -------- |\n| POST |\t/api/auth/register\t| Register a new user |\n| POST |\t/api/auth/login\t| Log in and obtain JWT |\n| GET |\t/api/posts\t| Get all blog posts |\n| POST |\t/api/posts\t| Create a new blog post |\n| GET |\t/api/posts/:id\t| Get a specific blog post |\n| PUT |\t/api/posts/:id\t| Update a specific blog post |\n| DELETE |\t/api/posts/:id\t| Delete a specific blog post |\n\n## Database Schema\n\nThe application uses a PostgreSQL database with the following schema:\n\n```sql\nCREATE TABLE IF NOT EXISTS users (\n    id SERIAL PRIMARY KEY,\n    username VARCHAR(50) NOT NULL,\n    email VARCHAR(255) NOT NULL,\n    password VARCHAR(255) NOT NULL,\n    created_at TIMESTAMP NOT NULL DEFAULT NOW()\n);\n\nCREATE TABLE IF NOT EXISTS posts (\n    id SERIAL PRIMARY KEY,\n    title VARCHAR(255) NOT NULL,\n    content TEXT NOT NULL,\n    author_id INT NOT NULL,\n    created_at TIMESTAMP NOT NULL DEFAULT NOW(),\n    updated_at TIMESTAMP\n);\n```\n\n## Dependencies\n\nThe project utilizes the following third-party libraries:\n\n- `gin-gonic/gin`: HTTP web framework\n- `joho/godotenv`: Environment variable loading\n- `dgrijalva/jwt-go`: JWT implementation\n- `go-pg/pg`: PostgreSQL ORM\n- `go-pg/pgext`: PostgreSQL extensions for go-pg\n- `google/uuid`: UUID generation\n- `go-playground/validator/v10`: Struct field validation\n\nMake sure to run go mod download as mentioned in the installation steps to fetch these dependencies.\n\n## Contributing\n\nContributions to this project are welcome. Feel free to open issues and submit pull requests.\n\n## License\n\nThis project is licensed under the GPL-3.0 License.\n\n# Postman collection\n\n[postman](https://documenter.getpostman.com/view/20769678/2s946e9Ynx)\n\nCopyright 2023, Max Base\n\nCopyright 2023, Asrez group\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fasrez%2Fgoapiblog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fasrez%2Fgoapiblog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fasrez%2Fgoapiblog/lists"}