guilhermeborgesbastos / xy-inc

Generic Rest Application developed for Zup interview

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Generic Rest Backend

Custom Rest Application using Java 1.8, Tomcat 8.5, MongoDB 3.4 and Spring MVC.

Requirements

Installation and configuration

Follow these steps to setup the project

  • Clone the repository into a new folder in your machine;
    • Make sure you have the Git installed Download;
    • git clone https://github.com/guilhermeborgesbastos/xy-inc.git
  • Install and configure the MongoDB;
  • Download and install Maven Install;
  • Download and install Apache Tomcat Install;
    • Make sure the Tomcat is responding in the port 8095;
  • Import the project into your IDE (Netbeans, Eclipse, etc);
  • Set up the project as a Maven-Project;
  • Build the project using Maven Build and run it;

Default routes

Using these routes bellow you are able to create and manipulate any endpoint you want via RESTful.

Path Method Description
http://localhost:8095/ _GET List all models created
http://localhost:8095/ modelId _GET List all documents of an specific model
http://localhost:8095/ modelId/ id _GET Get a document by id into an specific modelId
http://localhost:8095/ modelId _POST Create a new document ( respecting the fields of the parent modelId )
http://localhost:8095/ modelId/ id _PUT Edit a document ( respecting the fields of the parent modelId
http://localhost:8095/ modelId/ id _DELETE Delete a document into an specific modelId
http://localhost:8095/ modelId _DELETE Delete the model at all

modelId is the ObjectId of the model

Frontend user interface

Taking into consideration that this project seeks to assist a front-end developer to develop a simple REST Application, it was used the Advanced Rest Client (Download) as a tool to help the user to build their data structure. Saving time and offering a great abstraction level:

Knowing more

What data types are supported?

This version supports into the field's type:

String, Integer, Boolean, Double, Decimal & Date

How the custom models created looks like?

You can use any MongoDB Client to get access to the database to look your documents and manage the database more deeply, those are the structure of the user Model:

Thank you!

Feel free to open any issue discussion or contact me!

About

Generic Rest Application developed for Zup interview


Languages

Language:Java 100.0%