linx-software / realworld-api

RealWorld App backend using Linx

Home Page:https://linx.software/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

RealWorld Example App

Linx solution containing real world examples (CRUD, auth, advanced patterns, etc) that adheres to the RealWorld spec and API.

Linx5 Demo    Linx6 Demo    RealWorld

This solution was created to demonstrate a fully fledged backend application built with the low-code platform Linx including CRUD operations, authentication, routing, pagination, and more.

We've gone to great lengths to adhere to the Linx community style guides & best practices.

For more information on how to this works with other frontends/backends, head over to the RealWorld repo.

General functionality:

  • 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

Database

This implementation makes use of a MySQL database for data persistence.

Swagger Documentation

The documentation for the API can be found here.

Installation

Local environment

The below steps describe how to setup the sample to run on your local Linx Designer environment.

  1. Download and install the Linx Designer here.
  2. Open the sample Solution (.lsoz) in your Linx Designer.
  3. Alter the below Solution Settings:
    • LinxIsLocalDevEnv : True
  4. Select the RESTHost service, right click and select debug. Once initialised, start the debugger.
  5. Once the debugger has started, you are able to make requests locally to:
    https://localhost:8080/realworld
    

Cloud server deployment

The below steps describe how to host this Solution on your own Linx cloud server environment.

Register for a Linx trial server

This solution runs on a Linx cloud server instance and integrates with a hosted MySQL database.

  1. Register for a Linx trial cloud server and MySQL cloud database here.
  2. You will receive an email containing your Linx cloud server, drive space and MySQL database credentials when your trial server has been activated.

Run database setup scripts

The Solution uses a MySQL database to store user related credentials.

  1. Run the provided setup script on your database instance.
  2. Update the below Setting values in the Linx Solution (these credentials can be found in your server registration email):
    • DatabasePassword: Password for your db instance
    • DatabaseServer: Your cloud database server name i.e. dev1db.linx.twenty57.net.

Deploy to your cloud server

  1. Log into your cloud server instance and upload the Solution (Top Menu > Server > Upload).
  2. Open the Solution's Settings and update the LinxServerHostname value to reflect your server instance name - for example, if my server is https://dev1.linx.twenty57.net then my instance name is "dev1".
  3. Click Save.
  4. On the Solution's service dashboard page, start all of the services for the Solution.

Update the Linx Solution's config

DatabaseInstanceName - Enter database instance name.

DatabasePassword - Enter password.

DatabasePort - Enter database port.

DatabaseServer- Enter database server.

DatabaseUser - Enter databse user.

JWTExpirySeconds- Enter expiry in seconds for token

JWTTokenSecretSigningKey- Any key of your own

  1. Click Save.

On the Solution's service dashboard page, start the Realworld service.

  1. Once the service has started, you are able to make requests using the base URL of:
    https://{your instance name}.api.linx.twenty57.net/realworld
    

Contributing

For questions please ask the Linx community or use the Slack channel.

License

MIT