This is a simple note taking application called Knook. Also, this project is a basic example of building REST API with Java 7, RESTEasy, Hibernate and other technologies.
- Java 7
- RESTEasy (JAX-RS)
- Hibernate (JPA)
- Maven (build)
- Glassfish (deployment)
- MySQL (data storage)
Knook provides full CRUD operations for user and note management.
To get you started you need to install dependencies, clone the repository, deploy and run the application with your favorite IDE.
You need to have a git client to clone the repository. You can get it from http://git-scm.com/.
Also you must have Java 7, Maven to build the application, Glassfish to deploy and run it and MySQL database server to store the data. In addition, it is expected that you will use IDE to build and deploy Knook.
-
Install MySQL server
sudo apt-get install mysql-server
-
Install Java JRE and JDK
sudo apt-get install default-jre sudo apt-get install default-jdk
-
Clone the java-resteasy-hibernate repository using git:
git clone https://github.com/romandunets/java-resteasy-hibernate.git
-
Use your favorite IDE to deploy and run the application. Particularly, for this project were used Netbeans 8.1.
There are two main services, users, groups and notes
The routes for these are
- /users
- /users/{id}/groups
- /users/{id}/groups/{id}/notes
You can list all users making a GET request to /users.json
You can get one user making a GET request to /users/{id}.json
You can create an new user making a POST request to /users.json
with the following parameters
{ "email": "[email protected]", "password": "password" }
You can update an existing user making a PUT request to /users/{id}.json
with the following parameters
{ "email": "[email protected]", "password": "password" }
You can delete an existing user making a DELETE request to /users/{id}.json
You can list all groups owned by user, making a GET request to /users/{id}/groups.json
You can get one group for owned by user, making a GET request to /users/{id}/groups/{id}.json
You can create an new group owned by user, making a POST request to /users/{id}/groups/{id}.json
with the following parameters
{ "name": "Some group", "description": "Some description..." }
You can update an existing group owned by user, making a PUT request to /users/{id}/groups/{id}.json
with the following parameters
{ "name": "Some group", "description": "Some description..." }
You can delete an existing group owned by user, making a DELETE request to /users/{id}/groups/{id}.json
You can list all notes for a specific group owned by user, making a GET request to /users/{id}/groups/{id}/notes.json
You can get one note for a specific group owned by user, making a GET request to /users/{id}/groups/{id}/notes/{id}.json
You can create an new note for a specific group owned by user, making a POST request to /users/{id}/groups/{id}/notes.json
with the following parameters
{ "title": "First note", "content": "Some note..." }
You can update an existing note for a specific group owned by user, making a PUT request to /users/{id}/groups/{id}/notes/{id}.json
with the following parameters
{ "title": "Another note", "content": "Another note..." }
You can delete an existing note for a specific group owned by user, making a DELETE request to /users/{id}/groups/{id}/notes/{id}.json
You can list all attachments for a specific note making a GET request to /attachments/{note_id}.json
- Attachments for notes
- Relationships
- Authentication
- Icons for groups
- Icons for notes
- Filters for resources
- Entities validation
- Unit Tests