![]() |
||
---|---|---|
docs | ||
scripts | ||
src | ||
.eslintrc.json | ||
.gitignore | ||
README.md | ||
bun.lock | ||
components.json | ||
eslint.config.mjs | ||
netlify.toml | ||
next.config.mjs | ||
package-lock.json | ||
package.json | ||
postcss.config.mjs | ||
tailwind.config.js | ||
tailwind.config.ts | ||
test-db.js | ||
test-login-flow.js | ||
test-login.js | ||
tsconfig.json |
README.md
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
- Make sure you have a MongoDB instance running locally or use MongoDB Atlas for cloud hosting.
- Copy the
.env.example
file to.env
and update theMONGODB_URI
variable with your MongoDB connection string. - 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:
# Test MongoDB connection
bun test:mongodb
# Interactive CRUD test
bun test:crud
Seeding Demo Data
To seed the database with demo data for testing:
# 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
bun install
Running the development server
bun dev
Open http://localhost:3000 with your browser to see the result.
Building for production
bun build
Deployment
The application is ready to be deployed to Netlify. The netlify.toml
file contains the necessary configuration.
License
MIT