This tutorial will show you how to setup a login system for a vanilla web application using Base.
This tutorial is based on the base-app-starter repository that you will need to clone.
$ git clone https://github.com/clay-run/base-app-starter.git $ cd base-app-starter/
Once the repository is closed, you will need to install all the required packages with npm.
$ npm install
If you do not have NPM installed on your machine visit the Get Npm page on npmjs.com
In order to run this project, you need a Base.run API Key that looks like
- Create a base named My Web App and open it
- Rename the table people and replace it with users
- Delete the clearbit_enrichment column
- Create a text column named password
Base.run has built-in login and register function that required a users table with both a email and password field. You can read more about it on the API Reference.
Your base should look like the following:
Click on the keys icon at the top right of the screen and copy-paste your
Private Key. In the
config file at the root of the project, replace the following code with your own
Running The App
After installing and configuring the app, you should be able to run it using
npm run dev, the app will be listening at http://localhost:8091.
This app can run in a production. Simply build it using
npm run build, and start it using
npm run start. The app will be listening on port