Coder Social home page Coder Social logo

spring-project's Introduction

User CRUD Application

This is a User CRUD application built with Spring Boot and Java.

Prerequisites

  • Java 8 or higher
  • Maven
  • MySQL

Setup MySQL

  1. Install MySQL if you haven't already.
  2. Create a new database for the application.
  3. Note down the database name, MySQL username, and password.

Configure application.properties

Update the application.properties file to include the necessary configuration for connecting to your MySQL database:

spring.application.name=UserCrud
spring.datasource.url=jdbc:mysql://localhost:3306/your_database_name?useSSL=false&serverTimezone=UTC
spring.datasource.username=your_mysql_username
spring.datasource.password=your_mysql_password
spring.jpa.hibernate.ddl-auto=update
spring.jpa.show-sql=true
spring.mvc.pathmatch.matching-strategy: ant_path_matcher

Running the Application

  1. Clone the repository: git clone https://github.com/vishav-singla/Spring-project.git
  2. Navigate into the directory: cd Spring-project
  3. Build the project: mvn clean install
  4. Run the application: mvn spring-boot:run

The application will start running at http://localhost:8080.

API Endpoints

Here are some example cURL commands for the API endpoints:

Register a User

curl -X POST -H "Content-Type: application/json" -d '{
    "username": "testUser",
    "name":"test user",
    "email":"[email protected]",
    "password": "testPassword"
}' "http://localhost:8080/api/user/register"

Fetch a User by Username

curl -X GET "http://localhost:8080/api/user?username=testUser"

spring-project's People

Contributors

vishavsingla avatar vishav-singla 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.