-
Notifications
You must be signed in to change notification settings - Fork 10
Dev #8
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
base: main
Are you sure you want to change the base?
Conversation
feat: added class joining for students and removed dummy auth for now
feat: Added Auth
feat: Attendance Working
feat(quiz): integrate backend API and improve code clarity ashman to fix
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
feat: added classes integration with the db
|
@codex deeply review this pr |
feat : integrated quiz notes and announcements
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| import express from 'express'; | ||
| import mongoose from 'mongoose'; | ||
| import cors from 'cors'; | ||
| import dotenv from 'dotenv'; | ||
| import attendanceRoutes from './attendance/attendanceRoutes.js'; | ||
| import classRoutes from './routes/classes.js'; | ||
|
|
||
| dotenv.config(); | ||
|
|
||
| const app = express(); | ||
| const port = 8000; | ||
|
|
||
| app.use(cors()); | ||
| app.use(express.json()); | ||
|
|
||
| const MONGODB_URI = process.env.MONGODB_URI; | ||
|
|
||
| if (!process.env.MONGODB_URI) { | ||
| console.warn( | ||
| ' Warning: MONGODB_URI not found in .env file, using fallback' | ||
| ); | ||
|
|
||
| } | ||
|
|
||
| console.log('Attempting to connect to MongoDB...'); | ||
| mongoose | ||
| .connect(MONGODB_URI) | ||
| .then(() => { | ||
| console.log('Connected to MongoDB successfully'); | ||
| console.log('Database:', mongoose.connection.name); | ||
| }) | ||
| .catch((err) => { | ||
| console.error('MongoDB connection error:', err.message); | ||
| }); | ||
|
|
||
| app.use('/api/attendance', attendanceRoutes); | ||
| app.use('/api/classes', classRoutes); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Quiz API never exposed after server rewrite
The frontend now loads quizzes from GET ${process.env.NEXT_PUBLIC_API_URL}/api/quiz and posts new quizzes to the same path, but the Express entry point only mounts attendance and class routes. backend/index.js no longer wires up /api/quiz, and the alternative server in backend/server.js that did mount those routes uses CommonJS and cannot run with the new "type": "module" package configuration. As a result every quiz fetch or creation call will return 404 once this commit is deployed. Consider importing the quiz router into index.js (after converting it to ESM) so /api/quiz is available on the running server.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i found this fixing this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Krishang-Zinzuwadia fixed this
fix: the quiz issue its done ig
No description provided.