From 07ae17a2338fa2082e75f0095d868c5982309c42 Mon Sep 17 00:00:00 2001 From: Vishal <321vishalds@gmail.com> Date: Sun, 28 Jul 2024 09:43:24 +0530 Subject: [PATCH] Documented (#2) * Create README.md * added contribution guidelines * documented code * Corrected diagram --- CONTRIBUTING.md | 37 ++++++++++++ README.md | 124 ++++++++++++++++++++++++++++++++++++++ scripts/builder.js | 6 ++ scripts/screenshot.js | 4 +- src/config.rs | 3 + src/handlers/user.rs | 5 ++ src/main.rs | 2 + src/models/site.rs | 2 + src/models/template.rs | 5 ++ src/server/mod.rs | 3 + src/services/preview.rs | 3 + src/services/tempfiles.rs | 1 + src/utils.rs | 7 --- 13 files changed, 193 insertions(+), 9 deletions(-) create mode 100644 CONTRIBUTING.md create mode 100644 README.md delete mode 100644 src/utils.rs diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..3a59381 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,37 @@ +# Contributing + +First of all, a huge thank you for looking to contribute to this repository! This project was concieved and built at [FOSS Hack 4.0](https://fossunited.org/fosshack/2024), a hackathon for building open-source software. As such, everything from the architecture of this server to the code has been *hacked up* in a couple of hours. That is to say, this is messed up lol. There's tons of stuff to improve. + +## Improvements +These are some of the stuff that we'd like to improve upon + +### Reduce memory footprint +Any changes to reduce the overall memory footprint of the application are welcome. We're sure there are lots of `String` variables instead of string literals waiting for you to get started with. 😂 Just for context, there are 36 `.clone()` calls throughout the codebase right now! That's 36 deep copy operations waiting to be removed. + +Any changes improving performance in any other way are appreciated as well. Eliminating JavaScript is welcome. More on that below. + +### Complete overhaul? +Sure, why not! As said earlier, this was hacked up and we're not sure this is the best approach to build this server. Right now, it works and that's all we know! If you find a way to overhaul it and make it better, please do so and open a PR! + +> Note: If your PR changes any of the endpoint behaviors or names, please coordinate with us by [messaging me on telegram](https://t.me/vishalds/). + +### Eliminating JavaScript +The screenshot script can maybe be replaced, but we couldn't find an effective solution for that right now. The most effective workaround for this would be to switch the previews altogether to use an `