Giter Site home page Giter Site logo

ankush-ai / propsync Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 76 KB

PropSync is a property management application built using Spring Boot. It provides a backend API for managing properties with features such as user authentication, and CRUD operations for propertie

Java 100.00%

propsync's Introduction

PropSync - Property Management Application

PropSync is a property management application built using Spring Boot. It provides a backend API for managing properties with features such as user authentication, and CRUD operations for properties.

Table of Contents

Features

  • User authentication (Login/Logout)
  • CRUD operations for properties (View, Create, Update, Delete)

Technologies Used

  • Spring Boot
  • Spring Data JPA
  • Hibernate
  • MySQL (or H2 for development)
  • Lombok
  • Spring DevTools

Getting Started

Prerequisites

  • Java 8 or higher
  • Maven
  • MySQL (for production) or H2 (for development)

Installation

  1. Clone the repository:

    git clone https://github.com/your-username/prop-sync.git
  2. Navigate to the project directory:

    cd prop-sync
  3. Build the project:

    mvn clean install
  4. Run the application:

    mvn spring-boot:run

Configuration

Configure the application properties in src/main/resources/application.properties or src/main/resources/application.yml according to your database and application requirements.

# Database Configuration
spring.datasource.url=jdbc:mysql://localhost:3306/propsync
spring.datasource.username=root
spring.datasource.password=password
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.jpa.hibernate.ddl-auto=update

# Development Configuration
spring.h2.console.enabled=true
spring.h2.console.path=/h2-console

Usage

Authentication

  • Login: Use the /login endpoint with valid credentials to authenticate and receive a token.

    POST /login
    Content-Type: application/json
    
    {
      "username": "your-username",
      "password": "your-password"
    }

    Response:

    {
      "token": "your-access-token"
    }
  • Logout: Use the /logout endpoint to logout and invalidate the token.

    POST /logout
    Authorization: Bearer your-access-token

Property Operations

  • Create Property: Use the /api/v1/properties endpoint with a POST request to create a new property.

    POST /api/v1/properties
    Content-Type: application/json
    Authorization: Bearer your-access-token
    
    {
      "name": "Property Name",
      "description": "Property Description",
      "price": 100000
    }
  • Update Property: Use the /api/v1/properties/{propertyId} endpoint with a PUT request to update an existing property.

    PUT /api/v1/properties/{propertyId}
    Content-Type: application/json
    Authorization: Bearer your-access-token
    
    {
      "name": "Updated Property Name",
      "description": "Updated Property Description",
      "price": 120000
    }
  • Delete Property: Use the /api/v1/properties/{propertyId} endpoint with a DELETE request to delete a property.

    DELETE /api/v1/properties/{propertyId}
    Authorization: Bearer your-access-token
  • View Properties: Use the /api/v1/properties endpoint with a GET request to retrieve a list of all properties.

    GET /api/v1/properties
    Authorization: Bearer your-access-token

Endpoints

  • Authentication:

    • POST /login: Authenticate and receive an access token.
    • POST /logout: Logout and invalidate the access token.
  • Property Management:

    • POST /api/v1/properties: Create a new property.
    • PUT /api/v1/properties/{propertyId}: Update an existing property.
    • DELETE /api/v1/properties/{propertyId}: Delete a property.
    • GET /api/v1/properties: Retrieve a list of all properties.

Development

For development, H2 database is used by default. Access the H2 console at http://localhost:8080/h2-console with JDBC URL jdbc:h2:mem:testdb, username sa, and an empty password.

Contributing

If you'd like to contribute, please fork the repository and create a pull request. We appreciate your contributions!

License

This project is licensed under the MIT License.


Feel free to customize this README.md according to your specific requirements and add more details as needed.

propsync's People

Contributors

ankush-ai avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.