An open API service indexing awesome lists of open source software.

https://github.com/inoles/springtasker

task management app built with Spring Boot, Kotlin, and H2 database, featuring CRUD operations
https://github.com/inoles/springtasker

backend crud h2-database jwt kotlin spring-boot spring-security spring-security-jwt sprintboot task-management web-development

Last synced: 3 months ago
JSON representation

task management app built with Spring Boot, Kotlin, and H2 database, featuring CRUD operations

Awesome Lists containing this project

README

        

# SpringTasker - Spring Boot & Kotlin πŸš€

SpringTasker is a task management application built using Spring Boot and Kotlin. It supports both session-based authentication with CSRF protection for form-based logins and JWT-based authentication for API access. The application leverages H2 Database for persistence and follows clean, modular design principles for efficient task management.

## Features 🌟

### User Authentication & Authorization

- Session-based login/logout for UI users
- JWT-based authentication for API clients

### Managing Tasks

- Create, edit, and delete tasks
- Mark tasks as completed
- Set priority levels (Low, Medium, High)

### Security Enhancements

- CSRF protection for form logins
- Stateless JWT-based authentication for APIs

## Technologies Used πŸ› οΈ

- **Kotlin**: Primary language
- **Spring Boot**: Framework for rapid development
- **Spring Security**: Authentication and authorization
- **JWT (JSON Web Token)**: Secure API authentication
- **H2 Database**: Lightweight, embedded database
- **Thymeleaf**: Server-side template engine for UI
- **Gradle**: Build tool for dependency management

## Authentication Methods πŸ”

| Endpoint | Authentication Method | Notes |
| --------------------- | ---------------------------------- | --------------------- |
| `/login`, `/register` | Session-based with CSRF protection | For UI users |
| `/api/auth/*` | JWT-based Authentication | For API clients |
| `/logout` | Invalidates session and JWT | Supports both methods |

## Getting Started πŸ’‘

### Prerequisites

- JDK 17 or higher
- Gradle installed
- Your favorite IDE (IntelliJ IDEA recommended)

### Running the Application

1. Clone the repository:
```bash
git clone https://github.com/iNoles/SpringTasker.git
cd SpringTasker
```
2. Build the project:
```bash
./gradlew build
```
3. Run the application:

```bash
./gradlew bootRun
```

4. Open your browser and navigate to:
```arduino
http://localhost:8080
```

## API Endpoints πŸ“‘

### Authentication

| Method | Endpoint | Description |
| ------ | -------------------- | --------------------------- |
| POST | `/api/auth/login` | Login and receive JWT token |
| POST | `/api/auth/register` | Register a new user |
| POST | `/api/auth/logout` | Invalidate JWT token |

### Task Management

| Method | Endpoint | Description |
| ------ | ----------------- | ----------------------------- |
| GET | `/api/tasks/` | Get all tasks by current user |
| POST | `/api/tasks/add` | Add a new task |
| PUT | `/api/tasks/{id}` | Update a task |
| DELETE | `/api/tasks/{id}` | Delete a task |

## Roadmap πŸ›€οΈ

Here’s what’s coming next:

1. Deployment
- Deploy the project on a public site for easy access
2. Database Integration
- Upgrade from H2 to a production-grade database (PostgreSQL or MySQL)

## Contributions 🀝

This project is a work in progress, and contributions are welcome! Feel free to:

- Submit issues for bugs or feature suggestions
- Open pull requests to contribute directly