Nuxt

1. Setup JamAIBase project.

  • Create a new project.

  • Get the Project ID.

  • Create JamAI API Key at Organization > Secrets > Create API Key.

2. Create a Nuxt app

3. Install the JamAI Base client library, jamaibase

4. Create a .env file at the root or your project and add the keys

5. In the nuxt.config.ts file add runtimeConfig to use the environment variables

6. Create a page to list tables

We will create a page to list the tables from the project.

Create a new file pages/index.vue and add the following code:

Add the following CSS to make the UI look better:

7. Create server handler to fetch tables:

create a new handler at server/api/list-tables.js and add the following code:

8. Create a page to create new action table

We will create a UI that will create a new action table.

Create a new file server/api/create-table.js and add the following code:

9. Create an API to create a new table

Create a server handler at server/api/create-table.js to accept the request and create a new table:

10. Add default layout

Finally, create a defalut layout (layouts/defalut.vue) to navigate between pages:

12. Start the app

Start the app and go to http://localhost:3000 in a browser and you should see the list of tables in your project.

Last updated

Was this helpful?