๐ ๐๐ฎ๐๐ฒ ๐๐น๐ฎ๐๐ฑ๐ฒ ๐๐ป ๐๐ฃ๐ ๐ง๐ผ ๐ฃ๐ผ๐๐ ๐๐น๐ผ๐ด๐
I built a personal blog. I wanted a way to tell Claude to publish a post. I did not want to copy and paste.
I made an API endpoint. It uses an API key for safety.
My tech stack:
- Next.js 16
- React 19
- TypeScript
- Tailwind v4
- JSON file for data
The flow is simple. I talk to Claude in the terminal. I tell it to draft a post. Claude sends a POST request. The post appears on my blog as a draft. I edit the final version in my browser.
I hit a wall with the API key. I used bcrypt to hash it. I put the hash in my env file. The server failed.
Next.js reads the dollar sign in the hash. It thinks the sign is a variable. It replaces the hash with an empty string. This broke the auth.
I found two fixes:
- Escape the dollar signs.
- Use a raw key for local dev.
I use the raw key locally. I use the hash in production.
AI handles the rough cut. I handle the polish. It is like a code review for prose.
Future plans:
- Move to Postgres.
- Add image uploads.
- Update my profile via API.
Build it simple first. Add complexity when it matters. If you build this, watch out for env variables.