Coder Social home page Coder Social logo

harshdev625 / newssphere-backend Goto Github PK

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

NewsSphere Backend is the server-side component of the NewsSphere project, responsible for handling data related to news articles, user accounts, and interactions.

JavaScript 100.00%
bcrypt dotenv express mongodb mongoose nodejs

newssphere-backend's Introduction

NewsSphere Backend

NewsSphere Backend is the server-side component of the NewsSphere project, responsible for handling data related to news articles, user accounts, and interactions.

Features

  • User authentication and authorization
  • CRUD operations for news articles
  • User-specific saved articles
  • RESTful API endpoints
  • Error handling and validation

Installation

  1. Clone the repository:

    git clone https://github.com/Harshdev625/newssphere-backend
    cd newssphere-backend
  2. Install the required dependencies by running npm install:

    npm install
  3. Create a MongoDB Atlas account and set up a cluster. Here's how you can do it:

    • Go to the MongoDB Atlas website: https://www.mongodb.com/cloud/atlas
    • Sign up for an account if you don't have one, or log in if you do.
    • Create a new project and cluster.
    • Follow the prompts to configure your cluster settings, such as clouprovider and region.
    • Once your cluster is created, you'll get a connection string. This will be used in your backend server.
  4. Create a .env file in the root folder of the project and add the following environment variables:

    MONGODB_URI=YOUR_CONNECTION_STRING

    Replace YOUR_CONNECTION_STRING with the actual connection string you obtained from MongoDB Atlas.

  5. Run the server using :

    nodemon index.js
  6. The backend server is now running on http://localhost:8080.

  7. Open MongoDB Compass:

    • Download and install MongoDB Compass: https://www.mongodb.com/try/download/compass
    • Open MongoDB Compass.
    • Connect to your MongoDB Atlas cluster using the connection string.
    • You can now interact with your MongoDB database using the MongoDB Compass GUI.

Make sure to follow each step carefully and replace placeholders with actual values. This guide should help you set up your backend server and connect it to your MongoDB Atlas cluster using MongoDB Compass for database management.

Contributing

Contributions to the NewsSphere Backend are welcome! If you encounter any bugs, or issues, or have ideas for improvements, please open an issue on the repository. Pull requests with enhancements are also appreciated.

Tech Stack Used

  • Node.js
  • Express.js
  • MongoDB Just so you know, the frontend repository NewsSphere needs to be set up and connected to this backend server for the complete functionality of the application.

newssphere-backend's People

Contributors

harshdev625 avatar

Stargazers

Aman Pratap Singh 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.