Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace JDoodle with Piston #20

Open
Rishabh-malhotraa opened this issue Mar 24, 2021 · 4 comments · May be fixed by Rishabh-malhotraa/caucus-server#6
Open

Replace JDoodle with Piston #20

Rishabh-malhotraa opened this issue Mar 24, 2021 · 4 comments · May be fixed by Rishabh-malhotraa/caucus-server#6

Comments

@Rishabh-malhotraa
Copy link
Owner

Jdoodle you are capped to 200 request per day, while piston is free and open source you can have your own docker container running or just use the public API for execution and the only limit is not more that 5 request per second 🚀.

There is no rush right now as we are not exceed more than 100 request per day, you can check the number of request left with the
http://caucus-app.herokuapp.com/api/credit-spent

https://github.com/engineer-man/piston
https://www.jdoodle.com/compiler-api

@GregDevProjects
Copy link

Hi @Rishabh-malhotraa! Can I work on this for hacktoberfest?

@Rishabh-malhotraa
Copy link
Owner Author

Sure go right ahead. Here is a bit more context about this issue.

So for us to run code on the browser, we make an API call to a remote code execution service, right now we use something called jdoodle, it only provides us with 200 execution per day. I look to migrate this to Piston, which is free and open-source and has unlimited executions per day.

For this, you need to go through the Piston docs and should send a post request to the piston server for code execution in the format they accept.

The changes you would be required to make is in both the caucus and caucus-server repository,

Changes to the backend
https://github.com/Rishabh-malhotraa/caucus-server/blob/main/src/routes/api-routes.ts
https://github.com/Rishabh-malhotraa/caucus-server/blob/main/src/utils/getLanguageVersion.ts

Changes to the frontend
https://github.com/Rishabh-malhotraa/caucus/blob/main/src/service/CodeExecutionInfo.tsx
https://github.com/Rishabh-malhotraa/caucus/blob/main/src/component/InputOutputFile/InputOutputFile.tsx

@GregDevProjects
Copy link

GregDevProjects commented Oct 23, 2021

@Rishabh-malhotraa can you share the environment variables needed to run https://github.com/Rishabh-malhotraa/caucus-server with me?

Never mind! I signed up for a free account and the endpoints are working for me now

@GregDevProjects
Copy link

@Rishabh-malhotraa here's the PR: Rishabh-malhotraa/caucus-server#6

I tested it locally, and it seemed to work fine without any modifications to the frontend. I'm no too familiar with this repo though, so let me know if I'm missing something!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants