Table of Contents
This is a side project focused on creating a code sandbox that allows code execution on the client-side. The main goal was to explore the idea of building a minimalistic sandbox similar to platforms like LeetCode.
The project explores both firebase (checkout firebase
branch) and localstorage as db sources. The main
branch uses localstorage as db and authentication is maintained across sessions.
This is a standard Nextjs project. Do install the necessary packages and get hacking. Do note that, the authentication flow in the main branch is a simulated one, meaning browser storage is leveraged to handle these flows. If you intend to have a backend service, do checkout out the firebase branch. Basic implementation is already in place with limited sandbox functionality. Initially, started with firebase but later decided to disable it due to billing paranoia 😅
-
To get started do install the pacakges using the following command
npm install
-
To run in dev mode
npm run dev
NOTE: You will have to setup envs by yourself, do refer env type declaration(env.d.ts) for naming conventions.
- Move code execution to workers
- Truncate execution results output
- Handle non-primitive inputs
- Handle timeout and rogue loops
See the open issues for a full list of proposed features (and known issues).
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the MIT License. See LICENSE.txt
for more information.
Project Link: https://github.com/Chipsetjunkie/LeanCode