# Candidate Filter Portal A portal for filtering and managing candidate information, built with Next.js and MongoDB. ## Features - User authentication with NextAuth.js - CRUD operations for candidates - Filtering candidates by various criteria - Hotlisting candidates - Admin management of users - Reporting and analytics - Responsive design using Tailwind CSS and shadcn/ui ## MongoDB Integration This project is integrated with MongoDB for data storage. Here's how to set it up: ### MongoDB Connection 1. Make sure you have a MongoDB instance running locally or use MongoDB Atlas for cloud hosting. 2. Copy the `.env.example` file to `.env` and update the `MONGODB_URI` variable with your MongoDB connection string. 3. The application will automatically connect to MongoDB when it starts. ### Data Models The application uses the following main data models: - **Candidate**: Stores candidate information including personal details, skills, education, and interview status. - **User**: Stores user information for authentication and authorization. ### CRUD Operations All CRUD operations for candidates are available through the API: - **Create**: POST to `/api/candidates` - **Read**: GET to `/api/candidates` or `/api/candidates/[id]` - **Update**: PUT/PATCH to `/api/candidates/[id]` - **Delete**: DELETE to `/api/candidates/[id]` Additionally, there are special operations: - **Hotlist**: Add or remove candidates from the hotlist using `/api/hotlist` - **Filter**: Filter candidates by various criteria using query parameters ## Testing MongoDB Connection To test your MongoDB connection and CRUD operations, you can run: ```bash # Test MongoDB connection bun test:mongodb # Interactive CRUD test bun test:crud ``` ## Seeding Demo Data To seed the database with demo data for testing: ```bash # Start the development server first bun dev # In another terminal, run the seed command bun seed ``` You can also seed the database through the admin interface when logged in as an admin user. ## Development ### Prerequisites - Node.js 18+ or bun - MongoDB ### Installing dependencies ```bash bun install ``` ### Running the development server ```bash bun dev ``` Open [http://localhost:3000](http://localhost:3000) with your browser to see the result. ### Building for production ```bash bun build ``` ## Deployment The application is ready to be deployed to Netlify. The `netlify.toml` file contains the necessary configuration. ## License MIT