Code Monkey home page Code Monkey logo

prompt-conversationer-backend's Introduction

Discussion Forum App

This is a simple discussion forum web application with features to create discussions and post messages within discussions.

Table of Contents

Features

  • Create discussions
  • Post messages within discussions
  • Update and delete discussions
  • Update and delete messages
  • Get all discussions and messages
  • Get discussion by ID with messages
  • Get message by ID
  • Get all messages within a discussion

Getting Started

To get a local copy up and running follow these simple steps.

Prerequisites

  • Node.js and npm installed
  • MongoDB installed and running

Installation

  1. Clone the repository:

    git clone https://github.com/Rajkumar-Khatua/prompt-conversationer-backend.git
    cd prompt-conversationer-backend
  2. Install dependencies:

    npm install
  3. Create a .env file in the root directory and add the following environment variables:

     PORT=3000
     MONGODB_URI=mongodb://localhost:27017/prompt-conversationer-backend
  4. Start the server:

    npm start
  5. The server should be running on http://localhost:3000.

Usage

  • Create a discussion:

    curl -X POST \
      http://localhost:3000/discussions \
      -H 'Content-Type: application/json' \
      -d '{
      "title": "Discussion Title",
      "description": "Discussion Description"
    }'
  • Get all discussions:

      curl -X GET \
          http://localhost:3000/discussions
  • Get a discussion by ID: ```bash curl -X GET
    http://localhost:3000/discussions/:discussionId

    
    
  • Update a discussion: ```bash curl -X PUT
    http://localhost:3000/discussions/:discussionId
    -H 'Content-Type: application/json'
    -d '{ "title": "Updated Discussion Title", "description": "Updated Discussion Description" }'

  • Delete a discussion: bash curl -X DELETE \ http://localhost:3000/discussions/:discussionId

  • Create a message: bash curl -X POST \ http://localhost:3000/discussions/:discussionId/messages \ -H 'Content-Type: application/json' \ -d '{ "text": "Message Text" }'

  • Get all messages:

        curl -X GET \
            http://localhost:3000/messages
        ```
  • Get a message by ID:

        curl -X GET \
            http://localhost:3000/messages/:messageId
        ```
  • Update a message: bash curl -X PUT \ http://localhost:3000/messages/:messageId \ -H 'Content-Type: application/json' \ -d '{ "text": "Updated Message Text" }'

  • Delete a message:

        curl -X DELETE \
            http://localhost:3000/messages/:messageId
        ```
  • Get all messages within a discussion: bash curl -X GET \ http://localhost:3000/discussions/:discussionId/messages

API Endpoints

Method Endpoint Description Request Body Success Response Error Response
POST /discussions Create a discussion { "title": "Discussion Title", "description": "Discussion Description" } 201 Created 400 Bad Request
GET /discussions Get all discussions - 200 OK 404 Not Found
GET /discussions/:discussionId Get a discussion by ID - 200 OK 404 Not Found
PUT /discussions/:discussionId Update a discussion { "title": "Updated Discussion Title", "description": "Updated Discussion Description" } 200 OK 400 Bad Request
DELETE /discussions/:discussionId Delete a discussion - 204 No Content 404 Not Found
POST /discussions/:discussionId/messages Create a message { "text": "Message Text" } 201 Created 400 Bad Request
GET /messages Get all messages - 200 OK 404 Not Found
GET /messages/:messageId Get a message by ID - 200 OK 404 Not Found
PUT /messages/:messageId Update a message { "text": "Updated Message Text" } 200 OK 400 Bad Request
DELETE /messages/:messageId Delete a message - 204 No Content 404 Not Found
GET /discussions/:discussionId/messages Get all messages within a discussion - 200 OK 404 Not Found

Built With

License

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

Acknowledgments

  • Special thanks to OpenAI for providing GPT-3.5, which assisted in creating this README.

Personal Team Appreciation:

I extend my sincere appreciation to each member of our team for their dedicated efforts and collaboration, which have been instrumental in ensuring the smooth flow of our work. This project wouldn't have been possible without the hard work, commitment, and expertise contributed by each team member.

Contact Me ๐Ÿ“ซ

Rajkumar Khatua - LinkedIn Rajkumar Khatua - GitHub

Coming Soon Features

  • User authentication
  • User authorization
  • User roles
  • User profile
  • User avatar
  • User settings
  • User notifications
  • User search
  • User activity
  • User privacy
  • User preferences
  • User subscriptions
  • User followers
  • User following
  • User blocking
  • User reporting
  • User feedback
  • User support
  • User feedback
  • Performance optimization
  • Security
  • Personal group chats
  • Group chats
  • Group chat settings
  • Group chat notifications
  • Group chat search
  • Group chat activity
  • Group chat privacy
  • Group chat preferences
  • Group chat subscriptions
  • Group chat followers
  • Group chat following
  • Group chat blocking
  • Group chat reporting

prompt-conversationer-backend's People

Contributors

rajkumar-khatua 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.