|
| 1 | +# ByteCode Compiler - Frontend |
| 2 | + |
| 3 | +Professional web interface for the ByteCode Compiler featuring a terminal-style code editor, comprehensive documentation, and Azure backend integration. |
| 4 | + |
| 5 | +## Features |
| 6 | + |
| 7 | +- ✨ **Beautiful Landing Page** - Calm, attractive design with smooth animations |
| 8 | +- 💻 **Terminal Interface** - Monaco Editor with terminal aesthetics |
| 9 | +- 📚 **Documentation Viewer** - Interactive docs with syntax highlighting |
| 10 | +- 🎨 **Full Customization** - Dark/Light themes, terminal colors, fonts, sizes |
| 11 | +- ⚡ **Optimized Performance** - Next.js with server-side rendering |
| 12 | +- 🔗 **Azure Integration** - Real-time compilation via REST API |
| 13 | + |
| 14 | +## Tech Stack |
| 15 | + |
| 16 | +- **Framework**: Next.js 14 (App Router) |
| 17 | +- **Language**: TypeScript |
| 18 | +- **Styling**: Tailwind CSS |
| 19 | +- **Editor**: Monaco Editor (VS Code editor) |
| 20 | +- **Animation**: Framer Motion |
| 21 | +- **Icons**: Lucide React |
| 22 | + |
| 23 | +## Quick Start |
| 24 | + |
| 25 | +```bash |
| 26 | +# Install dependencies |
| 27 | +cd frontend |
| 28 | +npm install |
| 29 | + |
| 30 | +# Run development server |
| 31 | +npm run dev |
| 32 | + |
| 33 | +# Open http://localhost:3000 |
| 34 | +``` |
| 35 | + |
| 36 | +## Project Structure |
| 37 | + |
| 38 | +``` |
| 39 | +frontend/ |
| 40 | +├── app/ |
| 41 | +│ ├── page.tsx # Landing page |
| 42 | +│ ├── layout.tsx # Root layout |
| 43 | +│ ├── compiler/ |
| 44 | +│ │ └── page.tsx # Terminal interface |
| 45 | +│ └── docs/ |
| 46 | +│ └── page.tsx # Documentation viewer |
| 47 | +├── components/ |
| 48 | +│ ├── Header.tsx # Navigation header |
| 49 | +│ ├── Footer.tsx # Credits footer |
| 50 | +│ ├── ThemeToggle.tsx # Dark/Light mode |
| 51 | +│ ├── Terminal.tsx # Code editor |
| 52 | +│ └── DocsNav.tsx # Docs sidebar |
| 53 | +├── lib/ |
| 54 | +│ ├── api.ts # Azure API client |
| 55 | +│ └── themes.ts # Terminal themes |
| 56 | +└── public/ |
| 57 | + └── (assets) |
| 58 | +``` |
| 59 | + |
| 60 | +## Environment Variables |
| 61 | + |
| 62 | +Create `.env.local`: |
| 63 | + |
| 64 | +```env |
| 65 | +NEXT_PUBLIC_API_URL=http://57.159.30.64/api |
| 66 | +NEXT_PUBLIC_GITHUB_URL=https://github.com/IsVohi/ByteCode-Compiler |
| 67 | +NEXT_PUBLIC_PORTFOLIO_URL=YOUR_PORTFOLIO_URL |
| 68 | +``` |
| 69 | + |
| 70 | +## Pages |
| 71 | + |
| 72 | +### Landing Page (`/`) |
| 73 | +- Hero section with compiler description |
| 74 | +- Two CTA buttons: Open Compiler | Read Docs |
| 75 | +- Features showcase |
| 76 | +- Footer with credits |
| 77 | + |
| 78 | +### Compiler (`/compiler`) |
| 79 | +- Monaco Editor with terminal theme |
| 80 | +- Help panel (syntax reference) |
| 81 | +- File upload (.src files) |
| 82 | +- Command palette |
| 83 | +- Output display |
| 84 | +- Customization sidebar |
| 85 | + |
| 86 | +### Documentation (`/docs`) |
| 87 | +- Navigation sidebar |
| 88 | +- Markdown renderer |
| 89 | +- Search functionality |
| 90 | +- Syntax highlighting |
| 91 | + |
| 92 | +## Header Links |
| 93 | + |
| 94 | +- GitHub Repository |
| 95 | +- Portfolio (customizable) |
| 96 | +- Theme Toggle dark/Light) |
| 97 | + |
| 98 | +## Footer |
| 99 | + |
| 100 | +Created by **Vikas Sharma** © 2024 |
| 101 | +All rights reserved. |
| 102 | + |
| 103 | +## Deployment |
| 104 | + |
| 105 | +### Vercel (Recommended) |
| 106 | + |
| 107 | +```bash |
| 108 | +# Install Vercel CLI |
| 109 | +npm i -g vercel |
| 110 | + |
| 111 | +# Deploy |
| 112 | +vercel |
| 113 | + |
| 114 | +# Production |
| 115 | +vercel --prod |
| 116 | +``` |
| 117 | + |
| 118 | +Configuration is in `vercel.json`. |
| 119 | + |
| 120 | +### Environment Variables on Vercel |
| 121 | + |
| 122 | +Add these in Vercel dashboard: |
| 123 | +- `NEXT_PUBLIC_API_URL` |
| 124 | +- `NEXT_PUBLIC_GITHUB_URL` |
| 125 | +- `NEXT_PUBLIC_PORTFOLIO_URL` |
| 126 | + |
| 127 | +## Development |
| 128 | + |
| 129 | +```bash |
| 130 | +# Install dependencies |
| 131 | +npm install |
| 132 | + |
| 133 | +# Run dev server |
| 134 | +npm run dev |
| 135 | + |
| 136 | +# Build for production |
| 137 | +npm run build |
| 138 | + |
| 139 | +# Start production server |
| 140 | +npm start |
| 141 | + |
| 142 | +# Lint code |
| 143 | +npm run lint |
| 144 | +``` |
| 145 | + |
| 146 | +##Terminal Customization |
| 147 | + |
| 148 | +Users can customize: |
| 149 | +- Background colors |
| 150 | +- Text colors |
| 151 | +- Font family |
| 152 | +- Font size |
| 153 | +- Cursor style |
| 154 | +- Line height |
| 155 | + |
| 156 | +Themes are saved to localStorage. |
| 157 | + |
| 158 | +## API Integration |
| 159 | + |
| 160 | +The frontend connects to your Azure VM API: |
| 161 | + |
| 162 | +```typescript |
| 163 | +const response = await fetch(`${API_URL}/compile`, { |
| 164 | + method: 'POST', |
| 165 | + headers: { 'Content-Type': 'application/json' }, |
| 166 | + body: JSON.stringify({ code }) |
| 167 | +}); |
| 168 | +``` |
| 169 | + |
| 170 | +## Performance |
| 171 | + |
| 172 | +- Server-side rendering (SSR) |
| 173 | +- Code splitting |
| 174 | +- Image optimization |
| 175 | +- Font optimization |
| 176 | +- Lazy loading |
| 177 | + |
| 178 | +## Browser Support |
| 179 | + |
| 180 | +- Chrome (latest) |
| 181 | +- Firefox (latest) |
| 182 | +- Safari (latest) |
| 183 | +- Edge (latest) |
| 184 | + |
| 185 | +## License |
| 186 | + |
| 187 | +MIT |
| 188 | + |
| 189 | +--- |
| 190 | + |
| 191 | +**Note**: This is a professional showcase project demonstrating full-stack development capabilities. |
0 commit comments