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

https://github.com/serverless-operations/todo-app-using-spec-kit


https://github.com/serverless-operations/todo-app-using-spec-kit

Last synced: 9 months ago
JSON representation

Awesome Lists containing this project

README

          

# TODO Task Management System

A full-stack task management application with Japanese language support, built with TypeScript, React, and Express.js.

## Features

- βœ… Create, read, update, and delete tasks
- πŸ“… Set deadlines for tasks
- ⚠️ Visual warnings for approaching and overdue deadlines
- βœ“ Mark tasks as completed
- πŸ‡―πŸ‡΅ Japanese date formatting (YYYYεΉ΄MM月DDζ—₯ HH:mm)
- πŸ“± Responsive web interface
- πŸš€ Real-time updates with React Query

### Deadline Warnings
- **Yellow highlight**: Tasks due within 3 days (ζœŸι™γŒθΏ‘γ₯いています)
- **Red highlight**: Overdue tasks (ζœŸι™γ‚’ιŽγŽγ¦γ„γΎγ™)

## Tech Stack

### Backend
- Node.js 22
- Express.js 5
- TypeScript
- SQLite3 (better-sqlite3)
- Zod for validation
- Winston for logging

### Frontend
- React 19
- TypeScript
- React Router v7
- React Query (TanStack Query)
- Vite
- Axios

## Prerequisites

- Node.js 22.x or higher
- npm 11.x or higher

## Installation

1. Clone the repository:
```bash
git clone https://github.com/serverless-operations/todo-app-using-spec-kit.git
cd todo-app
```

2. Install dependencies:
```bash
# Install all dependencies (root, backend, and frontend)
npm run install:all
```

## Development

### Run both backend and frontend:
```bash
npm run dev
```

This will start:
- Backend API server on http://localhost:4000
- Frontend dev server on http://localhost:5173

### Run services individually:

Backend only:
```bash
npm run dev:backend
```

Frontend only:
```bash
npm run dev:frontend
```

## Building for Production

```bash
# Build both backend and frontend
npm run build

# Start production server
npm run start
```

## Testing

### Run all tests:
```bash
npm run test
```

### Run backend tests:
```bash
npm run test:backend
```

### Run frontend tests:
```bash
npm run test:frontend
```

### Test Coverage:
```bash
cd backend && npm run test:coverage
cd frontend && npm run test:coverage
```

## Project Structure

```
todo-app/
β”œβ”€β”€ backend/
β”‚ β”œβ”€β”€ src/
β”‚ β”‚ β”œβ”€β”€ db/ # Database initialization
β”‚ β”‚ β”œβ”€β”€ middleware/ # Express middleware
β”‚ β”‚ β”œβ”€β”€ models/ # Data models and validation
β”‚ β”‚ β”œβ”€β”€ routes/ # API routes
β”‚ β”‚ β”œβ”€β”€ services/ # Business logic
β”‚ β”‚ β”œβ”€β”€ types/ # TypeScript types
β”‚ β”‚ └── utils/ # Utility functions
β”‚ β”œβ”€β”€ tests/
β”‚ β”‚ β”œβ”€β”€ contract/ # API contract tests
β”‚ β”‚ β”œβ”€β”€ integration/ # Integration tests
β”‚ β”‚ └── unit/ # Unit tests
β”‚ └── data/ # SQLite database file
β”œβ”€β”€ frontend/
β”‚ β”œβ”€β”€ src/
β”‚ β”‚ β”œβ”€β”€ components/ # React components
β”‚ β”‚ β”œβ”€β”€ hooks/ # Custom React hooks
β”‚ β”‚ β”œβ”€β”€ pages/ # Page components
β”‚ β”‚ β”œβ”€β”€ providers/ # Context providers
β”‚ β”‚ β”œβ”€β”€ services/ # API services
β”‚ β”‚ └── types/ # TypeScript types
β”‚ └── tests/ # Frontend tests
β”œβ”€β”€ docs/ # Documentation
└── specs/ # Specifications

```

## API Documentation

See [docs/api.md](docs/api.md) for detailed API documentation.

### Quick API Reference

| Method | Endpoint | Description |
|--------|----------|-------------|
| GET | `/api/tasks` | Get all active tasks |
| GET | `/api/tasks/completed` | Get completed tasks |
| GET | `/api/tasks/:id` | Get task by ID |
| POST | `/api/tasks` | Create new task |
| PUT | `/api/tasks/:id` | Update task |
| DELETE | `/api/tasks/:id` | Delete task |
| PATCH | `/api/tasks/:id/complete` | Mark task as complete |

## Environment Variables

### Backend (.env)
```
PORT=4000
FRONTEND_URL=http://localhost:5173
```

### Frontend (.env)
```
VITE_API_URL=http://localhost:4000
```

## Database

The application uses SQLite for data persistence. The database file is automatically created at `backend/data/tasks.db` on first run.

### Database Schema

```sql
CREATE TABLE tasks (
id TEXT PRIMARY KEY,
content TEXT NOT NULL,
deadline TEXT NOT NULL,
status TEXT NOT NULL,
created_at TEXT NOT NULL,
completed_at TEXT
)
```

## Scripts

### Root package.json
- `npm run dev` - Run both backend and frontend in development mode
- `npm run build` - Build both backend and frontend
- `npm run start` - Start production server
- `npm run test` - Run all tests
- `npm run install:all` - Install all dependencies

### Backend Scripts
- `npm run dev` - Start development server with hot reload
- `npm run build` - Compile TypeScript to JavaScript
- `npm run start` - Start production server
- `npm run test` - Run tests
- `npm run db:init` - Initialize database

### Frontend Scripts
- `npm run dev` - Start Vite dev server
- `npm run build` - Build for production
- `npm run preview` - Preview production build
- `npm run lint` - Run ESLint

## Contributing

1. Fork the repository
2. Create your feature branch (`git checkout -b feature/amazing-feature`)
3. Commit your changes (`git commit -m 'Add some amazing feature'`)
4. Push to the branch (`git push origin feature/amazing-feature`)
5. Open a Pull Request

## License

This project is licensed under the MIT License.

## Acknowledgments

Built with [Spec-Driven Development](https://github.com/serverless-operations/spec-kit) methodology.