Recreating the Real-World API With Low-Code
This article will share the journey of replicating the Real-World REST API (Conduit) from scratch using Linx, a low-code developer tool.
Join the DZone community and get the full member experience.Join For Free
Building a fully functional REST API from the ground up is a large project for any developer and even more challenging for IT professionals unfamiliar with the nuances of how APIs are coded, deployed, and maintained.
Thereʼs is an opportunity for low-code tools to reduce the time spent on API integrations. These tools can lighten your load and manage most of the complexity for you, allowing developers to work on other aspects of their stack.
To demonstrate, we've built a fully functioning RealWorld API using a low-code tool, Linx. The API shows a fully-fledged backend application, including CRUD operations, authentication, routing, pagination, and more.
What is Linx
Linx is a general-purpose low-code platform for building backends like APIs, automation, and integrations. It is an abstraction of programming itself and is not the domain, process, or tool-specific. This means it can be used for any backend application in any domain with no limitations on connections to other tools and services. The use of a programming abstraction makes Linx extremely powerful. It is not constrained by a domain or use-case-driven paradigm and is often used in conjunction with other low-code tools to provide the API or integration services that those tools are not designed for.
It is a compelling choice for internal and external REST web services, and being low code, is one of the fastest ways to extend an API that requires integration with other technologies (e.g., you need to load or push data into a database, conjure up a rapport, push updates to notification stream, modify or encrypt data at any point, etc). It also offers several other features from database to cryptography and cloud, which creates tons of possibilities for integrating your API with multiple technologies. Linx includes hosting on a dedicated server (cloud - database included or on-premise) with monitoring, access control, and versioning as standard.
The Conduit Stack
There are many different ways you can configure and build out a full-stack app. For example, you can have your front-end & backend codebases hosted separately, together, or even partially render parts of your front-end on the server (commonly known as "server-side rendering"). For this article, we developed the backend API. To complete the project, you can use any front-end apps that integrate with the completed RealWorld API. Deploying backend and front-end code independently dramatically shortens the turnaround time for releasing updates and new features.
Linx Real-World API Sample
The new API replicates the RealWorld API called Conduit, a Medium.com clone. Developers can try out the sample project on GitHub to see what it's capable of and even incorporate it into their development workflows. Alternatively, dig deeper into how we build this API here.
What Can You Do With the RealWorld API?
The Linx RealWorld API exposes public APIs with the following functionalities:
- Authenticate users via JWT
- CRU* users (sign up)
- CRUD Articles
- CR*D Comments on articles (no updating required)
- GET and display paginated lists of articles
- Favorite articles
- Follow other users
MySQL cloud database instance is used for data persistence. The solution is easily interchangeable with other database drivers. We've provided a database set-up script that can easily be run to install the RealWorld database. In addition, Linx encrypts passwords before they are stored in the database for protection.
Try Out the Real-World API
Providing an OpenAPI specification for the Linx RealWorld REST API will allow faster, easier development using the tools and workflows you are accustomed to. Try the live demo of the swagger documentation API (generated by Linx).
Query the API With Postman
Now let's see how to query the data. We're going to use Postman to make our API calls.
- In Postman, import the collection and variables.
- The endpoints point to the demo server, https://demo.api.linx.twenty57.net/realworld/swagger/index.html?url=/realworld/documentation/openapi.json
- Start by registering a new user. This will generate a token that needs to be passed into specific functions. The token will automatically be saved in the global variable for further use.
APIs make it possible to create lightweight applications which can quickly adapt and traverse the rapidly changing ecosystem of web software. With the right tools, API development and management can become a seamless part of your development process and enable you and your clients to remain agile in today's competitive environment.
Building them can mean spending a couple of hours using a low-code platform or months of work using many tools. On the other hand, hosting them can be as simple as using one platform that does everything we need or as complex as setting up and managing ingress control, security, caching, failover, metrics, scaling, etc.
Learning how to build an API turns regular developers into digital superheroes. Today, you don't need to be an experienced developer to build complex applications using high-performance parts with the minimum of effort and, if you use the right tools, the minimum of code.
How Did We Do It?
See a deep dive into the journey of how we created the Conduit API in low-code.
Opinions expressed by DZone contributors are their own.