Skip to content

kbelltree/odin-blog-api

Repository files navigation

The Odin Project: Blog API

This is an API-only backend project for a blog site, built with a RESTful structure. The project focuses on separating backend and frontend code into different codebases and practicing communication between a backend API and a frontend application.

The frontend for this project is built in a separate repository (frontend repo).

For the full assignment details, see: The Odin Project - Blog API.

Key Project Instructions

Data management:

  • Use Prisma ORM to manage users, posts, and comments

Web application framework:

  • Build the API using Express

Authentication:

  • Implement JWT-based authentication
  • Use Passport JWT strategy to protected routes
  • Handle authentication through the Authorization header using the Bearer scheme

Main Features:

  1. Models and schema

    • User: email, username, password
    • Post: title, content, author, published timestamp, created timestamp, comments
    • Comment: comment content, created timestamp
  2. Routes

    • Auth
    • Posts
    • Me
  3. Auth flow

    • Sign up: hash password before saving
    • Log in: verify password and issue JWT
    • Protected routes: require a valid token
  4. Frontend flow

    • A separate frontend fetches and displays data from this API

Live Links

Built With

  • Prisma ORM
  • PostgreSQL
  • Express
  • Passport.js
  • jsonwebtoken
  • bycriptjs
  • cors
  • Neon
  • Render

ToDo

  • npm audit shows remaining transitive vulnerabilities through Prisma 7 dependencies
  • do not run npm audit fix --force because it downgrades Prisma to 6.x
  • recheck audit when updating Prisma / Express later

Releases

No releases published

Packages

 
 
 

Contributors