tortaCMS Installation with MongoDB

To get started with tortaCMS and MongoDB, run the following instructions:

Step 1: Clone the Repo and Download Dependencies

with npx

npx degit github:FelBenini/torta-cms#mongo
npm install

with bun

bunx degit github:FelBenini/torta-cms#mongo
bun install

You might be asking why we are using degit instead of cloning the repository with git. That is because degit does not download the full repository with all branches and commit history.

Step 2: Set the Environment Variables

Create a .env file at the root of your project that you just created with the following variables:

  1. CONNECTION_STRING: Your MongoDB connection string.
  2. NEXTAUTH_URL: The URL of your application.
  3. NEXTAUTH_SECRET: A Secret String to encode the JWTs.

At the end, your .env file should look like this:

CONNECTION_STRING=mongodb+srv://user:password@cluster0.dar35sd.mongodb.net/database?retryWrites=true&w=majority
NEXTAUTH_URL=http://localhost:3000
NEXTAUTH_SECRET=asdaghdsadtai4324asdffg1harwe234r2

Step 3: Build and Run the Project

Finally just build and run your project with the following commands:

with npm

npm run build
npm start

with bun

bun run build
bun run start

Step 4: Setup your Admin User

Finally after all your configuration, you should be able to go to localhost:3000 or the URL your application is running and see a screen asking for you to register your first user. Type your e-mail, choose your username and password and you are good to go.

Step 5: Start Writing

The Step 5 is non existent, actually! If you followed step 1 to 4 correctly you already have tortaCMS running and you are good to start writing your content. Happy writing!