{"id":50277409,"url":"https://github.com/shivansh2904/taskly-api","last_synced_at":"2026-05-27T22:00:34.114Z","repository":{"id":358408599,"uuid":"1241246199","full_name":"Shivansh2904/taskly-api","owner":"Shivansh2904","description":null,"archived":false,"fork":false,"pushed_at":"2026-05-27T13:25:59.000Z","size":74,"stargazers_count":0,"open_issues_count":8,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-27T15:10:45.768Z","etag":null,"topics":["alembic","docker","fastapi","fastify","jwt","postgresql","prisma","pydantic","pytest","python","rest-api","sqlalchemy","typescript"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Shivansh2904.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-05-17T06:19:51.000Z","updated_at":"2026-05-27T13:26:07.000Z","dependencies_parsed_at":null,"dependency_job_id":"46106871-f2f0-4149-82b5-ea796bd232df","html_url":"https://github.com/Shivansh2904/taskly-api","commit_stats":null,"previous_names":["shivansh2904/taskly-api"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/Shivansh2904/taskly-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Shivansh2904%2Ftaskly-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Shivansh2904%2Ftaskly-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Shivansh2904%2Ftaskly-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Shivansh2904%2Ftaskly-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Shivansh2904","download_url":"https://codeload.github.com/Shivansh2904/taskly-api/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Shivansh2904%2Ftaskly-api/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33585203,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-27T02:00:06.184Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["alembic","docker","fastapi","fastify","jwt","postgresql","prisma","pydantic","pytest","python","rest-api","sqlalchemy","typescript"],"created_at":"2026-05-27T22:00:17.771Z","updated_at":"2026-05-27T22:00:34.103Z","avatar_url":"https://github.com/Shivansh2904.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Taskly API\n\n![Python](https://img.shields.io/badge/Python-3.12-3776AB?style=flat\u0026logo=python\u0026logoColor=white)\n![FastAPI](https://img.shields.io/badge/FastAPI-0.115-009688?style=flat\u0026logo=fastapi\u0026logoColor=white)\n![SQLAlchemy](https://img.shields.io/badge/SQLAlchemy-2.0-red?style=flat)\n![PostgreSQL](https://img.shields.io/badge/PostgreSQL-16-4169E1?style=flat\u0026logo=postgresql\u0026logoColor=white)\n![pytest](https://img.shields.io/badge/pytest-8.3-0A9EDC?style=flat\u0026logo=pytest\u0026logoColor=white)\n![Docker](https://img.shields.io/badge/Docker-2496ED?style=flat\u0026logo=docker\u0026logoColor=white)\n![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)\n![CI](https://img.shields.io/github/actions/workflow/status/Shivansh2904/taskly-api/ci.yml?label=CI)\n\n\u003e REST API for a project and task management system — JWT auth with refresh token rotation, projects, tasks with status/priority filtering, and tag management. Built with FastAPI, SQLAlchemy 2, and PostgreSQL.\n\n---\n\n## What it does\n\nTaskly is a backend API that lets users manage projects and tasks. You register, get a short-lived access token and a rotating refresh token, then create projects and fill them with tasks. Each task has a status (`todo`, `in_progress`, `done`), a priority (`low`, `medium`, `high`), and optional tags.\n\nThe main things it demonstrates:\n\n- **JWT auth with refresh token rotation** — access tokens expire after 15 minutes; refresh tokens are single-use and rotated on every call, so a stolen token cannot be reused\n- **SQLAlchemy 2 with mapped types** — uses the modern `Mapped[T]` / `mapped_column()` syntax instead of the older declarative style\n- **Alembic migrations** — database schema is versioned; the initial migration creates all six tables\n- **Pydantic v2 schemas** — request validation and response serialization are fully typed; the `UserCreate` validator enforces minimum password length at the schema level\n- **Ownership checks** — every project and task read/write verifies the calling user owns the resource before touching the database\n- **pytest with SQLite** — tests run against an in-memory SQLite database with no external dependencies, so CI works without a running Postgres instance\n\n---\n\n## Stack\n\n| Layer | Technology |\n|-------|-----------|\n| Framework | FastAPI 0.115 |\n| ORM | SQLAlchemy 2.0 (async-compatible mapped columns) |\n| Migrations | Alembic |\n| Database | PostgreSQL 16 (SQLite for tests) |\n| Auth | python-jose (HS256 JWT) + passlib bcrypt |\n| Validation | Pydantic v2 |\n| Tests | pytest + httpx TestClient |\n| Container | Docker + docker-compose |\n\n---\n\n## API\n\n### Auth\n\n| Method | Path | Description |\n|--------|------|-------------|\n| `POST` | `/auth/register` | Create account, returns access + refresh token |\n| `POST` | `/auth/login` | Login, returns access + refresh token |\n| `POST` | `/auth/refresh` | Exchange refresh token for new token pair (old token is invalidated) |\n| `GET` | `/auth/me` | Get the currently authenticated user |\n\n### Projects\n\nAll project routes require `Authorization: Bearer \u003caccess_token\u003e`.\n\n| Method | Path | Description |\n|--------|------|-------------|\n| `GET` | `/projects` | List your projects (paginated) |\n| `POST` | `/projects` | Create a project |\n| `GET` | `/projects/{id}` | Get a project (includes task count) |\n| `PATCH` | `/projects/{id}` | Update name or description |\n| `DELETE` | `/projects/{id}` | Delete project and all its tasks |\n| `GET` | `/projects/{id}/stats` | Get task counts grouped by status, priority, and overdue |\n\n### Tasks\n\nAll task routes require the calling user to own the parent project.\n\n| Method | Path | Description |\n|--------|------|-------------|\n| `GET` | `/projects/{id}/tasks` | List tasks, filter by `?status=` or `?priority=` |\n| `POST` | `/projects/{id}/tasks` | Create a task with optional tags |\n| `POST` | `/projects/{id}/tasks/bulk` | Create up to 100 tasks in one call |\n| `GET` | `/projects/{id}/tasks/export` | Export all tasks as CSV |\n| `GET` | `/projects/{id}/tasks/{tid}` | Get a task |\n| `PATCH` | `/projects/{id}/tasks/{tid}` | Update title, status, priority, tags |\n| `DELETE` | `/projects/{id}/tasks/{tid}` | Delete a task |\n\n---\n\n## Deploy\n\n[![Deploy to Render](https://render.com/images/deploy-to-render-button.svg)](https://render.com/deploy?repo=https://github.com/Shivansh2904/taskly-api)\n\nA `render.yaml` blueprint provisions the API + a free Postgres database, generates JWT secrets, and runs `alembic upgrade head` on every deploy.\n\n---\n\n## Running locally\n\n**With Docker (recommended):**\n\n```bash\ngit clone https://github.com/Shivansh2904/taskly-api.git\ncd taskly-api\ndocker compose up\n# API is available at http://localhost:8000\n# Swagger docs at http://localhost:8000/docs\n```\n\n**Without Docker:**\n\n```bash\n# Requires Python 3.12+ and a running PostgreSQL instance\ngit clone https://github.com/Shivansh2904/taskly-api.git\ncd taskly-api\npip install -r requirements.txt\ncp .env.example .env   # edit DATABASE_URL, JWT_SECRET, JWT_REFRESH_SECRET\nuvicorn app.main:app --reload\n```\n\n---\n\n## Example usage\n\n```bash\n# Register\ncurl -X POST http://localhost:8000/auth/register \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"email\": \"you@example.com\", \"password\": \"hunter2hunter2\"}'\n\n# Create a project\ncurl -X POST http://localhost:8000/projects \\\n  -H \"Authorization: Bearer \u003caccess_token\u003e\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"name\": \"Website relaunch\", \"description\": \"Q3 redesign\"}'\n\n# Add a task\ncurl -X POST http://localhost:8000/projects/1/tasks \\\n  -H \"Authorization: Bearer \u003caccess_token\u003e\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"title\": \"Update homepage copy\", \"priority\": \"high\", \"tags\": [\"content\", \"frontend\"]}'\n\n# List tasks filtered by status\ncurl \"http://localhost:8000/projects/1/tasks?status=todo\" \\\n  -H \"Authorization: Bearer \u003caccess_token\u003e\"\n```\n\nFor a full Python walkthrough (register → create project → bulk-add tasks → stats → CSV export) see [`examples/python_client.py`](examples/python_client.py).\n\n---\n\n## Running tests\n\nTests use SQLite so no database setup is needed:\n\n```bash\npip install -r requirements.txt -r requirements-dev.txt\npytest tests/ -v\n```\n\n---\n\n## Project structure\n\n```\napp/\n  main.py          FastAPI app, middleware, router registration\n  config.py        pydantic-settings env validation\n  database.py      SQLAlchemy engine and session factory\n  models.py        ORM models (User, Project, Task, Tag, RefreshToken)\n  schemas.py       Pydantic request/response models\n  auth.py          JWT encode/decode, bcrypt hashing\n  routers/\n    auth.py        /auth routes\n    projects.py    /projects routes + get_current_user dependency\n    tasks.py       /projects/{id}/tasks routes\nalembic/\n  env.py           Alembic migration runner\n  versions/\n    001_initial_schema.py   Creates all tables\ntests/\n  conftest.py      TestClient + SQLite database fixture\n  test_auth.py     Auth endpoint tests\n  test_projects.py Project endpoint tests\n```\n\n---\n\n## License\n\nMIT — Copyright (c) 2025 Shivansh Mishra\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshivansh2904%2Ftaskly-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshivansh2904%2Ftaskly-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshivansh2904%2Ftaskly-api/lists"}