{"id":37114445,"url":"https://github.com/sudarshanmg/gotask","last_synced_at":"2026-01-14T13:28:05.640Z","repository":{"id":293339832,"uuid":"983725283","full_name":"sudarshanmg/gotask","owner":"sudarshanmg","description":"A complete backend for Task Manager with JWT Authentication, filtering, sorting and pagination support","archived":false,"fork":false,"pushed_at":"2025-05-16T06:58:33.000Z","size":20,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-22T19:26:34.930Z","etag":null,"topics":["api","api-rest","backend","go","golang","jwt","jwt-authentication","postgresql"],"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/sudarshanmg.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}},"created_at":"2025-05-14T20:22:39.000Z","updated_at":"2025-05-16T06:58:36.000Z","dependencies_parsed_at":"2025-05-14T21:43:47.484Z","dependency_job_id":null,"html_url":"https://github.com/sudarshanmg/gotask","commit_stats":null,"previous_names":["sudarshanmg/gotask"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/sudarshanmg/gotask","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sudarshanmg%2Fgotask","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sudarshanmg%2Fgotask/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sudarshanmg%2Fgotask/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sudarshanmg%2Fgotask/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sudarshanmg","download_url":"https://codeload.github.com/sudarshanmg/gotask/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sudarshanmg%2Fgotask/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28421188,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T10:47:48.104Z","status":"ssl_error","status_checked_at":"2026-01-14T10:46:19.031Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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-rest","backend","go","golang","jwt","jwt-authentication","postgresql"],"created_at":"2026-01-14T13:28:04.855Z","updated_at":"2026-01-14T13:28:05.627Z","avatar_url":"https://github.com/sudarshanmg.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"## 📌 gotask — Secure Task Manager API in Go\n\nA production-ready, modular REST API built with Go, PostgreSQL, and JWT authentication.\n\n---\n\n### ⚙️ Features\n\n- ✅ Clean architecture (handler → service → repository)\n- 🔐 JWT-based authentication (register, login, protect routes)\n- 🗃️ PostgreSQL persistence\n- 📦 CRUD operations on tasks\n- 🔍 Pagination, filtering, and sorting\n- 🧼 Input validation using `go-playground/validator`\n- 🧱 Structured error handling\n- 📁 Environment-based config loading\n\n---\n\n### 📁 Project Structure\n\n```\ngotask/\n├── cmd/\n│   └── server/         # app entrypoint\n├── internal/\n│   ├── auth/           # register, login, jwt\n│   └── task/           # task logic\n├── pkg/\n│   ├── config/         # env loader\n│   ├── db/             # database connection\n│   ├── response/       # response writers\n│   └── validation/     # form validation\n└── .env                # local secrets (not committed)\n```\n\n---\n\n### 🔧 Requirements\n\n- Go 1.21+\n- PostgreSQL\n- Docker (optional)\n\n---\n\n### 🚀 Getting Started\n\n#### 1. Clone the repo\n\n```bash\ngit clone https://github.com/sudarshanmg/gotask.git\ncd gotask\n```\n\n#### 2. Create `.env`\n\n```env\nPORT=8080\nURL=postgres://\u003cuser\u003e:\u003cpassword\u003e@localhost:5432/gotaskdb?sslmode=disable\nJWT_SECRET=yourSuperSecretKey\nJWT_EXPIRY=15m\n```\n\n#### 3. Run Postgres (Docker optional)\n\n```bash\ndocker run -d --name pg \\\n  -p 5432:5432 \\\n  -e POSTGRES_USER=su \\\n  -e POSTGRES_PASSWORD=secret \\\n  -e POSTGRES_DB=gotaskdb \\\n  postgres\n```\n\n#### 4. Create tables\n\n```sql\n-- run in psql\nCREATE TABLE users (\n  id SERIAL PRIMARY KEY,\n  username TEXT UNIQUE NOT NULL,\n  password_hash TEXT NOT NULL,\n  created_at TIMESTAMP DEFAULT NOW()\n);\n\nCREATE TABLE tasks (\n  id SERIAL PRIMARY KEY,\n  title TEXT NOT NULL,\n  description TEXT,\n  completed BOOLEAN DEFAULT false,\n  created_at TIMESTAMP DEFAULT NOW(),\n  updated_at TIMESTAMP DEFAULT NOW()\n);\n```\n\n#### 5. Run the server\n\n```bash\ngo run cmd/server/main.go\n```\n\n---\n\n### 🧪 API Endpoints\n\n#### 🔑 Auth\n\n- `POST /auth/register` – Register user\n- `POST /auth/login` – Login, returns JWT token\n\n#### 📌 Tasks (requires JWT)\n\n- `GET /tasks` – List tasks (supports `?page=1\u0026limit=10\u0026sort=created_at\u0026order=desc`)\n- `POST /tasks` – Create a task\n- `GET /tasks/{id}` – Get task by ID\n- `PUT /tasks/{id}` – Update task\n- `DELETE /tasks/{id}` – Delete task\n\n\u003e 💡 Pass `Authorization: Bearer \u003ctoken\u003e` in headers for protected routes.\n\n---\n\n### 🧭 Roadmap\n\n- [x] JWT auth\n- [x] Filtering \u0026 pagination\n- [ ] Swagger docs\n- [ ] Dockerfile \u0026 Compose setup\n- [ ] Unit \u0026 integration tests\n- [ ] CI/CD via GitHub Actions\n\n---\n\n### 👨‍💻 Author\n\nMade with ❤️ by [@sudarshanmg](https://github.com/sudarshanmg)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsudarshanmg%2Fgotask","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsudarshanmg%2Fgotask","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsudarshanmg%2Fgotask/lists"}