Skip to content

Repository files navigation

Todo

A full-stack task and project management app built with Next.js 16, featuring epics, projects, categories, comments, and drag-and-drop reordering.

Tech Stack

  • Next.js 16 (App Router)
  • NextAuth v5 (Credentials provider)
  • Tailwind CSS v4 (CSS-first config)
  • Neon Postgres (optional -- runs in-memory by default)
  • TypeScript 5

Quick Start

git clone <repo-url>
cd todo
npm install
npm run dev

Open http://localhost:3000. The app runs with an in-memory stub database by default -- no external services needed. Data resets on restart.

Default Login

  • Email: nick@example.com
  • Password: password

Database Setup (Optional)

To persist data with Postgres (Neon or any Postgres provider):

  1. Copy .env.example to .env and fill in DATABASE_URL and AUTH_SECRET.
  2. Run schema.sql against your database to create tables.
  3. Seed users: npm run seed:users (edit scripts/seed-users.ts first).

The app auto-detects: if DATABASE_URL is set, it uses Postgres; otherwise it falls back to the in-memory stub.

API Access (Bearer Tokens)

All API routes require authentication. You can call APIs with either your normal app session cookie or a bearer token.

Create/revoke tokens in Settings -> API Tokens (/settings). New tokens are shown only once.

Token settings

  • AUTH_SECRET is used to sign/verify API JWTs.
  • API_TOKEN_EXPIRY_DAYS controls default token expiry (default: 90).

Example

curl -H "Authorization: Bearer <your-token>" \
  http://localhost:3000/api/tasks

Create token via API:

curl -X POST http://localhost:3000/api/users/me/tokens \
  -H "Authorization: Bearer <your-token>" \
  -H "Content-Type: application/json" \
  -d '{"label":"CLI token","expiry_days":90}'

Architecture

src/
  app/
    api/            # REST API routes (auth, categories, epics, projects, tasks, users)
    api-docs/       # Swagger UI (visit /api-docs)
    components/     # React components
    login/          # Auth page
  auth.ts           # NextAuth v5 config
  middleware.ts     # Route protection
  lib/
    db/
      adapter.ts    # DbAdapter interface
      index.ts      # Active adapter (swap implementations here)
      stub.ts       # In-memory stub (default)
    task-types.ts   # Shared TypeScript types
    task-utils.ts   # Utility functions
  hooks/            # Custom React hooks

Scripts

Command Description
npm run dev Start dev server on port 3000
npm run build Production build
npm run lint ESLint (flat config)
npm run format Prettier
npm run seed:users Seed users into Postgres

License

MIT

About

a todo list for you can share with your AI agents

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages