Visit Talx: https://talx.vercel.app/
Talx-Backend is the backend API for the Job Portal on the Talx Website. It provides job management, authentication, subscription, news integration, contact functionalities, and job application handling. The backend is built using Node.js and Express.js with a MongoDB database.
- Job Management: Post, update, delete, and fetch jobs. πΌ
- Email Subscription: Subscribe users to daily job updates π§.
- Authentication: JWT-based secure login and signup π.
- News Integration: Fetch news articles using the News API π°.
- Contact Form: Integrates Google Sheets for storing contact form submissions π.
- Job Applications: Submit and manage job applications, including file uploads for resumes π.
- Keep-Alive Mechanism: Ensures the server stays active using cron jobs π.
Ensure you have the following installed:
- Node.js (v16+ recommended) π»
- npm π
- MongoDB (local or cloud setup, e.g., MongoDB Atlas) ποΈ
git clone https://github.com/aakashdixit22/talx-backend.git
cd talx-backend
npm install
Create a .env
file in the root directory with the following variables:
EMAIL_USER=<your_email_user>
EMAIL_PASS=<your_email_password>
BACKEND_URL=<your_backend_url>
JWT_SECRET=<your_jwt_secret>
NEWS_API_KEY=<your_news_api_key>
MONGODB_URI=<your_mongodb_uri>
SPREADSHEET_ID=<your_google_sheet_id>
TYPE=service_account
PROJECT_ID=<your_google_project_id>
PRIVATE_KEY_ID=<your_private_key_id>
PRIVATE_KEY="-----BEGIN PRIVATE KEY-----\n...\n-----END PRIVATE KEY-----"
CLIENT_EMAIL=<your_google_client_email>
CLIENT_ID=<your_google_client_id>
AUTH_URI=https://accounts.google.com/o/oauth2/auth
TOKEN_URI=https://oauth2.googleapis.com/token
AUTH_PROVIDER_X509_CERT_URL=https://www.googleapis.com/oauth2/v1/certs
CLIENT_X509_CERT_URL=<your_google_client_cert_url>
.env
files and keep them secure.
Start the server locally:
node app.js
- GET
/
Default route. Responds with a welcome message. π - GET
/api/keepalive
Keep-alive route to prevent the server from sleeping. π€
-
POST
/post-job
Create a new job. This requires authentication. βοΈ -
GET
/all-jobs
Fetch all jobs available in the portal. π§ -
GET
/myJobs/:email
Fetch all jobs posted by a specific user (requires authentication). π¬ -
DELETE
/delete-job/:jobId
Delete a job by its ID (requires authentication). ποΈ -
PUT
/edit-job/:jobId
Edit a job by its ID (requires authentication). βοΈ
- POST
/subscribe
Subscribe an email for updates. π
- POST
/signin
Login using email and password. πΌ - POST
/signupr
Register a new user. π
-
POST
/apply/:jobId
Submit a job application for a specific job. This route accepts a file upload (resume
) and form fields (name
,email
,phone
, andcoverLetter
). ππΌ -
GET
/my-applications/:email
Fetch all job applications submitted by a user, identified by their email address. The response includes job details for each application. π -
GET
/applicants/:jobId
Retrieve all applications for a specific job. Requires authentication. π
- GET
/news
Fetch news articles (supports query and category filters). π
- POST
/submit
Submit a contact form entry. The data is stored in a Google Sheet. ποΈ
- Node.js: Backend runtime. π»
- Express.js: Web framework. βοΈ
- MongoDB: Database. ποΈ
- Mongoose: ODM for MongoDB. π±
- Cron: Keep-alive job scheduling. β°
- Axios: HTTP requests. π
- Multer: File uploads handling. π€
- Nodemailer: Email handling. π§
- Google Sheets API: For contact form storage. π
-
Talx Frontend (Main Platform)
-
Talx AI Backend
This project is licensed under the MIT License.