Basic Todo Rest-API with Authentication in Go
goDo is a simple REST API for managing todo tasks with authentication, built using Go. The project is designed to provide a basic foundation for building more complex applications.
- User authentication (login and register)
- CRUD operations for todo tasks
- User management with the ability to view and update user information
- Structured using Go and the chi router
- PostgreSQL database integration via GORM
- Go 1.23.1 or later
- PostgreSQL
-
Clone the repository:
git clone https://github.com/mcfiet/goDo.git cd goDo -
Install dependencies:
go mod download
-
Set up the PostgreSQL database and update the configuration in the
dbpackage. -
Run the application:
go run main.go
The server will start on http://localhost:3000.
POST /login- Authenticate a userPOST /register- Register a new user
GET /todos- Retrieve all todosPOST /todos- Create a new todoGET /todos/{id}- Retrieve a specific todoPUT /todos/{id}- Update a specific todoDELETE /todos/{id}- Delete a specific todo
GET /users/{id}- Retrieve a specific user by IDGET /users- Retrieve all usersPOST /users- Create a new userPUT /users- Update user information