Fix Run and Submit button Execution API (RapidAPI -> Wandbox) - #146
Fix Run and Submit button Execution API (RapidAPI -> Wandbox)#146hansikareddy29 wants to merge 2 commits into
Conversation
|
@hansikareddy29 is attempting to deploy a commit to the aviralsaxena16's projects Team on Vercel. A member of the Team first needs to authorize it. |
🎉 Thanks for Your Contribution to CanonForces!
|
|
Caution Review failedThe pull request is closed. WalkthroughThe PR adds run and submit functionality to coding questions by updating the CodeEditor component to accept and pass run/submit callbacks, styling new Run/Submit buttons in the Output component, enhancing the code execution API with RapidAPI and Wandbox fallback handling, and implementing client-side workflows for executing and submitting user code to Firestore. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant CodeEditor
participant API
participant RapidAPI
participant Wandbox
participant Firestore
rect rgba(100, 150, 200, 0.5)
Note over User,Firestore: Run Code Flow
User->>CodeEditor: Click Run Button
CodeEditor->>API: POST /api/hello (code, language, input)
API->>RapidAPI: Submit code execution request
alt RapidAPI Success
RapidAPI-->>API: Execution result
else RapidAPI Fails
API->>Wandbox: Fallback: Submit to Wandbox
Wandbox-->>API: Execution result
end
API-->>CodeEditor: Response (output or error)
CodeEditor->>User: Display execution result
end
rect rgba(150, 150, 100, 0.5)
Note over User,Firestore: Submit Solution Flow
User->>CodeEditor: Click Submit Button
CodeEditor->>API: Verify user authentication
API->>Firestore: Save submission to contest_submissions
Firestore-->>API: Submission saved
API->>Firestore: Check POTD alignment
alt Is Problem of the Day
API->>Firestore: Update user coins & streak (transaction)
Firestore-->>API: Transaction complete
end
API-->>User: Submission confirmed with feedback
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested reviewers
Poem
✨ Finishing Touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
name: "📦 Pull Request"
title: "PR: Fix Code Execution Fallback"
📌 Related Issue
✨ Changes Introduced
🤔 Why This Change?
🖼️ Screenshots
🧪 Testing
npm test)npm run test:integration)stdoutfrom Wandbox.📝 Documentation Updates
✅ Checklist
👥 Reviewers
🚀 Deployment Notes
💬 Community & Support
Need help or want to discuss this PR?
Join our Discord community 👉 CanonForces Discord
💡 Additional Notes (If any)
(None)
Summary by CodeRabbit
Release Notes
New Features
Style