This is a simple TodoList application built using the Go programming language and the Gin web framework. The application provides a simple user interface for managing your tasks and also exposes a RESTful API for task management. It utilizes PostgreSQL and MySQL databases for storing task data and implements JWT-based authentication for API access.
-
Task Management: This application allows you to perform the following tasks:
- Add new tasks
- Remove tasks
- Edit tasks
-
User Authentication: User authentication is implemented using JSON Web Tokens (JWT) to secure the API endpoints.
-
Database Support: This application supports both PostgreSQL and MySQL databases for task data storage.
Before you can run this application, you'll need to have the following prerequisites installed:
-
Clone the repository:
git clone https://github.com/abdoroot/todolist
-
Change the directory to your project:
cd todolist
-
Create a configuration file
config.go
: -
Install the required dependencies:
go mod tidy
-
Run the application:
go run main.go
The application will start on the specified port (default is 8080). You can access the UI by opening a web browser and navigating to http://localhost:8080
. The RESTful API is available at http://localhost:8080/api
.
POST /api/login
: Login with a JSON request containing a username and password to receive a JWT token for authentication.
GET /api/tasks
: Retrieve a list of tasks.POST /api/tasks
: Create a new task.PUT /api/tasks/:id
: Update an existing task by ID.DELETE /api/tasks/:id
: Delete a task by ID.
The database schema includes a table to store tasks. You can find the SQL schema in the schema
directory for both PostgreSQL and MySQL.
This project is licensed under the MIT License - see the LICENSE.md file for details.
- This application is built with the Go programming language and the Gin web framework.
- Authentication is implemented using JWT (JSON Web Tokens).
- Database support includes PostgreSQL and MySQL.
Please feel free to contribute to this project, report issues, or suggest improvements.