16โ โโโ database/
17โ โ โโโ migrations.ts # Database schema setup
18โ โ โโโ queries.ts # Database query functions
19โ โโโ routes/
20โ โ โโโ jobs.ts # Job posting endpoints
68 const initialData = window.__INITIAL_DATA__ || {};
69
70 function App() {
71 const [code, setCode] = useState('// Paste your code here for AI-powered review\nfunction example() {\n var x = 1;\n if (x = 1) {\n console.log("Hello World");\n }\n}');
72 const [language, setLanguage] = useState('javascript');
73 const [filename, setFilename] = useState('');
34 private static detectLanguageByContent(code: string): string {
35 const patterns = [
36 { lang: 'javascript', patterns: [/\bfunction\b/, /\bconst\b/, /\blet\b/, /\bvar\b/, /=>/] },
37 { lang: 'typescript', patterns: [/\binterface\b/, /\btype\b/, /:\s*\w+/, /\bas\b/] },
38 { lang: 'python', patterns: [/\bdef\b/, /\bimport\b/, /\bfrom\b.*\bimport\b/, /\bclass\b.*:/] },
152 const complexityIndicators = [
153 /\bif\b/g, /\belse\b/g, /\bfor\b/g, /\bwhile\b/g,
154 /\bswitch\b/g, /\btry\b/g, /\bcatch\b/g, /\bfunction\b/g,
155 /\bclass\b/g, /\binterface\b/g
156 ];
7}
8
9export default function MessageCenter({ user }: MessageCenterProps) {
10 const [messages, setMessages] = useState<Message[]>([]);
11 const [loading, setLoading] = useState(true);
9}
10
11export default function StudentForm({ user, student, onNavigate }: StudentFormProps) {
12 const isEditing = !!student;
13
8}
9
10export default function StudentList({ user, onNavigate }: StudentListProps) {
11 const [students, setStudents] = useState<Student[]>([]);
12 const [loading, setLoading] = useState(true);
8}
9
10export default function Dashboard({ user, onNavigate }: DashboardProps) {
11 const [stats, setStats] = useState<DashboardStats | null>(null);
12 const [loading, setLoading] = useState(true);
7}
8
9export default function Login({ onLogin }: LoginProps) {
10 const [formData, setFormData] = useState<LoginRequest>({
11 username: '',
17}
18
19export default function App() {
20 const [state, setState] = useState<AppState>({
21 user: null,
59
60// Markdown renderer component
61function MarkdownRenderer({ content }: { content: string }) {
62 const renderMarkdown = (text: string) => {
63 return text
110
111// Severity badge component
112function SeverityBadge({ severity }: { severity: string }) {
113 const colors = {
114 low: 'bg-green-500',
126
127// Chunk type badge component
128function ChunkTypeBadge({ type }: { type: string }) {
129 const colors = {
130 bot_review: 'bg-blue-500',
151
152// Individual chunk analysis component
153function ChunkAnalysisCard({ analysis }: { analysis: ChunkAnalysis }) {
154 // Ensure all data is properly formatted for rendering
155 const safeAnalysis = {
261}
262
263function App() {
264 const [prText, setPrText] = useState("");
265 const [analysis, setAnalysis] = useState<AnalysisResponse | null>(null);
538
539// Mount the app with error handling
540function mountApp() {
541 try {
542 const rootElement = document.getElementById("root");