Skip to content

Conversation

@theg1239
Copy link
Member

@theg1239 theg1239 commented Nov 1, 2025

No description provided.

Krishang-Zinzuwadia and others added 25 commits October 31, 2025 14:49
feat: added class joining for students  and removed dummy auth for now
feat(quiz): integrate backend API and improve code clarity

ashman to fix
feat: added classes integration with the db
@theg1239
Copy link
Member Author

theg1239 commented Nov 1, 2025

@codex deeply review this pr

@theg1239 theg1239 marked this pull request as draft November 1, 2025 21:59
feat : integrated quiz notes and announcements
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a 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".

Comment on lines 1 to 37
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);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

Copy link
Collaborator

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants