An open API service indexing awesome lists of open source software.

https://github.com/adityarajsingh2904/realworld-nodeapi

A fully functional Medium.com clone backend built using Node.js, Express, and MongoDB
https://github.com/adityarajsingh2904/realworld-nodeapi

backend express- javascript mongodb nodejs- realworld rest-api

Last synced: 7 months ago
JSON representation

A fully functional Medium.com clone backend built using Node.js, Express, and MongoDB

Awesome Lists containing this project

README

          

# ๐ŸŒ RealWorld-NodeAPI โ€“ A Medium Clone Backend using Node.js + Express

**RealWorld-NodeAPI** is a backend implementation of the RealWorld spec using **Node.js**, **Express**, and **MongoDB**.
It supports fully functional APIs for articles, users, comments, profiles, and authentication โ€” just like Medium.

This fork is restructured, refined, and maintained by Aditya Raj Singh.

---

## ๐Ÿš€ Features

- ๐Ÿ” JWT-based Authentication
- ๐Ÿ‘ค User Profile & Follow System
- ๐Ÿ“ CRUD for Articles (with slugs, tags)
- ๐Ÿ’ฌ Comments & Favoriting
- ๐Ÿงช Postman-based Test Suite
- ๐Ÿณ Docker Support for MongoDB
- ๐Ÿ“š `GET /api/articles/recommended` endpoint for personalized article suggestions

### Example request

Fetch a list of up to 5 recommended articles for the authenticated user:

```bash
curl -H "Authorization: Token " \
http://localhost:3000/api/articles/recommended?limit=5
```

### Example response

```json
{
"articles": [
{
"slug": "how-to-train-your-dragon",
"title": "How to train your dragon",
"description": "Ever wonder how?",
"body": "You have to believe",
"tagList": ["dragons", "training"],
"createdAt": "2023-01-01T00:00:00.000Z",
"updatedAt": "2023-01-01T00:00:00.000Z",
"favorited": false,
"favoritesCount": 0,
"author": {
"username": "jake",
"bio": "",
"image": null,
"following": false
}
}
],
"articlesCount": 1
}
```
---

## ๐Ÿ—‚ Project Structure

```
RealWorld-NodeAPI/
โ”œโ”€โ”€ server.js # Application entry point
โ”œโ”€โ”€ config/ # JWT / DB config
โ”‚ โ”œโ”€โ”€ app.js # Express configuration
โ”‚ โ””โ”€โ”€ ...
โ”œโ”€โ”€ routes/ # Express route controllers
โ”œโ”€โ”€ models/ # Mongoose schemas
โ”œโ”€โ”€ tests/ # Postman tests
โ”œโ”€โ”€ package.json
```

---

## โš™๏ธ Setup & Run

### Requirements

- Node.js โ‰ฅ 18
- MongoDB (local or Docker)
- Postman (optional for testing)

### Installation

```bash
git clone https://github.com/Adityarajsingh2904/RealWorld-NodeAPI.git
cd RealWorld-NodeAPI
cp .env.example .env # create your environment file
npm install
npm run dev
```

### MongoDB with Docker

```bash
npm run mongo:start
```

---

## ๐Ÿ“ฎ API Testing

```bash
npm install -g newman
npm test
```

---

## ๐Ÿ‘ค Maintainer

**Aditya Raj Singh**
๐Ÿ“ง thisis.adityarajsingh@gmail.com
๐Ÿ”— [GitHub](https://github.com/Adityarajsingh2904)

---

## ๐Ÿ“œ License

Licensed under the **ISC License**.