Skip to content

gmzi/blog-demo

Repository files navigation

Blog

A Next.js blog with a dashboard and a text editor.

What is this?

A Next.Js blog with a password-protected dashboard where a blog owner can either upload an .md file, or write in the editor to create a new post. When a post is added or removed from the dashboard, an on-demand revalidation is triggered. The authentication is handled by next-auth.

Here's a live demo, password is already added so you can play around with it.

Usage

  1. Clone repo.

    • optionally configure your local instance:
      • git remote add instance <instance_url>
      • stage and commit local changes.
      • git push -u instance <branchName> (push to remote instance only).
      • git pull origin master (pull changes from template).
  2. npm install packages.

  3. Set up the database to store your posts (we're using mongodb for this demo).

  4. Create .env.local file with these variables:

  5. Open /lib/data.js, change values for your own.

  6. npm run dev to run locally in dev mode, or npm run build and npm start to run production build locally.

About

Next.js blog with a dashboard and a text editor that regenerates on-demand.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published