Giter Site home page Giter Site logo

sangkyunyoon / admin-panel-spring-boot Goto Github PK

View Code? Open in Web Editor NEW

This project forked from eneskilicaslan/admin-panel-spring-boot

0.0 1.0 0.0 32.85 MB

Creating admin panel with Spring Boot

Shell 28.35% Batchfile 21.89% Java 26.70% JavaScript 9.77% HTML 13.30%

admin-panel-spring-boot's Introduction

Admin-Panel-Spring-Boot

Creating admin panel with Spring Boot

This project is designed to manage the users

Requirements:

  1. Mysql database
  2. Maven
  3. Java 1.8
  4. Application server (i.e Tomcat )

This project supply an REST api to add, delete, update and retrieve users from database.

Things Done

  1. Restfull controller
  2. Mysql database connection
  3. Pagination on Spring Boot
  4. Jquery-Ajax requests to list, add and delete users without refreshing the page

How to open the project on IDE

Because this is a maven project, you can open the project with your IDE to see codes. click File-> open project from file system and then select this project.

How to run

Firstly, you must have a mysql server up and running.

change your working directory to project folder

cd Admin-Panel-Spring-Boot

you can run mysql server on mac via following command

mysql.server start

now you need to login

mysql -u root -p

then type your password

So far so good,

There are two sql scrips named create-user.sql and table.sql. We need to execute them on the command line (or you can use mysql workbench). You need to use your path

source some-path/Admin-Panel-Spring-Boot/create-user.sql;
source some-path/Admin-Panel-Spring-Boot/table.sql;

if you're ok till now, you can take a deep breath because we have one last step and I am sure that you won't have any problem there.

YAY!, We have a jar file named app.jar. We can use it to see the project in action.

run the following command

java -jar app.jar

Then the project will run on tomcat server and will be available for various operations.

You can use browser or postman.

  1. Browser

Go to browser and type http://localhost:8080/ you will se list of users. As you can see, Each page is in 7 length.

  1. Postman

Because there is a REST api we can send various requests.

1. To see the users page by page (like on the browser )

        send GET request to url http://localhost:8080/users/?page=1
        you can change the page number

2. To see a single user's informations via his id

    send GET request to url http://localhost:8080/users/2
    you can change the id of user


3. To add a user

    send POST request to url http://localhost:8080/users

    - add a header, its key is ContentType, value is application/json
    - add a body like following
        {   
           "firstName": "Suleyman",
           "lastName": "Cakir",
           "userName": "sefir",
           "password": "nesrin",
           "role": "regular"
        }

4. To update a user

    send PUT request to url http://localhost:8080/users with the user's id
    - add a header, its key is ContentType, value is application/json
    - add a body like following
        {  "id": 2,
           "firstName": "Suleyman",
           "lastName": "Cakir",
           "userName": "sefir",
           "password": "nesrin",
           "role": "regular"
        }


5. To delete a user

    send DELETe request to url http://localhost:8080/users/2
    you can change the id of user

Author: Enes Kilicaslan

.

admin-panel-spring-boot's People

Contributors

eneskilicaslan 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.