Skip to content

This project is a web application that generates random arrays using NumPy and sends them to connected clients in real-time using Flask and Flask-SocketIO.

Notifications You must be signed in to change notification settings

yasamin-khodarahmi/random_array_generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Real-Time Random Array Generator

This project is a web application that generates random arrays using NumPy and sends them to connected clients in real-time using Flask and Flask-SocketIO. The application also stores the generated arrays in a MongoDB database for future reference.

Features

  • Generate random arrays with a minimum size of 10,000 and a range between 0 and 99,999 using NumPy.
  • Allow users to specify the size of the array and the range of random numbers.
  • Send generated random arrays to all connected clients in real-time using WebSockets.
  • Update the front-end display with new arrays as they are generated.
  • Store each generated random array in a MongoDB collection.
  • Provide an option for users to view previously generated arrays.

Technologies Used

  • Backend: Python, Flask, Flask-SocketIO
  • Frontend: HTML, JavaScript, Socket.IO client
  • Database: MongoDB
  • Data Processing: NumPy

Prerequisites

Before you begin, ensure you have met the following requirements:

  • Python 3.7+
  • MongoDB installed and running
  • pip (Python package manager)

Installation

  1. Clone the repository:
git clone https://github.com/yasamin-khodarahmi/random_array_generator.git
cd random_array_generator
  1. Create a virtual environment (optional but recommended):
python -m venv venv
source venv/bin/activate # On Windows, use venv\Scripts\activate
  1. Install the required packages:
pip install -r requirements.txt
  1. Make sure MongoDB is running on your system.

Usage

  1. Start the Flask application:
python app.py
  1. Open a web browser and navigate to http://localhost:5000.

  2. Use the interface to generate random arrays:

  • Specify the array size (minimum 10,000)
  • Set the minimum and maximum values for the random numbers
  • Click "Generate Array" to create and display a new array
  1. View previously generated arrays using the dropdown menu.

Project Structure

random_array_generator/
│
├── app.py # Main Flask application
├── templates/
│ └── index.html # Frontend HTML template
├── requirements.txt # Python dependencies
└── README.md # Project documentation

Contact

If you have any questions or feedback, please open an issue on GitHub or contact the maintainer at y.khodarahmi.dev@gmail.com.

Acknowledgements

About

This project is a web application that generates random arrays using NumPy and sends them to connected clients in real-time using Flask and Flask-SocketIO.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published