Skip to content

The backend API for the Talx Job Portal, built with Node.js and Express.js. It provides robust features like job management πŸ’Ό, secure authentication πŸ”, email subscriptions πŸ“§, news integration πŸ“°, contact form handling πŸ“‘, and job application management πŸ“„. Powered by MongoDB, it ensures a seamless experience for job seekers and employers alike.

License

Notifications You must be signed in to change notification settings

aakashdixit22/talx-backend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

20 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Talx-Backend πŸš€

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.


Features ✨

  • 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 πŸ•’.

Prerequisites πŸ› οΈ

Ensure you have the following installed:

  1. Node.js (v16+ recommended) πŸ’»
  2. npm πŸ›’
  3. MongoDB (local or cloud setup, e.g., MongoDB Atlas) πŸ—ƒοΈ

Setup Instructions βš™οΈ

1. Clone the Repository

git clone https://github.com/aakashdixit22/talx-backend.git
cd talx-backend

2. Install Dependencies

npm install

3. Create a .env File

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>

⚠️ Important: Do not hard-code credentials or sensitive information in your code. Use .env files and keep them secure.

4. Run the Server

Start the server locally:

node app.js

API Endpoints πŸ”Œ

General 🌐

  • GET /
    Default route. Responds with a welcome message. πŸ‘‹
  • GET /api/keepalive
    Keep-alive route to prevent the server from sleeping. πŸ’€

Jobs (/api/jobs) πŸ’Ό

  • 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). ✏️


Email Subscriptions (/api/subscribers) πŸ“§

  • POST /subscribe
    Subscribe an email for updates. πŸ””

Authentication (/api/auth) πŸ”

  • POST /signin
    Login using email and password. πŸ’Ό
  • POST /signupr
    Register a new user. πŸ“

Job Applications (/api/jobApply) πŸ“„

  • POST /apply/:jobId
    Submit a job application for a specific job. This route accepts a file upload (resume) and form fields (name, email, phone, and coverLetter). πŸ“πŸ’Ό

  • 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. πŸ“‘


News (/api/news) πŸ“°

  • GET /news
    Fetch news articles (supports query and category filters). πŸ“œ

Contact Form (/api/contact) πŸ“‘

  • POST /submit
    Submit a contact form entry. The data is stored in a Google Sheet. πŸ–‹οΈ

Technologies Used 🧰

  • 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. πŸ“

πŸ”— Related Repositories

  1. Talx Frontend (Main Platform)

  2. Talx AI Backend


License πŸ“

This project is licensed under the MIT License.

About

The backend API for the Talx Job Portal, built with Node.js and Express.js. It provides robust features like job management πŸ’Ό, secure authentication πŸ”, email subscriptions πŸ“§, news integration πŸ“°, contact form handling πŸ“‘, and job application management πŸ“„. Powered by MongoDB, it ensures a seamless experience for job seekers and employers alike.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published