Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

Repository files navigation

📝 Go Task API

A simple RESTful Task Management API built with Go (Golang) using:

  • Gin – HTTP web framework
  • GORM – ORM for PostgreSQL
  • JWT – JSON Web Token authentication
  • PostgreSQL (via Docker or Homebrew)
  • RESTful best practices and modular architecture

📦 Features

  • ✅ User Registration & Login (with hashed passwords)
  • ✅ JWT-based Authentication
  • ✅ Create / Read / Update / Delete (CRUD) Tasks
  • ✅ Middleware-protected routes
  • ✅ PostgreSQL integration via GORM

🚀 Getting Started

1. Install Postgres DB

docker run --name pg-container
-e POSTGRES_USER=yourusername
-e POSTGRES_PASSWORD=yourpassword
-e POSTGRES_DB=taskdb
-p 5432:5432
-d postgres

2. Clone the repo

git clone https://github.com/yourusername/go-task-api.git
cd go-task-api
go mod tidy
go run main.go

 - Register
curl -X POST http://localhost:8080/api/auth/register \
  -H "Content-Type: application/json" \
  -d '{"username":"bismayam","password":"secret"}'

- Login
curl -X POST http://localhost:8080/api/auth/login \
  -H "Content-Type: application/json" \
  -d '{"username":"bismayam","password":"secret"}'

- Create Task 
curl -X POST http://localhost:8080/api/tasks \
  -H "Authorization: Bearer <jwt-token>" \
  -H "Content-Type: application/json" \
  -d '{"title":"Test", "description":"Test Task", "completed":false}'

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages