Skip to content

An example TMS XData project - a REST API server - that serves up a variety of endpoints and sample data.

License

Notifications You must be signed in to change notification settings

500Foods/TMS-XData-TemplateDemoData

Repository files navigation

TMS XData Template: Demo Data

This repository contains a TMS XData project - a REST API server - that serves up a variety of endpoints and sample data. This may be useful for those first learning to use TMS XData in their own projects. Or as a template for starting a new TMS XData project, with many core features, like Swagger and a Login endpoint, already in place. This project originated as part of a series of blog posts about using TMS XData and TMS WEB Core with different kinds of templates, the first of which can be found here.

A second repository, TMS WEB Core Template Demo, contains the implementation of an example web client application that works specifically with this REST API. It was created using a pre-release build of the AdminLTE 4 admin template, which works with Bootstrap 5.

Getting Started

In order to get the most of this repository, you'll need Delphi version 10 or later, as well as a current version of TMS XData. Note that these are licensed commercial products, but trial versions of both are available on their respective websites. Please review The Unlicense that applies to this repository.

The contents of this repository consist of a fully funcitional TMS XData project. It can be compiled and run as-is without further modification, which will generate a Win64 REST API server application. Several endpoints, sample data, a SQLite database, and Swagger are already configured.

image XData Server Application Running

Not much to look at, honestly, but that's just the server application. All it is primarily used for is starting and stopping the REST API server, and as it starts automatically, there's usually not much need to use it directly, hence the lack of much of a UI. The recommended way to test its functions is through the use of its Swagger interface, which is already configured in this project.

image Testing with Swagger Interface

Services

Most of the services are collections of endpoints that are intended to support a particular Dashboard. Many of the endpoints are used as a front-end to one or more SQL queries against one or more underlying databases. As there is no ORM used here, the only access to these databases is through these endpoints. This means there are likely to be endpoints needed to cover any CRUD operations that a client may want to issue. Many endpoints have parameters that allow more than one of these kinds of operations from the same endpoint.

Some services are also more complex, interfacing to other systems, as is the case with the Chat Service, or require additional configuration to be fully operational, which also happens to be the case with the Chat Service. Please refer to the documentation for each individual service you plan on using for additional information.

Documentation

While the code is intended to be straightforward, and the blog is intended to be the primary introduction to this project, other documentation will be added as issues arise.

Key Dependencies

As with any modern application, other libraries/dependencies have been used in this project.

Usage Note: RandomDLL.DLL

This DLL needs to be included in the same folder as the project executable. It is needed by the SHA-256 hash function that is used in several places, that, in turn, comes from the TMS Cryptography Pack. A post-build event has been added to the project to do this automatically. This assumes that a Win64 project is being built. Please adjust accordingly.

Contributions

Initially, this example uses SQLite as its database, as well as a collection of include files for all of the SQL operations that have been implemented so far. Over time, this will be expanded to include support for more databases and more queries. If there's a database you'd like to see included in the template, by all means please post an Issue or, if you're able, make a Pull Request and we'll see that it gets added.

Repository Information

Count Lines of Code

Last Updated at 2023-12-24 05:18:19 UTC
-------------------------------------------------------------------------------
Language                     files          blank        comment           code
-------------------------------------------------------------------------------
Pascal                          15           1524           2766          12948
Markdown                         8             36              2            218
Delphi Form                      3              0              0            155
YAML                             2              8             12             33
Text                             1              0              0              1
-------------------------------------------------------------------------------
SUM:                            29           1568           2780          13355
-------------------------------------------------------------------------------

Sponsor / Donate / Support

If you find this work interesting, helpful, or valuable, or that it has saved you time, money, or both, please consider directly supporting these efforts financially via GitHub Sponsors or donating via Buy Me a Pizza. Also, check out these other GitHub Repositories that may interest you.

More TMS WEB Core and TMS XData Content

If you're interested in other TMS WEB Core and TMS XData content, follow along on 𝕏 at @WebCoreAndMore, join our 𝕏 Web Core and More Community, or check out the TMS Software Blog.

About

An example TMS XData project - a REST API server - that serves up a variety of endpoints and sample data.

Topics

Resources

License

Stars

Watchers

Forks

Languages