Skip to content

Added a secure REST API endpoint /api/tasks to return the authenticated user’s tasks in JSON format. Implemented JWT-based authentication with Spring Boot and Spring Security to protect user data and ensure only authorized access.

Notifications You must be signed in to change notification settings

DeadOutside1/ToDoList

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

📝 ToDo App (Spring Boot + JWT + JSP)

Простое веб-приложение для управления задачами (ToDo), с аутентификацией через JWT и JSP-интерфейсом.


🚀 Функциональность

  • 🔐 Регистрация и вход с JWT токенами
  • ✅ CRUD для задач (создание, просмотр, редактирование, удаление)
  • 👤 Привязка задач к пользователю
  • 🌐 JSP-страницы с Bootstrap-оформлением
  • 🧠 REST API + защита через JWT
  • 🔄 Обновление access token с помощью refresh token

🧰 Технологии

  • Java 17+
  • Spring Boot
  • Spring Security (с JWT)
  • JSP + JSTL + Bootstrap
  • Maven
  • H2 (встроенная БД, можно сменить на PostgreSQL)

⚙️ Установка и запуск проекта

1. Клонировать проект

git clone https://github.com/твоя-ссылка.git
cd ToDoApp

2. Собрать проект
mvn clean install

3. Запустить приложение
mvn spring-boot:run

Приложение будет доступно по адресу:
📍 http://localhost:8091/login

🧑‍💻 REST API

  • POST /api/auth/authenticate Content-Type: application/json

{ "username": "admin", "password": "admin" }

♻️ Обновление токена

  • POST /api/auth/refresh-token Authorization: Bearer {refreshToken}

📋 Получить задачи

  • GET /api/tasks Authorization: Bearer {accessToken}

🗂️ Структура проекта

-src

  • ├── controller ├── model ├── repo ├── security ├── service └── templates (JSP)

📌 Примечание

  • ✅ Можно переключить на PostgreSQL, просто измени application.properties

  • 🔐 JWT access token хранится в localStorage, можно подключить refresh token обновление

About

Added a secure REST API endpoint /api/tasks to return the authenticated user’s tasks in JSON format. Implemented JWT-based authentication with Spring Boot and Spring Security to protect user data and ensure only authorized access.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages