Ever wondered if real-time physics simulations in SQL were possible? Imagine doing everything: the physics, the simulation loop, the rendering state and even a secret mechanic, all inside a simple database. Well, look no futher, cuz it's right here.
There are 2 main components:
- The
SQL config script. - The
web app(my bad for not wanting to look at ASCII chars).
The SQL script is written for PostgreSQL and will probably not work with other engines.
To load it, run the following command:
# For local database
path/to/SQLSandSim > psql -U <username> -d <db> -a -f schema.sql
# For remote database
path/to/SQLSandSim > psql -h <host> -U <username> -d <db> -a -f schema.sqlAfter this, all the necessary stuff will be loaded into the sand_sim database.
The web app expects a .env file with an appropriate configuration.
Use .env.example as an example for what a configuration should look like.
Afterwards, run these command to start the app and enjoy your sims:
path/to/SQLSandSim/app > npm i
path/to/SQLSandSim/app > npm start