Skip to content

Commit 4035f1e

Browse files
vudangbaovyraidenwilliamsRaiden Williamsrohph
authored
Fall2024 - Spring2025 Changes (#28)
* first commit * add .gitignore & update README * initialize frontend w/ create-react-app * add menu options/pages & init request functions * initialize backend & rename script * update favicon & website title * add functions/data for testing * add wavefunction model generator * add post request for testing * initialize static_website branch - frontend only - web app will serve GIFs based on users' inputs * update README * initialize wavefunction logic to display GIFs - 1x10 GIF - 5x5 GIF * add wavefunction images * add wavefunction logic to display imgs accordingly * organize & add labels to wavefunction form * tunneling done, home done * rename tunneling script & remove errors * begin refactoring UI - add custom menu component - add custom description box component - style side bar / left column - style select input boxes - style img/ GIF * add interference julia script/model generator * move images to directory & improve UI * add potential design plan for dynamic website * added homepage & split pages into separate files * add deployment resources to dynamic website plan * refactor sider & place models side by side * remove styling bug in wavefunction * configure w/ SonarCloud * update Solar Cloud configurations * add resource to dynamic website design plan * enable analysis on all branches w/ Sonar Cloud * enable analysis on all branches w/ Sonar Cloud * update README w/ Sonar Cloud information * add Sonar Cloud configurations * configure Sonar Cloud w/ jest * initialize interference feature * update wavefunction/tunneling & improve UI * begin updating images/GIFs * update sonar cloud settings * update interference & add comments * dashboard + all gifs generated * fix: remove unused imports/variables * fix: tunneling page padding * fix: input validation if no input is selected, set to default values * add _redirects file * update README.md * student feedback * build errors, had to remove unused import * FEATUE: use online server for gif construct * FEATUE: add backend server code * Applying changes * adding requirements.txt * adding stashed changes * Updating tunneling.py with brighter contrast and axis labels * Edit toggle, capture value and attempt to create url * Updating app.py to accept float values * updated sliders, connected to backend api successfully, encoding gifs to base64 * Modified file structure to lean better assist backend development * Fixing 2d generation when saving gifs * decode base64 gifs and dynamically display to frontend * default gifs display, title fix, refactor base64 encoding * Adding small changes to frontend * model won't reload w/o slider changes, set all sider width, testing html5 vid * FIX: align axis for both gif in tunneling * merge * added firebase dependencies, .env, fixing commit history * test build * test build 2 * edit workflow * fixing url in dashboard component * fix 404 when refresh page * Using dynamic hosted backend cloud function for API call * Adding correct routing to dynamic functions backend * fixing url * UPDATE: new pages added * update: requirement file * update cache files * update firebase code * update latest dev version * Update README.md Edited the getting started to be more clear * Adding updated readme * Removing firebase_functions code, restoring local running capabilities, etc * Updating readme, deleting old code, and updating frontend API paths * Update README.md after following instructions * abstract host info * Update README.md * add setup to gitignore * Update README with removing git index * Update README.md with index ignore * Update README.md * Adding dockerfile, updating readme, and cleaning frontend code * Adding default to localhost:3001 * Adding the sonar-project file back into repo * Removing old SonarCloud information and actions * changed layout * changed layout * adding navbar * adding navbar * remove sider, moved sliders next to model * remove sider, moved sliders next to model * Hiding navbar on home page, added markdown rendering of custom card components, pulling content from content.json file instead of written directly in the page * Hiding navbar on home page, added markdown rendering of custom card components, pulling content from content.json file instead of written directly in the page * Cleaning and restructuring Tunneling and Interference, and editing custom component to show the name of the model it is generating * Cleaning and restructuring Tunneling and Interference, and editing custom component to show the name of the model it is generating * mongodb setup, operation failing * mongo atlas connection working * mongo atlas connection working * Fixing code in SingleQgate page * Fixing code in SingleQgate page * working readwrite using gridfs, need file checking * working readwrite using gridfs, need file checking * hide connection string, add instructions to readme * hide connection string, add instructions to readme * remove imports * remove imports * gridFS configs and error handling * gridFS configs and error handling * Update README.md * fix abspath in model generators * Update README.md * fix abspath in model generators * fix config filepath * fix config filepath * metadata in files, fix scipt to store unique files, initialize cache * metadata in files, fix scipt to store unique files, initialize cache * Migrate off GridFS, uploading regular bson * Migrate off GridFS, uploading regular bson * Downsized and uploaded interference model, abstracted db API, relative imports * Downsized and uploaded interference model, abstracted db API, relative imports * don't close mongo client * don't close mongo client * Fixed tunneling page component for rendering animation, made component for stack, with advanced mode * Fixed tunneling page component for rendering animation, made component for stack, with advanced mode * Update Tunneling component and removing use of seperate component. * Update Tunneling component and removing use of seperate component. * Remove import statement of unused component file * Remove import statement of unused component file * lint * lint * updating the interference page animation scaling and advanced button * mongodb setup, operation failing * updating the interference page animation scaling and advanced button * Finished merge and updated interference * generate and upload new model when current model not found * Update Tunneling.tsx moving the slider names down 10 px * generate and upload new model when current model not found * Update Tunneling.tsx moving the slider names down 10 px * Updating slider spacing and stack spacing on single gate pages * Updating slider spacing and stack spacing on single gate pages * Remove unused component file * Remove unused component file * Changing the scaling of animations on tunneling and interference pages * Changing the scaling of animations on tunneling and interference pages * Changing the scaling of animations on the spin gate page * Changing the scaling of animations on the spin gate page * updated advanced mode to change color of sliders and change values on the interference page * updated advanced mode to change color of sliders and change values on the interference page * removed automatic snackbar upon loading page * removed automatic snackbar upon loading page * Adding units to interference page * Adding units to interference page * Update requirements.txt * Update requirements.txt * fix tunneling generator bug, redraw tunneling splots * fix tunneling generator bug, redraw tunneling splots * single instance Mongo client, delete local cache files * single instance Mongo client, delete local cache files * Add files via upload * Add files via upload * Update content.json * Update content.json * Add files via upload * Add files via upload * Implement websocket to stream loading messages to frontend * Send error and info logs to frontend through websocket, reorganize functions for readability, log progress of model generation * Send error and info logs to frontend through websocket, reorganize functions for readability, log progress of model generation * Remove autosetting snackbar on frontend, now only emitting messages from Flask app * Remove autosetting snackbar on frontend, now only emitting messages from Flask app * adding initial QFT page, navbar, and routing * adding initial QFT page, navbar, and routing * Deleting an excess line * Implement websocket to stream loading messages to frontend * Deleting an excess line * Fixing styling and CSS * Fixing styling and CSS * Making a custom component for the sliders * Making a custom component for the sliders * updating interference pages using custom styling and new slider component * updating interference pages using custom styling and new slider component * removing un-needed imports * removing un-needed imports * updating package lock with socket io packages * updating package lock with socket io packages * test for fixing commit history * test for fixing commit history * Updating QFT code with Qimao's changes * Update README.md * add socketio to requirements * Update README.md * adding qft backend changes * adding qft animations * Update content.json Added QFT images * for ec2 hosting * fix qft error, change host for deploy --------- Co-authored-by: Raiden <[email protected]> Co-authored-by: Raiden Williams <[email protected]> Co-authored-by: rohph <[email protected]> Co-authored-by: Raiden <[email protected]>
1 parent ca847f4 commit 4035f1e

39 files changed

+104510
-1574543
lines changed

.gitignore

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,17 @@
1313
/src/setup/
1414

1515
# misc
16+
.ini
1617
.DS_Store
17-
.env
18-
.env.local
19-
.env.development.local
20-
.env.test.local
21-
.env.production.local
2218

19+
quantum_app_backend/cache
2320
npm-debug.log*
2421
yarn-debug.log*
2522
yarn-error.log*
2623

2724
# other
2825
.vscode
26+
node_modules
2927
.firebase/
3028

3129
# Created by https://www.toptal.com/developers/gitignore/api/python,macos,pycharm,visualstudiocode

README.md

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,15 @@
33
Computational Nano Lab, UFL
44

55
## Architecture Overview
6-
![image](https://github.com/user-attachments/assets/36da6434-28a5-4bd1-9704-8288bce7b5be)
7-
6+
![image](https://github.com/user-attachments/assets/6abb6ef0-1a6d-466c-b85a-ab1bcdbac57a)
87

98
## Getting Started
109

1110
### Prerequsites
1211
* Node 👉 install [here](https://nodejs.org/en/download/package-manager)
1312
* Miniconda3 👉 install [here](https://docs.anaconda.com/miniconda/miniconda-install/)
1413

15-
### Installation - Part 1
14+
### Installation - Part 1 - Frontend Hosting
1615

1716
1. Clone the repository
1817
```
@@ -28,8 +27,16 @@ Computational Nano Lab, UFL
2827
npm start
2928
```
3029
31-
### Installation - Part 2
30+
### Installation - Part 2 - Hosting Backend APIs
3231
32+
#### Run the container in Docker (Preferred)
33+
1. Run backend in Docker container
34+
```
35+
cd quantum_app_backend
36+
docker build -t flask-backend .
37+
docker run -p 3001:3001 flask-backend
38+
```
39+
#### Run the envirnment in Conda (Preferred)
3340
1. Create a conda enviornment for the project
3441
```
3542
conda create --name my_env_name python=3.12
@@ -51,11 +58,6 @@ Computational Nano Lab, UFL
5158
```
5259
python app.py
5360
```
54-
5. Run backend in Docker container
55-
```
56-
docker build -t flask-backend .
57-
docker run -p 3001:3001 flask-backend
58-
```
5961
6062
### Running Locally
6163
@@ -65,17 +67,26 @@ For example, I run the backend and I get "Running on http://127.0.0.1:3001". Tak
6567
6668
2. Utilize 2 terminals in parallel to run the back and the frontend.
6769
68-
3. If you're cloning the project for the first time and changes to `/src/setup` are being tracked, run:
70+
3. Rename the `sample_ini` to `.ini` and replace the variable with the connection string from MongoDB Atlas.
6971
```
70-
git update-index --assume-unchanged src/setup/
72+
mv sample_ini .ini
7173
```
7274
75+
[Get your Atlas cluster](https://docs.atlas.mongodb.com/getting-started/) with [sample data](https://docs.atlas.mongodb.com/sample-data/) set [connection string](https://docs.atlas.mongodb.com/connect-to-cluster/) and place in `DB_URI` parameter under `.ini`
76+
77+
Make sure you have IP in the Atlas [access list](https://docs.atlas.mongodb.com/security/add-ip-address-to-list/) and username/password of your Atlas user correctly specified.
78+
7379
## File Structure
7480
- `/src/` - Contains the source code for the React website.
7581
- `/src/App.tsx` - The main entry point for the website. This is where the React Router is set up to route to the different pages.
7682
- `/src/pages` - Where each sub-page files are located
7783
- `/backend_functions/` - Contains the backend code for handling requests and generating model gifs
7884
- `/backend_functions/model_generators` - Contains the python code used to generate each model, ie `interference.py` or `tunneling.py`
85+
- `/src/data/content.json` - Contains the data for each text block on a page.
86+
- If you are generating a new page you may use the component `<CustomDescriptionBox pageTitle=<name>/>`. This will make a box for each item in the pages content. The message will be rendered in markdown style for a better visual experience.
87+
- It can handle image urls with the `imageUrl` parameter or a file in the public folder with `imagePath`
88+
- For example `"imagePath": "/Single_V4.png"`
89+
- For example `"imageUrl": "https://quantumawareness.net/wp-content/uploads/2019/01/doubleslottest-1400x793-71-2.jpg"`
7990
8091
## Tech Stack
8192
### React

0 commit comments

Comments
 (0)