DEV Community

Cover image for Building Yarncom: Phase 1 - The Authentication Handshake & The Port 5000 Ghost
Dillibe Chisom Okorie
Dillibe Chisom Okorie

Posted on

Building Yarncom: Phase 1 - The Authentication Handshake & The Port 5000 Ghost

Every developer remembers their first "real" project. For me, Yarncom is one of my first real projects. Instead of following a guided tutorial, I’m documenting a Progressive Journey of building a blogging API from scratch.

The Stack:

  • Engine: Node.js / Express

  • Database: MongoDB Atlas

  • Security: Bcryptjs & JWT

  1. The Security Guard (Bcrypt & JWT)
    I don't want to just save data; I want to secure it. I implemented a pre-save hook logic where passwords are scrambled using Bcrypt before they ever hit the database. For session management, I chose JWT. It’s like a digital keycard—you log in, you get a 1-hour pass, and you’re in.

  2. The Port 5000 Mystery
    If you're developing on a modern Mac, stay away from Port 5000. I ran into a wall where my server said "Running", but Postman said " 404 ".

The Culprit: AirPlay Receiver.

The Fix: const PORT = process.env.PORT || 3000;.

What’s Next?
Phase 2 involves the Blog Model and a custom Reading Time algorithm. Stay tuned as I weave this community together!

Top comments (0)