Skip to content

darkredz/zeko-restapi-examples

Repository files navigation

Zeko Rest API Example Project

Example project in Kotlin language using Zeko Rest API framework

Getting Started

Clone the project, cd to the folder.

Run the shell script to start the RESTful backend in development mode(hot reload enabled)

./run.sh

Open browser and go to http://localhost:9999

Now, you should be able to test your API endpoints now with browser, Postman or tool of your choice

After running app is compiled, you will also find swagger.json under api-doc folder. Just import it into Postman and start playing around

To build a docker image execute the shell script which will build the image to your docker daemon

./build-docker-image.sh

Project Creator

Zeko Rest API framework has built-in project creator feature since 1.0.7.

Try to create a new project barebone by calling the endpoint /project/create in this project.

Simply send a post/get request to the endpoint using Postman, browser or wget and download the project zip file.

alt Zeko Project Creator

Brief Explanation

You should import the database zeko_test.sql into your MySQL server for the demo to work.

This projects uses Koin for dependency injection.

BootstrapVerticle is the main entry file and all dependencies needed are created here. Jackson is set to use snake case naming strategy when encoding JSON. It is also set to convert date objects to ISO date time string.

Example usage of SendGrid mail service can be found under user registration, which sends email in a circuit breaker strategy. You can uncomment/comment the code in the bootstrap class to switch to Mandrill

RestApiVerticle contains all the routes and cronjobs of the project. You will find error handler, JWT auth and token refresh here.

SQL queries are executed with Jasync async MySQL driver, however you can change to use Hikari-CP or Vert.x JDBC client in DB class