FlaPLeT: A Full-Stack Web Platform for End-to-End Time Series Data Processing and Machine Learning in Solar Flare Prediction
The paper describing this platform is currently under review at SoftwareX.
1. FlaPLeT Architecture Overview
This video presents a high-level explanation of the system architecture, including how Django, React, Celery, PostgreSQL, Redis, Nginx, and Waitress work together to support asynchronous machine learning workflows.
2. FlaPLeT Functionality Demonstration
In this video, I log in to the FlaPLeT platform and demonstrate every feature: dataset upload, preprocessing, data augmentation (SMOTE), graph generation, ML training (GRU, SVM, Node2Vec), and downloading reports or models.
The platform, FlaPLeT (Flare Prediction by Learning from Time Series), is a modular web application designed for AI-based multivariate time series (MVTS) analysis and solar flare prediction.
The system architecture includes:
- Frontend: Built with React JS and styled using Material UI (MUI), enabling a clean, responsive, and component-based user interface.
- Backend: Developed using Django and served with Waitress, the backend handles routing, user sessions, RESTful APIs, and database interactions via Django's ORM.
- Asynchronous Processing: Long-running tasks such as preprocessing, augmentation, graph construction, and ML training are managed by Celery with Redis as the message broker.
- Web Server: NGINX serves static files, manages HTTPS traffic, and proxies API requests to the backend.
- Database: All data, including users, datasets, and results, are stored in a PostgreSQL database, ensuring reliability, transactional integrity, and scalability.
This architecture ensures seamless interaction between components while supporting scalable, real-time AI workflows.
We explain how to set up FlaPLeT on a Windows server with a static IP mapped to a domain (e.g., flaplet.com).
It covers installing prerequisites, cloning the repo, configuring environment variables, running the backend/frontend, Celery workers, and deploying with Nginx.
Install the following on Windows:
-
Python 3.9 – 3.11
Download -
Node.js 18+ (with npm)
Download -
PostgreSQL 13+
Download -
Redis (Windows build)
Download -
Nginx (Windows build)
DownloadC:\nginx\ # Nginx installation folder -
Git
Download -
Waitress (production WSGI server for Django)
pip install waitress
cd C:\
git clone https://github.com/samresume/FlaPLeT.git
Folder layout after cloning:
C:\nginx\ # Nginx installation folder
C:\FlaPLeT\ # Cloned repo
Your server must be reachable on the internet with a dedicated static IP address. All incoming HTTP (port 80) and HTTPS (port 443) traffic should be routed to your server.
- If you are deploying on a local Windows machine at home or in an office, you need:
- An internet connection with a static IP address (assigned by your ISP).
- A router configured with port forwarding so that external traffic on ports 80 and 443 is forwarded to your computer’s local IP address.
In our case, we configured the router’s Port Forwarding rules so that external requests on ports 80 and 443 are forwarded to the local server at 192.168.0.50.
We also set up DNS records so that our domain flaplet.org (for the frontend) and api.flaplet.org (for the backend) both point to our static public IP address.
We purchased two SSL certificates from https://www.sslforfree.com/:
- One for the frontend domain (
flaplet.org) - One for the backend domain (
api.flaplet.org)
These certificates provide the necessary key and certificate files that will be referenced in the Nginx configuration to enable HTTPS. Once configured, Nginx will terminate SSL/TLS and ensure that all traffic is served securely over HTTPS only.
Please check the nginx_settings folder in this repository, which contains all required Nginx configuration files for both the frontend and backend.
- Replace the default
C:\nginx\conf\nginx.confwith the one provided innginx_settings\nginx.conf.
Update this file as needed for your environment:
- Domain name:
flaplet.org - SSL certificate/key paths (e.g., change from
C:/Users/eskan/CI/frontend/certstoC:/FlaPLeT/frontend/certs) - React build root (e.g., change from
C:/Users/eskan/CI/frontend/buildtoC:/FlaPLeT/frontend/build)
- Create two folders in your Nginx root directory (
C:\nginx\):C:\nginx\sites-available\ C:\nginx\sites-enabled\ - Copy nginx_settings\webproject_nginx.conf into C:\nginx\sites-available\ and then place a copy into C:\nginx\sites-enabled\ . Update both as needed:
- Domain name: api.flaplet.org
- SSL certificate/key paths (e.g., change from C:/Users/eskan/CI/backend/certs to C:/FlaPLeT/backend/certs)
- Backend root (e.g., change from C:/Users/eskan/CI/backend to C:/FlaPLeT/backend)
Also make sure these empty directories exist under C:\FlaPLeT\backend:
C:\FlaPLeT\backend\static
C:\FlaPLeT\backend\media
C:\FlaPLeT\backend\bugreport
C:\FlaPLeT\backend\datasets
C:\FlaPLeT\backend\file_results
Install the frontend dependencies and build the production bundle:
cd C:\FlaPLeT\frontend
npm install
npm run build
The compiled site will be in: C:\FlaPLeT\frontend\build\
Create or update C:\FlaPLeT\backend\backend\.env with the following (edit the values):
--- Django core ---
SECRET_KEY= replace-with-a-strong-random-string (generate using https://djecrety.ir/)
ALLOWED_HOSTS=localhost,127.0.0.1,api.flaplet.org,flaplet.org (change as necessary)
--- Database (PostgreSQL) ---
Create a database and user in PostgreSQL, then use those values here
DB_NAME=Database_NAME
DB_USER=Database_USER
DB_PASSWORD=Database_PASSWORD
DB_HOST=127.0.0.1
DB_PORT=5432
--- Redis / Celery ---
CELERY_BROKER_URL=redis://127.0.0.1:6379
--- Security: CSRF / CORS ---
CORS_ORIGIN_WHITELIST=https://flaplet.org,https://api.flaplet.org,https://139.64.170.58
CSRF_TRUSTED_ORIGINS=https://api.flaplet.org,https://flaplet.org,https://139.64.170.58
--- reCAPTCHA (server-side secret) ---
RECAPTCHA_SECRET=your-google-recaptcha-secret
Install backend dependencies and create a Django superuser (for the admin panel).
Always use the virtual environment so the correct packages (e.g., TensorFlow) are used.
cd C:\FlaPLeT\backend
# Create & activate a virtual environment
py -m venv venv
Set-ExecutionPolicy Unrestricted -Scope Process
.\venv\Scripts\activate
# Install Python dependencies into the venv
python -m pip install --upgrade pip
pip install -r requirements.txt
# Apply database migrations and create an admin user
python manage.py migrate
python manage.py createsuperuser
# Collect static files for production (Nginx will serve these)
python manage.py collectstatic --noinput
To bring the whole system online, you need to run three processes:
- Nginx (serves frontend and proxies requests to backend)
- Django backend (serves API at
127.0.0.1:8000) - Celery worker (handles background tasks)
Open three separate Command Prompt / PowerShell windows and run:
1. Start Nginx
cd C:\nginx
start nginx
If Nginx is already running, reload instead of starting:
nginx -s reload
- Start Django backend
cd C:\FlaPLeT\backend
.\venv\Scripts\activate
python manage.py runserver
- Start Celery worker
cd C:\FlaPLeT\backend
.\venv\Scripts\activate
celery -A backend.celery worker --pool=solo -l info
The platform provides an end-to-end environment for working with multivariate time series (MVTS) data, tailored for solar flare prediction. It supports data upload, preprocessing, augmentation, graph-based transformation, and machine learning classification, all through an interactive web interface.
- Upload
.pkl-format MVTS datasets (up to 25MB). - Missing value handling: mean imputation or sample removal.
- Normalization options: z-score or min-max scaling.
- Output: Processed dataset and downloadable summary report (data shape, label distribution, normalization stats).
- Supports SMOTE and TimeGAN techniques.
- Configurable parameters:
- SMOTE:
k_neighbors - TimeGAN:
batch_size,num_layers,iteration
- SMOTE:
- Output: Augmented dataset and detailed report (class distribution before/after, technique used, runtime).
- Constructs graph-based datasets via Pearson correlation analysis.
- User-defined correlation threshold and max neighbors.
- Output: Graph (
.gpickle), labels, and report (nodes, edges, label stats).
- GRU (for MVTS): customizable layers, hidden size, dropout, learning rate, batch size, epochs, and optimizer (
Adam,SGD). - SVM (for MVTS): kernel selection and regularization strength.
- Node2Vec + Logistic Regression (for graph data): embedding dimensions, walk length, window size, batch size, regularization penalty, solver, and iteration count.
- Output: Trained model and evaluation report (Accuracy, Precision, Recall, AUC, TSS, HSS, GS).
- All tasks run asynchronously and are tracked by status (
running,completed,failed). - Users can view task metadata, download results, and manage completed tasks.
This platform was developed as part of a research effort supported by the National Science Foundation (NSF) under the Office of Advanced Cyberinfrastructure (OAC), aimed at providing researchers with seamless access to time series data preprocessing, augmentation, and machine learning workflows through a user-friendly web interface.
- Recipient Institution: Utah State University
- Award Number: 2305781
- Project Title: CRII: OAC: Cyberinfrastructure for Machine Learning on Multivariate Time Series Data and Functional Networks
- Award Period: October 1, 2022 – May 31, 2025 (estimated)
- Total Award Amount: $174,984.00
If you're working on a similar AI-based web application and are looking for guidance, collaboration, or have any questions, feel free to reach out.
📧 Contact: Sam EskandariNasab
✉️ Email: [email protected]
This project is licensed under the MIT License.


