Skip to content

AyushCODE1757/Job-Portal-REST-APP-with-Spring-Security

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🚀 Job Portal Backend (Spring Boot REST API)

Java Spring Boot PostgreSQL License

A robust and scalable backend REST API for a Job Portal application. This project is built using Spring Boot, Spring Security, and PostgreSQL, designed to manage job postings and user authentication efficiently.


📖 Table of Contents


✨ Features

  • 🔐 User Authentication: Secure user registration with BCrypt password hashing.
  • 📄 Job Management: Full CRUD capabilities for job posts.
  • 🔍 Search Functionality: Search for jobs by keywords in the description or profile.
  • 🛡️ Secure Endpoints: Role-based access control and secured API endpoints using Spring Security (Basic Auth).
  • 💾 Database Integration: Persistent data storage using PostgreSQL and Spring Data JPA.
  • ⚡ Fast & Efficient: Built on the latest Spring Boot 4 version.

🛠 Tech Stack

Component Technology Description
Language Java 21 Latest LTS version for modern features.
Framework Spring Boot 4.0.2 Rapid application development framework.
Database PostgreSQL Advanced open-source relational database.
Security Spring Security Authentication and access control.
ORM Spring Data JPA Abstraction over JDBC/Hibernate.
Tools Lombok Boilerplate code reduction.
Build Tool Maven Dependency management and build automation.

📂 Project Structure

src/main/java/com/aayush/springbootrest
├── config/           # Security and App configurations
├── controller/       # REST Controllers (API Endpoints)
├── model/            # JPA Entities (DB Tables)
├── repo/             # Data Access Layer (Repositories)
├── service/          # Business Logic Layer
└── SpringbootrestApplication.java  # Main Entry Point

🚀 Getting Started

Prerequisites

Ensure you have the following installed:

  • Java 21 SDK
  • Maven
  • PostgreSQL Database

Installation

  1. Clone the Repository

    git clone https://github.com/your-username/springbootrest.git
    cd springbootrest
  2. Database Setup

    • Create a database named SpringJDBCDemo in PostgreSQL.
    • The tables will be auto-generated by Hibernate (ddl-auto=update).

Configuration

Edit src/main/resources/application.properties to match your local environment.

Note: The application.properties file is not included in the repository for security reasons. You must create it manually or use environment variables.

Example application.properties:

spring.application.name=springbootrest

# Database Configuration
spring.datasource.url=jdbc:postgresql://localhost:5432/SpringJDBCDemo
spring.datasource.username=your_postgres_username
spring.datasource.password=your_postgres_password
spring.datasource.driver-class-name=org.postgresql.Driver

# Hibernate Configuration
spring.jpa.hibernate.ddl-auto=update
spring.jpa.show-sql=true
  1. Build and Run
    mvn spring-boot:run
    Server started at: http://localhost:8080

📡 API Documentation

User Management

Method Endpoint Description Auth Required
POST /register Register a new user account

Job Management

Method Endpoint Description Auth Required
GET /jobPosts Retrieve all job listings
GET /jobPost/{id} Get details of a specific job
POST /jobPost Create a new job post
PUT /jobPost Update an existing job post
DELETE /jobPost/{id} Remove a job post
GET /jobPosts/keyword/{keyword} Search jobs by keyword
GET /load Load dummy data (testing only)

Note: All protected endpoints require Basic Authentication (Username/Password).


🔒 Security Implementation

The application enforces security using Spring Security:

  • Authentication: Usage of DaoAuthenticationProvider with BCryptPasswordEncoder.
  • Authorization: All endpoints are secured by default (authenticated()), enabling a secure-by-default approach.
  • CSRF: Disabled (typical for non-browser-based REST APIs).
  • Session: Stateless session policy to support REST architecture.

🤝 Contributing

Contributions are welcome!

  1. Fork the project.
  2. Create your feature branch (git checkout -b feature/AmazingFeature).
  3. Commit your changes (git commit -m 'Add some AmazingFeature').
  4. Push to the branch (git push origin feature/AmazingFeature).
  5. Open a Pull Request.

📜 License

Distributed under the MIT License. See LICENSE for more information.

About

This backend‑only Spring Boot project delivers CRUD operations via a RESTful API and integrates Spring Security for authentication and authorization, showcasing clean architecture and secure, scalable design.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages