Skip to content

A web-based graphing program for 3D functions (IB Computer Science IA)

Notifications You must be signed in to change notification settings

bishan-batel/grapher-3d

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Grapher 3D

This is my IB Computer Science HL IA (Internal Assessment), a 3D graphing program. There are 3 major sections of this codebase, with one being meant for a server. There is a live demo of this website in action at https://grapher-3d.web.app. Keep in note, account functionality is broken on the demo as I do not have the resources to host the server section of the app.

Directories

The /server directory contains a netbeans project for the HTTP server that runs the website, the only thing you need to do to run the server is to have the Javascript / Rust website built for deployment, as well as linking the single Derby.jar library in netbeans (if not already). When you run it, simply head to localhost:3000

The /client directory contains a NPM react-typescript project that contains everything related to the actualy general dispaly of the website (excluding the graph itself)

The /lib directory contains a rust crate (project) that is loaded by the react project as a WASM (web-assembly) package to run in the browser. The rust crate is responsible for parsing graph equations on the website, as well as displaying them using the browers's native WebGL2 API (excluded on Safari, Internet Explorer, or any legacy browser)

How to build the Website

1. Have Docker installed

Docker is a program for servers to be be able to reproduce enviorments efficiently, in where you have ea single file (the 'Dockerfile') that describes the enviorment the server needs to run (ex. Ubuntu with JDK 17). The java portion of my program does not need Docker, as all you need is Netbeans & JDK 11, but because of the tools I used to build the website (Rust, Typescript, NodeJs, and Web-Sys) it is easier for both you to only have to download Docker to get these dependicies to run the program rather than managing downloading these other things (also allows for easier cleanup because once your done all you need to do is uninstall docker and not 50 other things).

https://docs.docker.com/desktop/mac/install/

2. Be able to run Docker from command line

This process should be automatic after installing Docker, if it isn't though then I have no idea what to do (sorry).

docker -v

3. Open a terminal and CD into the downloaded directory

cd path/to/project/directory

4. Build the docker image

⚡ Not neccessary if you have already ran this step, building multiple times has no effect unless you want to change the Dockerfile for some reason
./setup.sh

# OR
# if permission is denied you may have to give
# executable permission to the script
chmod +x ./setup.sh
./setup.sh
# (you do not need to run the above 2 commands if it worked the first time)

5. Build the Website

If you ever change the source code, you will need to run this command again to build it for the server to recognize.

NOTE: You do not need to restart the Java server if you rebuild the website source

./build_js.sh

# OR
# if permission is denied you may have to give
# executable permission to the script
chmod +x ./build_js.sh
./build_js.sh
# (you do not need to run the above 2 commands if it worked the first time)

After these steps, there should be a created folder in /server/src/ named "js-build"

Once you've confirmed that the folder exists, simply open up the /server directory in netbeans and run the project.

About

A web-based graphing program for 3D functions (IB Computer Science IA)

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published