Getting Started
Ready to jump into Lucid? Follow the steps below to get your brand-new Lucid project up and running and take your content to the next level.
Prerequisites
- Node.js
v20.12.2
or higher.
1. Setup a TS/JS Node.js Project
Before you can start working with Lucid, first things first, you need a Node.js project. It doesn’t matter if you want to use JavaScript or TypeScript, what package manager you use, etc. The only requirement here is that it’s Node.js and you’re set up to use ESM. Lucid does not support CommonJS and will not work with it.
2. Install Lucid Core
Run the following command in your terminal to install Lucid Core.
3. Create lucid.config.ts/js
You need to create a lucid.config.ts
or lucid.config.js
file in the root of your project.
The lucid.config file is the heart of Lucid and is where you will define everything from the collections you have, the locales you support, all the way to defining your email and media strategies.
Here is the minimum required file to get Lucid up and running:
4. Importing & Starting Lucid
Now that you have Lucid installed, before you can run your project, there is one final step. You need to import it into your project and call the start
function.
Calling the lucid.start()
function will start the Lucid Fastify server.
Once this is done, you can run your start script and navigate to http://localhost:8080/login
to see Lucid in action. The default username is admin
and the password is password
. You will be prompted to change this password on first login.