Error in user YAML: (<unknown>): found character that cannot start any token while scanning for the next token at line 9 column 1
---
## Getting Started
### Prerequisites
- Java 17+
- Maven 3.9+
- PostgreSQL 18
### 1. Clone the repository
```bash
git clone https://github.com/manishaagangadevi/taskflow-api.git
cd taskflow-api
```
### 2. Create the database
```sql
CREATE DATABASE taskflowdb;
```
### 3. Configure application.yaml
```yaml
spring:
datasource:
url: jdbc:postgresql://localhost:5432/taskflowdb
username: postgres
password: your_password
```
### 4. Run the application
```bash
mvn spring-boot:run
```
API will be available at `http://localhost:8080`
### Run with Docker
```bash
docker build -t taskflow-api .
docker run -p 8080:8080 \
-e SPRING_DATASOURCE_URL=jdbc:postgresql://host.docker.internal:5432/taskflowdb \
-e SPRING_DATASOURCE_PASSWORD=postgres \
taskflow-api
```
---
POST /api/auth/register
Content-Type: application/json
{
"name": "Manisha Gangadevi",
"email": "manisha@example.com",
"password": "securepassword"
}Response
{
"token": "eyJhbGciOiJIUzI1NiJ9...",
"email": "manisha@example.com",
"role": "ROLE_USER"
}POST /api/auth/login
Content-Type: application/json
{
"email": "manisha@example.com",
"password": "securepassword"
}All task endpoints require
Authorization: Bearer <token>header
POST /api/tasks
Authorization: Bearer <token>
Content-Type: application/json
{
"title": "Complete project documentation",
"description": "Write API docs and README",
"priority": "HIGH",
"status": "TODO",
"dueDate": "2026-06-01T00:00:00"
}GET /api/tasks?page=0&size=10&sortBy=createdAt
Authorization: Bearer <token>GET /api/tasks?status=TODO
Authorization: Bearer <token>GET /api/tasks?priority=HIGH
Authorization: Bearer <token>GET /api/tasks/{id}
Authorization: Bearer <token>PUT /api/tasks/{id}
Authorization: Bearer <token>
Content-Type: application/json
{
"title": "Updated title",
"status": "IN_PROGRESS",
"priority": "MEDIUM"
}DELETE /api/tasks/{id}
Authorization: Bearer <token>All errors follow a consistent format:
{
"timestamp": "2026-05-26T10:30:00",
"status": 404,
"message": "Task not found"
}| Status Code | Meaning |
|---|---|
| 400 | Bad Request / Validation Error |
| 401 | Unauthorized — missing or invalid token |
| 403 | Forbidden — access to another user's resource |
| 404 | Resource not found |
-- users table
CREATE TABLE users (
id BIGINT PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY,
name VARCHAR(255) NOT NULL,
email VARCHAR(255) NOT NULL UNIQUE,
password VARCHAR(255) NOT NULL,
role VARCHAR(50)
);
-- tasks table
CREATE TABLE tasks (
id BIGINT PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY,
title VARCHAR(255) NOT NULL,
description VARCHAR(255),
status VARCHAR(50),
priority VARCHAR(50),
due_date TIMESTAMP,
created_at TIMESTAMP,
user_id BIGINT REFERENCES users(id)
);