MDME (Mark Down Made Easy) Backend - A simple JSON-based REST API server that provides data persistence for the MDME markdown editor application.
This backend serves as the data layer for MDME, a clean and intuitive markdown editor with real-time preview functionality. Built with Node.js and json-server, it provides RESTful API endpoints for storing, retrieving, and managing markdown documents.
- RESTful API - Full CRUD operations for markdown documents
- JSON Database - Lightweight file-based storage using db.json
- CORS Support - Cross-origin resource sharing enabled
- Auto-generated Endpoints - Powered by json-server
- Document Management - Store markdown content with metadata (title, date, ID)
- Node.js - Runtime environment
- json-server - RESTful API generator
- CORS - Cross-origin request handling
-
Clone the repository:
git clone https://github.com/sayeedmunees/mdme-backend.git cd mdme-backend -
Install dependencies:
npm install
-
Start the server:
npx json-server db.json
The server will start on port 3000 (or the PORT environment variable if set).
Base URL: http://localhost:3000
| Method | Endpoint | Description |
|---|---|---|
| GET | /markdown |
Get all markdown documents |
| GET | /markdown/{id} |
Get a specific document by ID |
| POST | /markdown |
Create a new markdown document |
| PUT | /markdown/{id} |
Update an existing document |
| DELETE | /markdown/{id} |
Delete a document |
{
"id": "unique-id",
"title": "Document Title",
"date": "YYYY-MM-DD",
"mdData": "# Markdown content here"
}mdme-backend/
├── node_modules/ # Dependencies
├── db.json # JSON database file
├── index.js # Main server file
├── package.json # Project configuration
└── package-lock.json # Dependency lock file
GET http://localhost:3000/markdown
POST http://localhost:3000/markdown
Content-Type: application/json
{
"title": "My New Document",
"date": "2025-10-08",
"mdData": "# Hello World\nThis is my markdown content."
}
PUT http://localhost:3000/markdown/5487
Content-Type: application/json
{
"title": "Updated Document",
"date": "2025-10-08",
"mdData": "# Updated Content\nThis document has been updated."
}
| Variable | Default | Description |
|---|---|---|
PORT |
3000 | Server port number |
To run in development mode:
npx json-server db.jsonThe server includes CORS middleware to allow cross-origin requests from your frontend application.
The application uses a simple JSON file (db.json) as its database. This file contains all markdown documents and is automatically updated when documents are created, modified, or deleted through the API.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License.
Sayeed Munees
- GitHub: @sayeedmunees
Note: This backend is designed to work with the MDME frontend application. Make sure to configure your frontend to point to the correct backend URL.