Skip to content

zeeshan8281/CMSify

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CMSify

Headless CMS with Node.js and MongoDB 💻

A simple headless CMS (Content Management System) built with Node.js, Express, and MongoDB. This project provides basic API endpoints for managing articles, including CRUD operations, pagination, and search functionality.

Features 🌟

  • 📃 Retrieve a list of articles
  • ➕ Create new articles
  • ✏️ Update existing articles
  • ❌ Delete articles
  • ▶️ Pagination support
  • 🔎 Search articles by title or content

Prerequisites 🚀

Before getting started, make sure you have the following prerequisites installed:

  • Node.js and npm
  • MongoDB installed locally or MongoDB Atlas account

Setup ⚙️

  1. Clone the repository:

    git clone https://github.com/zeeshan8281/CMSify.git
  2. Navigate to the project directory:

    cd CMSify
  3. Install dependencies:

    npm install
  4. Configure MongoDB connection:

    • Update the MongoDB connection URL in app.js:

      mongoose.connect('mongodb://localhost:27017/my-database', { useNewUrlParser: true, useUnifiedTopology: true });
  5. Start the server:

    node app.js

    The server will start on port 5000 by default. You can change the port by setting the PORT environment variable.

Usage 🛠️

  • GET /articles: Retrieve a list of articles.
  • POST /articles: Create a new article.
  • PUT /articles/:id: Update an article by ID.
  • DELETE /articles/:id: Delete an article by ID.
  • GET /articles/search?q=search-term: Search for articles by title or content.
  • GET /articles?page=page-number&limit=page-size: Retrieve paginated articles.

Error Handling ⚠️

  • Proper error handling with informative error messages and status codes.

Contributing 🤝

Contributions are welcome! Please feel free to open issues or submit pull requests to improve this project.

License 📜

This project is licensed under the MIT License - see the LICENSE file for details.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published