This project is a backend application for managing blog posts, built with Node.js, Express, Sequelize, and a PostgreSQL database hosted on neon.tech. It provides CRUD operations for managing posts and uses a RESTful API structure.
- Create, read, update, and delete blog posts
- Connected to a remote PostgreSQL database using Sequelize
- Easy-to-extend and modular structure
Ensure you have the following installed on your machine:
- Node.js (v18 or later)
- pnpm (preferred package manager)
- Access to the internet (for the remote database)
git clone https://github.com/yourusername/fullstack-blog-backend.git
cd fullstack-blog-backend
- Install dependencies:
pnpm install
- Create a
.env
file in the project root directory:
touch .env
- Add the following variables to the
.env
file:
request them by Thyrail, coz they're secret ;)
Start the server in development mode:
pnpm dev
The server will run on http://localhost:4000
.
Posts
Method | Endpoint | Description |
---|---|---|
GET | /posts |
Get all posts |
GET | /posts/:id |
Get a single post by ID |
POST | /posts |
Create a new post |
PUT | /posts/:id |
Update an existing post by ID |
DELETE | /posts/:id |
Delete a post by ID |
You can teste the API using tools like: