The Insane Barbershop

Feb 10, 2016
48
14
Let me introduce the Insane Barbershop a powerful generic REST API built with Java & Spring. It's great if you just want to have full and fast control over your database or building mobile apps. When you build mobile apps with this rest there is no need for schemas or mappings due to the JSON response with built keys. This allows you to just use the keys to get their values.
  • Blah, so what can it do?
    The Insane Barbershop can query any kind of database, in current build you can query MySQL, SQL and Jtds (If you want to add more databases you just update the pom.xml with the dependency for you database.), the queries you can use in this build is SELECT, INSERT and UPDATE. The Insane Barbershop comes with a sleek angular website setup for you to enter your queries in and receive a response.
  • What's the response like?
    the response is formatted to JSON using hashmaps.
  • When and how can I use it?
    It can be used anywhere at anytime either through our own included website or any client able to send http requests. It's super easy to setup and there will be a tutorial down below. An example of a usecase is a Habbo Hotel, you as a hotel owner may not be at your computer all the times but can still ask questions to your database and get the current information out of it or update, either by the mobile or any other device.
  • Known Issues
    1. There is a problem with MySQL that seems to use the selectOne() method, therefor no multiple responses can be made currently. This is not the case in SQL server that goes green.
    2. The website currently just supports SELECT queries
    - As few people have tested this, please report issues in this thread or in bitbucket.
  • Screenshots
    Current layout of the website
    a4bf4df00cf1b701710d7539d7ae91e1.png

    The query and response
    c78f248b2bd7b34015b2a509209e8646.png

    Error status and message
    3d61c8bbf3602c529e993fbb77dbdce8.png
  • Setup Requirements
    Java EE or JDK 1.8
  • Setup
    Create a .props file that has the following properties in it;
    Code:
    driver = yourDriver #Example: com.mysql.jdbc.Driver
    url = yourUrl #Example jdbc:mysql://localhost:3306/myDb
    username = username # Your database username
    password = password # Your database passwrod

    Start The Insane Barbershop server by terminal or cmd using the following command;
    Code:
    java -jar TheInsaneBarberShop-RELEASE-2017.07.jar -fp C:\Link\to\rest\props\file.props -p 8080 -ip 127.0.0.1
    The server should now be up and running.
    If you wish to use our website created for this, upload it to any webserver and change the ip / address in the app.js to point to the server, after that it should be good to go.

    To use the queries you should use;
    Code:
    http://localhost/ibs/select
    http://localhost/ibs/insert
    http://localhost/ibs/update

  • -
    Please share your feedback with us
    - Releases will be made in the end of every month, keep track on the version number ex; 2017.07
    - If you want to contribute, please create a branch and do pull requests.
    -
  • Credits
    - Me doing the Rest Service
    - @3MIL doing the website
I'll hope you have some usage of this, and have thoughts of how I can improve this service.
Best Regards, SystemSequence
 
Last edited:
Feb 10, 2016
48
14
You can access phpMyAdmin anywhere as well. Show me this working with an SQLite database.
4d175c1a531859dc16dbddac09ab1c56.png


Used the queries

create table tbl1(one varchar(10), two smallint);
insert into tbl1 values('hello!',10);

and
Code:
<dependency>
   <groupId>org.xerial</groupId>
   <artifactId>sqlite-jdbc</artifactId>
   <version>3.19.3</version>
</dependency>
 
Last edited:
Feb 10, 2016
48
14
Been sometime since a new update on this due to studies.

There will be an update before the end of 2017 with updated security to access the generic API, will use headers to confirm credentials to access it, otherwise it will be closed for use, I realized late in this project that it's not a good production api due to the lack of security, by that I mean the querys in the app/website is on the client side and can be manipulated into any form. You will still be able to do this for test if you'd like to but will require credentials in the header.

For the production usage there will be schemas for what you can do like any api. ( ) and will do parameterized querys to avoid the most basic of hacks.
This requires quite a big recode but the project aint that big.

To add, the api works well with databases that has a JDBC like,
mySql, postgreSql, MsSql, Hibernate, Oracle, Sun, MongoDb, SqlLite and more.
 

Users who are viewing this thread

Top