Skip to content

Commit 90f75ad

Browse files
authored
Merge pull request #1 from TechQuanta/dev_vishal
README
2 parents 2281d14 + b2e7929 commit 90f75ad

File tree

1 file changed

+241
-0
lines changed

1 file changed

+241
-0
lines changed

β€ŽREADME.mdβ€Ž

Lines changed: 241 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,243 @@
11
# Tech_Compiler
22
Code editor created for community .
3+
## Project Overview
4+
This project is an advanced Code Editor and Compiler platform designed specifically for students to write, compile, and run code in multiple programming languagesβ€”all within a single, unified web application. It provides a seamless and interactive experience, empowering learners to experiment and practice coding in an efficient environment.
5+
6+
# Code Editor Compiler
7+
8+
A comprehensive web-based code editor and compiler that supports multiple programming languages in a single platform. This project provides students and developers with an integrated development environment (IDE) for writing, editing, and executing code across various programming languages.
9+
10+
The platform is built using modern web technologies including **React**, **Vite**, and **Tailwind CSS** to ensure a fast, responsive, and visually appealing user interface. It leverages an external compilation API service (requiring an API key) to compile and execute code securely in the cloud.`
11+
12+
## πŸš€ Features
13+
14+
- **Multi-language Support**: Supports 40+ programming languages including:
15+
- JavaScript, TypeScript, Python, Java, C/C++
16+
- Go, Rust, Swift, Kotlin, Ruby, PHP
17+
- Assembly, Bash, Haskell, Scala, SQL, and many more
18+
- Compile and run code from a wide range of programming languages.
19+
20+
- **Monaco Editor Integration**: Professional code editing experience with:
21+
- Syntax highlighting
22+
- Auto-completion
23+
- Error detection
24+
- Dark theme interface
25+
- Minimap navigation
26+
- User-friendly, syntax-highlighted editor to write and edit code.
27+
28+
- **Real-time Code Execution**: Execute code directly in the browser with:
29+
- Live output display
30+
- Error handling and display
31+
- Execution status tracking
32+
- Base64 encoding for secure transmission
33+
34+
- **Responsive Design**: Modern, dark-themed UI built with Tailwind CSS
35+
- **Keyboard Shortcuts**: Ctrl+Enter to run code quickly
36+
- **Resizable Panels**: Adjustable editor and output panel sizes
37+
- **Language Switching**: Easy language selection with version information
38+
- **Code Snippets**: Access to a library of code snippets for common tasks
39+
- **Cloud Compilation:** Code is sent to a secure API to compile and run, handling backend complexities.
40+
- **Fast and Responsive UI:** Built using React with Vite and styled using Tailwind CSS for modern, responsive design.
41+
- **API Key Based Access:** Secure access to the compilation API with a user-provided API key.
42+
43+
44+
## πŸ› οΈ Technologies Used
45+
46+
- **Frontend Framework**: React 19.1.0
47+
- **Build Tool**: Vite 6.3.5
48+
- **Styling**: Tailwind CSS 3.4.17
49+
- **Code Editor**: Monaco Editor (@monaco-editor/react)
50+
- **HTTP Client**: Axios 1.9.0
51+
- **Code Execution API**: Judge0 CE via RapidAPI
52+
- **Language**: JavaScript/JSX
53+
- **Package Manager**: npm
54+
55+
56+
## Prerequisites
57+
- Node.js (version 14 or above)
58+
- npm or yarn package manager
59+
- API key for the code compilation service (you must register on the API provider's platform to obtain this)
60+
61+
62+
## πŸ“¦ Installation
63+
64+
1. **Clone the repository**
65+
```bash
66+
git clone <repository-url>
67+
cd code-editor
68+
```
69+
70+
2. **Install dependencies**
71+
```bash
72+
npm install
73+
```
74+
75+
3. **Configure API Key**
76+
- Sign up for RapidAPI and subscribe to Judge0 CE
77+
- Replace the API key in `src/components/api.js`:
78+
```javascript
79+
"X-RapidAPI-Key": "YOUR_API_KEY_HERE"
80+
```
81+
82+
4. **Start the development server**
83+
```bash
84+
npm run dev
85+
```
86+
87+
5. **Open your browser**
88+
- Navigate to `http://localhost:5173`
89+
90+
## πŸ—οΈ Project Structure
91+
92+
```
93+
code-editor/
94+
β”œβ”€β”€ public/
95+
β”œβ”€β”€ src/
96+
β”‚ β”œβ”€β”€ components/
97+
β”‚ β”‚ β”œβ”€β”€ CompilerLandingPage.jsx # Main editor component
98+
β”‚ β”‚ β”œβ”€β”€ CodeEditorWindow.jsx # Monaco editor wrapper
99+
β”‚ β”‚ β”œβ”€β”€ LanguageSelector.jsx # Language dropdown
100+
β”‚ β”‚ β”œβ”€β”€ Output.jsx # Output display component
101+
β”‚ β”‚ β”œβ”€β”€ api.js # API integration
102+
β”‚ β”‚ └── constant.js # Language configurations
103+
β”‚ β”œβ”€β”€ hooks/
104+
β”‚ β”‚ └── keyPress.js # Custom hook for keyboard shortcuts
105+
β”‚ β”œβ”€β”€ App.jsx # Root component
106+
β”‚ β”œβ”€β”€ main.jsx # Entry point
107+
β”‚ └── index.css # Global styles
108+
β”œβ”€β”€ package.json
109+
β”œβ”€β”€ vite.config.js
110+
└── README.md
111+
```
112+
113+
## πŸ”§ Available Scripts
114+
115+
- `npm run dev` - Start development server
116+
- `npm run build` - Build for production
117+
- `npm run preview` - Preview production build
118+
- `npm run lint` - Run ESLint for code quality
119+
120+
## 🌐 API Integration
121+
122+
This project uses **Judge0 CE API** through RapidAPI for code execution:
123+
124+
- **Submission Endpoint**: Creates code execution jobs
125+
- **Status Endpoint**: Checks execution status and retrieves results
126+
- **Base64 Encoding**: Ensures secure code transmission
127+
- **Polling Mechanism**: Handles asynchronous execution
128+
129+
### Supported Language IDs
130+
- JavaScript (Node.js): 63
131+
- Python 3: 71
132+
- Java (OpenJDK): 62
133+
- C++ (GCC): 54
134+
- C (GCC): 50
135+
- And 35+ more languages...
136+
137+
## πŸ’‘ Usage
138+
139+
1. **Select Language**: Choose from the dropdown menu (40+ languages available)
140+
2. **Write Code**: Use the Monaco editor with syntax highlighting
141+
3. **Execute Code**: Click "Run Code" or press Ctrl+Enter
142+
4. **View Output**: Results appear in the bottom panel
143+
5. **Resize Panels**: Drag the divider to adjust editor/output sizes
144+
6. **Handle Errors**: Error messages are displayed with red highlighting
145+
146+
## 🎯 Key Components
147+
148+
### CompilerLandingPage.jsx
149+
- Main container component
150+
- Manages editor state and execution
151+
- Handles resizing functionality
152+
- Integrates all sub-components
153+
154+
### CodeEditorWindow.jsx
155+
- Monaco editor wrapper
156+
- Provides syntax highlighting
157+
- Manages editor configuration
158+
- Handles code snippets
159+
160+
### LanguageSelector.jsx
161+
- Dropdown for language selection
162+
- Displays language versions
163+
- Updates editor configuration
164+
165+
### Output.jsx
166+
- Displays execution results
167+
- Handles error formatting
168+
- Provides output scrolling
169+
- Toggle visibility
170+
171+
### api.js
172+
- Judge0 CE API integration
173+
- Handles code submission
174+
- Manages execution polling
175+
- Error handling
176+
177+
## πŸš€ Deployment
178+
179+
### Build for Production
180+
```bash
181+
npm run build
182+
```
183+
184+
### Deploy to Vercel/Netlify
185+
1. Connect your GitHub repository
186+
2. Set build command: `npm run build`
187+
3. Set publish directory: `dist`
188+
4. Deploy automatically
189+
190+
## πŸ” Environment Variables
191+
192+
For production deployment, consider using environment variables for the API key:
193+
194+
```javascript
195+
const API_KEY = import.meta.env.VITE_RAPIDAPI_KEY || "your-fallback-key";
196+
```
197+
198+
## 🀝 Contributing
199+
200+
1. Fork the repository
201+
2. Create a feature branch (`git checkout -b feature/AmazingFeature`)
202+
3. Commit your changes (`git commit -m 'Add some AmazingFeature'`)
203+
4. Push to the branch (`git push origin feature/AmazingFeature`)
204+
5. Open a Pull Request
205+
206+
## πŸ“ Future Enhancements
207+
208+
- [ ] File upload/download functionality
209+
- [ ] User authentication and code saving
210+
- [ ] Collaborative editing features
211+
- [ ] Additional language support
212+
- [ ] Custom themes and fonts
213+
- [ ] Code sharing functionality
214+
- [ ] Performance optimizations
215+
- [ ] Mobile responsiveness improvements
216+
217+
## πŸ› Known Issues
218+
219+
- API rate limiting may occur with frequent requests
220+
- Some languages may have longer execution times
221+
- Large output may affect performance
222+
223+
## πŸ“„ License
224+
225+
This project is licensed under the MIT License - see the LICENSE file for details.
226+
227+
## πŸ‘¨β€πŸ’» Author
228+
229+
**[ VISHAL & SHAILENDRA ]**
230+
- GitHub: [@vishal6268],[Shailendrasingh189]
231+
232+
- LinkedIn: [https://www.linkedin.com/in/vishal-choudhary-1690202b7],[https://www.linkedin.com/in/shailendrasingh189].
233+
234+
## πŸ™ Acknowledgments
235+
236+
- Judge0 CE for providing the code execution API
237+
- Monaco Editor team for the excellent code editor
238+
- React and Vite communities for the amazing tools
239+
- Tailwind CSS for the utility-first CSS framework
240+
241+
---
242+
243+
**Note**: This is a graduation-level project demonstrating full-stack development skills, API integration, and modern web technologies. The platform serves as an educational tool for students learning multiple programming languages in a unified environment.

0 commit comments

Comments
Β (0)