Chirpy is a backend RESTful API built for a Boot.dev backend course. It provides the server-side functionality for a microblogging platform, including user authentication (using Argon2 and JWTs with refresh tokens), chirp (post) creation and retrieval with automated content filtering, user upgrades via webhook integration, and hit metrics tracking.
- Node.js & TypeScript
- Express
- PostgreSQL
- Drizzle ORM & Drizzle Kit
- Argon2 & JSON Web Tokens (JWT)
- Vitest
- Node.js (v22.14.0 or later recommended)
- npm
- PostgreSQL
-
Clone the repository:
git clone https://github.com/wmwright89/Chirpy.git cd Chirpy -
Install dependencies:
npm install
-
Set up environment variables:
Create a
.envfile in the root directory (or copy.env.example):cp .env.example .env
Configure the required variables:
DB_URL="postgres://postgres:<password>@localhost:5432/chirpy?sslmode=disable" PORT=8080 PLATFORM="dev" SECRET="your-jwt-secret-key" POLKA_KEY="your-polka-api-key"
-
Run database migrations:
Make sure your PostgreSQL database exists, then run:
npm run migrate
(Note: The server also automatically applies pending migrations upon startup).
-
Development Mode (compiles TypeScript and starts the server):
npm run dev
-
Production Mode (builds to
distand runs compiled JavaScript):npm run build npm start
By default, the server runs at http://localhost:8080.
To run the unit test suite:
npm test