Blog API
A smaller API focused on relationships, slugs, publishing state and search.
Technologies
The brief
What the finished thing needs to do.
- Posts with a title, URL slug, body, author, tags and publication state
- Comments belonging to posts
- List published posts with paging; drafts visible only to their author
- Filter by tag and search post titles and bodies
- Generate a unique slug from the title
- Only the author may edit their own post
How to structure it
The interesting parts here are the relationships: posts to authors, posts to comments, and a many-to-many between posts and tags.
Publication state and ownership together mean authorization is not simply role-based — whether a caller may see or edit a post depends on the specific record. That record-level check belongs in the service layer, not in the controller.
Slug generation needs to handle collisions, which is a small but genuine design problem worth thinking through.
Why these technologies
- EF Core many-to-many
- Tags are a natural many-to-many relationship, worth modelling properly.
- Record-level authorization checks
- Ownership rules cannot be expressed as roles alone.
- Database text search
- Adequate at this scale, and avoids introducing a search engine prematurely.
Build it in this order
Each stage produces something that works. That matters — a project that only runs at the very end is a project people abandon.
Posts and authors
Model the one-to-many relationship and expose read endpoints.
Slug generation
Derive from the title and handle duplicates deterministically.
Publication state
Drafts and published posts, with list endpoints respecting the distinction.
Tags
Many-to-many, plus filtering by tag.
Comments
Nested under posts, with their own validation.
Ownership rules
Only the author may edit or delete; enforce in the service layer.
Search
Across titles and bodies, paged.
Done means
How to know it is finished
Check each of these before moving on. If one fails, the project is not done yet — and that is useful information rather than a setback.
- Slugs are unique and derived predictably from titles
- Drafts are never returned to anyone other than their author
- Tag filtering and search both work with paging
- A caller cannot edit a post they do not own, even with a valid token
If you want to go further
Extensions worth attempting
Only once the core build meets every criterion above.
- Add scheduled publishing
- Add comment moderation
- Add reading time estimation
- Add an RSS feed endpoint
Other projects at this level
Employee Management Console Application
The C# course project. Build it with what you know early, then deliberately refactor it as the language gives you better tools.
Employee Management API
A production-shaped web API: validated, paged, documented, secured, backed by a real database and covered by tests.
Inventory Management System
A data-focused build: stock levels, movements, concurrency and reporting that must stay correct under simultaneous use.
Have a project worth talking through?
Tell us what you're building or what's slowing your current system down. We'll give you a direct read on scope and approach.