GithubHelp home page GithubHelp logo

furkan-dogu / blogapp-api Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 401 KB

This project is a RESTful API developed using Node.js and Express. The API interacts with a MongoDB database and is documented with Swagger.

Home Page: https://blog-app-api-iota.vercel.app

JavaScript 100.00%
cors dotenv express-async-errors expressjs mongodb mongoose nodejs redoc-express request-ip swagger-autogen swagger-ui-express validator

blogapp-api's Introduction

Blog App API

This project is a RESTful API developed using Node.js and Express. The API interacts with a MongoDB database and is documented with Swagger.

ERD

ERD

Table of Contents

Live Demo

Blog App API

Technologies Used

  • Node.js: A JavaScript runtime built on Chrome's V8 JavaScript engine.
  • Express: A minimal and flexible Node.js web application framework that provides a robust set of features for web and mobile applications.
  • Mongoose: An ODM (Object Data Modeling) library for MongoDB and Node.js, providing a straight-forward, schema-based solution to model your application data.
  • dotenv: A zero-dependency module that loads environment variables from a .env file into process.env.
  • cors: A node.js package for providing a Connect/Express middleware that can be used to enable CORS (Cross-Origin Resource Sharing) with various options.
  • express-async-errors: A small utility to handle errors in async/await routes in Express.
  • redoc-express: A middleware for hosting OpenAPI (Swagger) documentation using ReDoc.
  • request-ip: A simple way to retrieve a user's IP address in a Node.js application.
  • swagger-autogen: A tool to automatically generate Swagger/OpenAPI documentation from existing code.
  • swagger-ui-express: A middleware for serving the Swagger UI bound to your Swagger/OpenAPI specification.
  • validator: A library for string validation and sanitization.

Documentation

Endpoints

Users

  • GET /users: Lists all users.
  • POST /users: Creates a new user.
  • GET /users/:userId: Displays a specific user.
  • PUT /users/:userId: Updates information of a specific user.
  • DELETE /users/:userId: Deletes a specific user.

Authentication

  • POST /auth/login: Provides user login.
  • GET /auth/logout: Terminates the user session.

Blogs

  • GET /blogs: Lists all blogs.
  • POST /blogs: Creates a new blog.
  • GET /blogs/:blogId: Displays a specific blog.
  • PUT /blogs/:blogId: Updates information of a specific blog.
  • DELETE /blogs/:blogId: Deletes a specific blog.

Categories

  • GET /categories: Lists all blog categories.
  • POST /categories: Creates a new blog category.
  • GET /categories/:categoryId: Displays a specific blog category.
  • PUT /categories/:categoryId: Updates information of a specific blog category.
  • DELETE /categories/:categoryId: Deletes a specific blog category.

Comments

  • GET /comments: Lists all comments.
  • POST /comments: Creates a new comment.
  • GET /comments/:commentId: Displays a specific comment.
  • PUT /comments/:commentId: Updates information of a specific comment.
  • DELETE /comments/:commentId: Deletes a specific comment.

Project Skeleton

Blog App API (folder) 
│
├── src
│    ├── configs
│    │     ├── dbConnection.js
│    │     └── swagger.json
│    ├── controllers
│    │     ├── auth.js     
│    │     ├── blog.js          
│    │     ├── category.js          
│    │     ├── comment.js          
│    │     ├── product.js     
│    │     ├── token.js     
│    │     └── user.js
│    ├── helpers
│    │     ├── passwordEncrypt.js    
│    │     └── sync.js 
│    ├── middlewares 
│    │     ├── authentication.js 
│    │     ├── errorHandler.js 
│    │     ├── permissions.js   
│    │     ├── queryHandler.js   
│    │     └── requestIp.js 
│    ├── models                        
│    │     ├── blog.js          
│    │     ├── category.js          
│    │     ├── comment.js              
│    │     ├── token.js     
│    │     └── user.js
│    └── routes                
│          ├── auth.js     
│          ├── blog.js     
│          ├── category.js     
│          ├── comment.js     
│          ├── document.js     
│          ├── index.js         
│          ├── token.js     
│          └── user.js
├── .gitignore
├── index.js
├── package-lock.json
├── package.json
├── swaggerAutogen.js
├── vercel.json
└── README.md

blogapp-api's People

Contributors

furkan-dogu avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.