Giter Club home page Giter Club logo

tms-xdata-templatedemodata's Introduction

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.

tms-xdata-templatedemodata's People

Contributors

500foods avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

tms-xdata-templatedemodata's Issues

1 -> i

in DashboardServiceImplementation.pas
line : 102

//RGDİKKAT if Roles[1] = '1' then GotRole := True;
if Roles[i] = '1' then GotRole := True;

Login not authorized

SystemServiceImplementation.pas

//if Query1.FieldByName('role_id').AsInteger <> 0 then raise EXDataHttpUnauthorized.Create('Login not authorized');
if Query1.RecordCount< 1 then raise EXDataHttpUnauthorized.Create('Login not authorized(Rol YOK)');

Server connection could not be established

Hi

I can run the project fine on my development PC. When I try to run it on another device on my network by using my developer PC's IP, even though it's loading the initial login page successfully, when I try to login it's giving me the following exception:

"Server connection could not be established"

Please, advise

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.