This project is a collaboration between students in the [IBC MSU Broad College of Business] and students in the SOCR at UMich.
This dashboard provides comprehensive data and insights about international business education, market trends, and economic indicators.
The R
backend provides a REST API endpoint /analyze
that:
- Receives JSON data containing x and y values from the React frontend
- Calculates summary statistics (means, medians, standard deviations, correlation)
- Fits a linear regression model to the data
- Generates three interactive Plotly visualizations:
- Scatter plot with regression line
- Histogram of residuals
- Q-Q plot for residual normality assessment
- Returns all results as a structured JSON object
The React frontend consists of several components that provide access to Broad curricula and IBC activities, as well as international supply chain, trade, and business tracking metrics.
- Both systems are completely separate but connected via REST API
- The
R
backend can be deployed on any server that supportsR
- The
React
frontend can be deployed on standard web hosting - CORS is enabled in the
R
API to allow cross-origin requests during development
This implementation demonstrates the strategy of using R-Plumber API
as a backend
for a React
application, leveraging the strengths of both ecosystems: R
's statistical
capabilities and React
's interactive UI features.
The project consists of two main parts:
- R Plumber API Backend: Processes data and performs statistical analysis
- React/TypeScript Frontend: Provides the user interface and visualization
R
installed on your system- Required
R
packages: plumber, dplyr, ggplot2, plotly, jsonlite, tibble, ...
Open R
console and run:
install.packages(c("plumber", "dplyr", "ggplot2", "plotly", "jsonlite", "tibble"))
- Save the
app.R
file to your system - Navigate to the directory where you saved the file
- Start the R Plumber API:
Rscript -e "library(plumber); pr <- plumb('app.R'); pr$run(host='0.0.0.0', port=8000)"
The R
API will start on port 8000.
- Node.js and npm installed on your system
# Clone the repository or create a new project
cd r-analytics-frontend
# Install dependencies
npm install
npm start
The React application will start on http://localhost:3000 and connect to the R Plumber API
running on port 8000.
- Configure default (white) or optional (dark) mode app display
- Run through all 40+ steps of hte interactive hands-on help tutorial (
?
button on the top-right of the app)
React
withTypeScript
- Styled-components for styling
- Plotly.js for visualizations
- Axios for API requests
R
programming languagePlumber
for REST APIdplyr
and other tidyverse packages for data manipulationplotly
for creating interactive visualizations
- Add more complex statistical models (multiple regression, ANOVA, etc.)
- Integrate more advanced visualizations
- Add file upload capabilities for custom datasets
- Implement user authentication
- Deploy to production with proper security measures