create a student profile page having details such as name,id ,email,phone Number,addres,profile picture,academic details (like degree , name of the board exam ,subjects,year of passing,grade/marks).use mongodb to store the details perform crud operations
Note: you can make assumptions as per the requirements in ejs files
I'll create a student profile page with MongoDB integration and CRUD operations. Let's build this using Next.js with the App Router.
I'll create a student profile page with MongoDB integration using the traditional Next.js Pages Router instead of the App Router.
I've created a complete student profile management system using Next.js with the Pages Router and MongoDB. Here's what's included:
pages/index.js): Lists all students with basic info and action buttonspages/students/[id].js): Detailed view of a student profilepages/students/new.js): Form to create a new student profilepages/students/edit/[id].js): Form to update an existing student profileGET /api/students: Fetch all studentsPOST /api/students: Create a new studentGET /api/students/[id]: Fetch a specific studentPUT /api/students/[id]: Update a specific studentDELETE /api/students/[id]: Delete a specific studentlib/dbConnect.jsmodels/Student.jsSet up your MongoDB connection string as an environment variable:
MONGODB_URI=your_mongodb_connection_stringRun the development server:
npm run devhttp://localhost:3000The system allows you to manage student profiles with personal information and academic details. You can add multiple academic records for each student, making it flexible for different educational backgrounds.
Please make sure to add the following environment variable to your project:
You can send messages while the preview loads