This project implements a backend server to scrape job postings from Saramin, store them in MongoDB, and provide RESTful APIs for job management. It includes JWT-based authentication and is documented with Swagger.
- Web scraping to collect job postings
- MongoDB database for storing job data
- REST API for job posting management, user authentication, and job applications
- JWT-based authentication for secure access
- API documentation using Swagger
- Cloud deployment on JCloud
- Node.js (v16 or above)
- MongoDB (running locally or cloud-based)
- npm or yarn package manager
npm install
Create a .env
file in the project root with the following content:
PORT=3000
MONGO_URI=mongodb://localhost:27017/job-management
JWT_SECRET=your_jwt_secret_key
npm start
The server will run at http://localhost:3000
.
Visit the following URL for API documentation:
http://localhost:3000/api-docs
project/
├── src/
│ ├── app.js # Main entry point for the application
│ ├── swagger.js # Swagger configuration
│ ├── routes/ # REST API routes
│ │ ├── auth.js # User authentication routes
│ │ ├── jobs.js # Job posting routes
│ │ ├── applications.js # Job application routes
│ │ ├── bookmarks.js # Bookmark routes
│ ├── models/ # MongoDB models
│ │ ├── User.js # User model
│ │ ├── Job.js # Job model
│ │ ├── Application.js # Application model
│ │ ├── Bookmark.js # Bookmark model
├── package.json # Node.js dependencies and scripts
├── .env # Environment configuration
├── README.md # Project documentation
Method | Endpoint | Description |
---|---|---|
POST | /auth/register |
Register a new user |
POST | /auth/login |
Login and get JWT token |
Method | Endpoint | Description |
---|---|---|
GET | /jobs |
Get all job postings |
GET | /jobs/:id |
Get a specific job posting |
POST | /jobs |
Add a new job posting |
PUT | /jobs/:id |
Update a job posting |
DELETE | /jobs/:id |
Delete a job posting |
Method | Endpoint | Description |
---|---|---|
POST | /applications |
Submit a job application |
GET | /applications |
Get all applications by user |
DELETE | /applications/:id |
Cancel an application |
Method | Endpoint | Description |
---|---|---|
POST | /bookmarks |
Add or remove a bookmark |
GET | /bookmarks |
Get all bookmarks by user |
This project can be deployed on JCloud or any cloud provider. For JCloud deployment:
- Transfer project files to JCloud:
scp -r . ubuntu@<your-jcloud-ip>:/home/ubuntu/project
- SSH into the server:
ssh ubuntu@<your-jcloud-ip>
- Install dependencies and start the server:
npm install nohup npm start > server.log 2>&1 &
- Ensure MongoDB is running locally or via a cloud provider (e.g., MongoDB Atlas).
- Use
nodemon
during development for automatic server restarts:npm run dev
POST /auth/register
Content-Type: application/json
{
"email": "[email protected]",
"password": "securepassword"
}
You can access Swagger documentation at:
http://113.198.66.75:3000/api-docs
- Name: Hyemin Youn
- Email: [email protected]
- Class: WSD-2분반
- Assignment: 3차 과제