Implement blog listing endpoint with Clean Architecture#1
Open
Implement blog listing endpoint with Clean Architecture#1
Conversation
Co-authored-by: argentinaluiz <4926329+argentinaluiz@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add blog listing feature
Implement blog listing endpoint with Clean Architecture
Feb 11, 2026
argentinaluiz
approved these changes
Feb 11, 2026
There was a problem hiding this comment.
Pull request overview
Implements a new blog listing feature in the Express + TypeScript Clean Architecture codebase by adding a Blog model (Prisma) and the corresponding domain/repository/use-case/controller/route wiring to expose GET /api/blogs.
Changes:
- Added
BlogPrisma model + migration to persist blog entries. - Implemented blog domain/repository/use case/controller to support listing blogs.
- Registered blog routes under
/apiand added/blogsroute mapping.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
.github/copilot-instructions.md |
Minor documentation cleanup. |
prisma/schema.prisma |
Adds Blog model to Prisma schema. |
prisma/migrations/20260211233829_/migration.sql |
Creates the Blog table via migration. |
src/domain/blog/Blog.ts |
Introduces the Blog domain entity shape. |
src/domain/blog/IBlogRepository.ts |
Defines repository interface for blog data access. |
src/repositories/blog/BlogRepository.ts |
Prisma-backed repository implementing blog queries. |
src/useCases/blog/ListBlogsUseCase.ts |
Use case to list blogs from repository. |
src/controllers/BlogController.ts |
HTTP controller for listing blogs. |
src/routes/blogs.routes.ts |
Route definitions for blog endpoints. |
src/routes/index.ts |
Wires blog dependencies and mounts /api/blogs. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
GET /api/blogsendpoint to retrieve blog posts from the database.Changes
Blogmodel (Prisma) with fields:title,content,author,published, timestampsBlogentity andIBlogRepositoryinterface (framework-agnostic)BlogRepositoryimplementation using Prisma clientListBlogsUseCasefor retrieval orchestrationBlogControllerhandles HTTP concerns, returnsApiResponse<Blog[]>/api/blogsvia dedicated route fileArchitecture
Follows dependency injection pattern:
Repository → UseCase → ControllerDependencies point inward per Clean Architecture. Controllers bound with
.bind()when registered.Response Format
{ "success": true, "data": [ { "id": 1, "title": "Getting Started with TypeScript", "content": "...", "author": "John Doe", "published": true, "createdAt": "2026-02-11T23:39:43.524Z", "updatedAt": "2026-02-11T23:39:43.524Z" } ] }Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
checkpoint.prisma.io/opt/hostedtoolcache/node/24.13.0/x64/bin/node /opt/hostedtoolcache/node/24.13.0/x64/bin/node /home/REDACTED/work/test-auto-copilot/test-auto-copilot/node_modules/prisma/build/child {"product":"prisma","version":"5.22.0","cli_install_type":"local","information":"","local_timestamp":"2026-02-11T23:37:56Z","project_hash":"eaa95e42","cli_path":"/home/REDACTED/work/test-auto-copilot/test-auto-copilot/node_modules/prisma/build/index.js","cl(dns block)/opt/hostedtoolcache/node/24.13.0/x64/bin/node /opt/hostedtoolcache/node/24.13.0/x64/bin/node /home/REDACTED/work/test-auto-copilot/test-auto-copilot/node_modules/prisma/build/child {"product":"prisma","version":"5.22.0","cli_install_type":"local","information":"","local_timestamp":"2026-02-11T23:38:23Z","project_hash":"eaa95e42","cli_path":"/home/REDACTED/work/test-auto-copilot/test-auto-copilot/node_modules/.bin/prisma","cli_path_has(dns block)/opt/hostedtoolcache/node/24.13.0/x64/bin/node /opt/hostedtoolcache/node/24.13.0/x64/bin/node /home/REDACTED/work/test-auto-copilot/test-auto-copilot/node_modules/prisma/build/child {"product":"prisma","version":"5.22.0","cli_install_type":"local","information":"","local_timestamp":"2026-02-11T23:38:29Z","project_hash":"eaa95e42","cli_path":"/home/REDACTED/work/test-auto-copilot/test-auto-copilot/node_modules/.bin/prisma","cli_path_has(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
Created from VS Code.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.