Skip to content

About

Golang RestAPI toDo App with basic authenticatin | JWT |

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

9 Commits

Folders and files

Repository files navigation

ToDo App with JWT Authentication

Go ToDo App Banner

A secure and lightweight RESTful API ToDo Application built with Go (Golang). This project implements a clean architecture and features user authentication and authorization using JWT (JSON Web Token).


🛠 Features

  • User Authentication: Secure Sign Up, Login, and Logout using JWT tokens.
  • ToDo CRUD Operations: Complete task management capabilities (Create, Read, Update, Delete) mapped to specific users.
  • Database Migrations: Structured database schema tracking via SQL migration scripts.
  • Live Reloading: Hot reloading during development enabled through the Air toolkit.

🚀 Getting Started (Step-by-Step)

Follow these step-by-step instructions to get a local copy of the project up and running on your machine.

Step 1: Clone the Repository

Clone the project from GitHub and navigate into the project directory:

git clone [https://github.com/hyper-lynn/ToDoAppwithJWT.git](https://github.com/hyper-lynn/ToDoAppwithJWT.git)
cd ToDoAppwithJWT

Step 2: Configure Environment Variables

The application requires several environment configurations to run properly.Create a file named .env in the root directory of the project and populate it with the following environment variables. Adjust the database credentials to match your local setup:

DATABASE_URL=postgres://username:password@localhost:5432/todo_api?sslmode=disable
PORT=8080
JWT_SECRET=your_screte_key

Step 3: Download Dependencies

Initialize and download all the required Go modules and external libraries:

go mod download

Step 4: Run the Application

You can spin up the application using either standard Go commands or the live-reload tool.

Option A: Using Standard Go Command

go run cmd/api/main.go

Option B: Using Air (Live Reload)

The project comes pre-configured with .air.toml. If you have Air installed, simply run:

air

📂 Project Structure

├── cmd/
│   └── api/             # Main entry point of the application (main.go)
├── internal/            # Core business logic, Handlers, Controllers, and Repositories
├── migrations/          # SQL migration files for structured database setup
├── scripts/             # Internal helper scripts
├── .air.toml            # Air tool configuration for live-reload development
└── go.mod               # Go modules dependency file

About

Golang RestAPI toDo App with basic authenticatin | JWT |

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages