You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I wanted to explore a way to make it easier to contribute to the p5.js-web-editor project, and one what I thought that could be done would be to make it possible to run it and make changes on Replit.com
The nice thing about Replit.com is that anybody with a web browser-- even on a locked down chromebook, school computer, or tablet-- can edit and run server side code.
Added Replit specific files (hopefully they won't confuse people or cause issues running in other environments)
In order to host the preview site, it is necessary to map it to a same origin route (i.e. /preview).
Replit.com only supports hosting a site a single domain, no subdomains allowed
Replit.com only supports connections on a single port (cannot host preview site at 8002)
The obvious downside is that this deployment is insecure because sketches are always running in the same origin as the editor site itself but since this is just for development/testing 🤷♂️
Replit.com does not support having a .env file
This is because the filesystem of a public Repl is publicly visible, so putting secrets in .env is inadvisable
Replit.com has its own mechanism for storing secrets in a way that is only accessible to the - Repl owner and the running code (as environment variables)
For simplicity sake I created a file .env.replit that contains non-secret environment settings and sourced it using dotenv-cli, then configured the things that were actually secret as - Replit.com secrets.
There may be alternative approaches.
Outstanding Issues
Resources
Replit.com has strict resource utilization limits, and the way I have set it up this deployment is currently perilously close to the limits of a Boosted, Hacker Plan REPL (Hacker plans cost $7 per month on Replit.com and come with 5 boosts).
The limits on RAM and Storage are the issues. The RAM issue primarily stems from the fact that I am running MongoDB locally in the Repl. I think this could be mitigated by updating the instructions to have the contributor set up external MongoDB hosting. External MongoDB would also help mitigate the storage space issues, but the size of node_modules is a big part of that. So looking for ways to pare down the dependency tree might also be helpful.
Documentation
I need to do some more work on the documentation for this environment.
This discussion was converted from issue #2202 on November 30, 2023 16:17.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
How would this new feature help [increase access]
Provides additional support for integrating the p5.js web editor with Replit, which is commonly used in classrooms.
New feature details:
Content below was pulled from #1995!
I wanted to explore a way to make it easier to contribute to the p5.js-web-editor project, and one what I thought that could be done would be to make it possible to run it and make changes on Replit.com
The nice thing about Replit.com is that anybody with a web browser-- even on a locked down chromebook, school computer, or tablet-- can edit and run server side code.
Here’s the P5.js web editor on Replit.com: https://replit.com/@KumuPaul/p5js-web-editor#developer_docs/replit.md
Potential Concerns
For simplicity sake I created a file .env.replit that contains non-secret environment settings and sourced it using dotenv-cli, then configured the things that were actually secret as - Replit.com secrets.
Outstanding Issues
Resources
Replit.com has strict resource utilization limits, and the way I have set it up this deployment is currently perilously close to the limits of a Boosted, Hacker Plan REPL (Hacker plans cost $7 per month on Replit.com and come with 5 boosts).
The limits on RAM and Storage are the issues. The RAM issue primarily stems from the fact that I am running MongoDB locally in the Repl. I think this could be mitigated by updating the instructions to have the contributor set up external MongoDB hosting. External MongoDB would also help mitigate the storage space issues, but the size of node_modules is a big part of that. So looking for ways to pare down the dependency tree might also be helpful.
Documentation
I need to do some more work on the documentation for this environment.
Beta Was this translation helpful? Give feedback.
All reactions