AyushKumar123456789 / stock-analysis-backend

Backend of stock analysis of project
2 stars 2 forks source link
api backend blogging development finance financial-analysis mern-stack server stock stock-market stock-price-prediction stockdata

Stock Analysis Service

This is a full-stack project that provides a service where users can access knowledge about stocks, including which stocks to invest in and their analysis. The application includes role-based authentication, allowing an editor to add and manage content, while general users can view the information.


Backend

Overview

The backend is built using Node.js, Express, and MongoDB. It includes features for user authentication, role management, and stock data handling.

Features

Prerequisites

Getting Started

  1. Clone the Repository

    git clone https://github.com/yourusername/stock-analysis-backend.git
    cd stock-analysis-backend
  2. Install Dependencies

    npm install
  3. Setup Environment Variables

    Create a .env file in the root directory and add the following:

    MONGO_URI=mongodb://localhost:27017/stockDB
    JWT_SECRET=your_jwt_secret
    PORT=5000
  4. Run the Server

    npm start

API Endpoints

Directory Structure

backend/
├── config/
│   └── db.js
├── controllers/
|   ├── healthCheckController.js
│   ├── stockController.js
│   └── userController.js
├── middleware/
│   └── auth.js
|   └── multer.middleware.js
|   └── validator.middleware.js
├── models/
|   ├── validation/
|   |    └──login.validation.schema.js
|   |    └──register.validation.schema.js
│   ├── stock.model.js
│   └── user.model.js
├── routes/
│   ├── healthCheckRoutes.js
│   ├── stockRoutes.js
│   └── userRoutes.js
├── util/
│   └── nodemailer.js
|       └── EmailValidation.js
|   └── cloudinary.js
|   └── constants.js
|   └── validator.js
├── .env
├── package.json
└── server.js

To Do

Contributing

Contributions are welcome! Please open an issue or submit a pull request for any improvements or bug fixes.


By following these instructions, you should be able to set up and run both the backend and frontend for the Stock Analysis Service. Feel free to contribute to the project to make it better!