Lesson 5 of 8
In Progress

Create Lyrid Database

icarus November 17, 2022
LanguageARCHDADEENESFIFRGRHEHIINITJAMSNENLNOPTSVSWATHTR

Now that you have a NocoDB ready, you may host it for free on Lyrid.

In order to host it into the Lyrid serverless platform, you need to use the Lyrid Client to set up a database.

  1. Open up a terminal of your choice.
  2. Type in `lc db`
    • This will bring up a list of commands that can be used when appending to the command.
    • Input `lc db init` and you should see this:
    • We will need this information, but in case you didn’t save this info, you can input `lc db list` to view it again!
    • You have now instantiated your DB on our platform!

Next, let’s create the environment variable inside NocoDB so it’s usable on our servers. 

  • Navigate to your NocoDB repo inside the folder `nocodb-seed` where you can set up the environments for it to be hosted online.
  • Create a `.env` file, recall the database information, and input this list:

NC_DB=pg://[hostname]:[port]?u=[username]&p=[password]&d=[name]
PGSSLMODE=require
NC_INVITE_ONLY_SIGNUP=True

  • Create another file and name it: `.lyrid-definition.yml` for the Lyrid Client. Input the following information:

name: nocodb
description: Complete NocoDB Application
ignoreFiles: .git node_modules
modules:
– name: template
  language: nodejs16.x
  web: nocodb
  description: Template for NocoDB
  functions:
  – name: entry
    entry: entry.js
    description: the entry point for the function

Fire up a terminal and navigate to your NocoDB/nocodb-seed, input `lc code submit` and your NocoDB is now hosted inside your personal Lyrid Account! Great work!

Afterwards once your project has been fully loaded, grab the link that’s hosted on the site and add another section into the .env file (this is meant to solve CORS error):

NC_DB=pg://[hostname]:[port]?u=[username]&p=[password]&d=[name]
PGSSLMODE=require
NC_PUBLIC_URL=https://[Link To Your NocoDB]
NC_INVITE_ONLY_SIGNUP=True

Save and resubmit your NocoDB package through `lc code submit`