Skip to content

pavece/OpenHerald

Repository files navigation

Open Herald

Banner image

A self-hosted news publishing platform with an integrated Content Management System (CMS). This project is designed as a learning experience and a portfolio piece, with no intention of replacing or serving as a substitute for any existing publishing system or platform.

Key Features

  • Self-hosted solution for complete control over your content
  • Built-in CMS for easy article creation and management
  • Integrated AD system
  • Simple audience metrics manager for basic analytics
  • Role-based user system with single use link protected registration process
  • Info banner system for important announcements
  • Customizable

Demo & Live Site

Development setup

To run this project in a development environment, follow these steps:

  1. Clone the repository
git clone https://github.com/pavece/OpenHerald.git
  1. Install dependencies
npm install
  1. Set up environment variables
  • Rename .env.template to .env
  • Generate a random secret for the auth you can use openssl rand -base64 32 to generate this key
  • Generate a Google OAuth ID and secret Google Cloud Console
  • Go to Cloudinary and get your API keys
  1. Spin up local databases
# Make sure docker is running
docker compose up -d
  1. Run prisma migrations
npx prisma migrate dev --name init
  1. Execute seed procedure
npm run seed
  1. Run the project
npm run dev
  1. Visit the project on http://localhost:3000
  • Go to the footer and click dashboard
  • Use email: bob@openherald.com pass: password to login as super admin
  • Explore and test!

Host open herald

This is a NextJS app. In order to host it I recommend to use Vercel as it is the simplest way to do it. But you can use any solution of your choice.

  1. Host databases

    You will need to spin up a hosted Postgres instance and a hosted Redis instance. You can use Neon and Upstash for example.

  2. Clone the project and run locally with the env variables changed

  3. Prepare databases

    # Once the variables are changed you can run the migration
    npx prisma migrate dev --name prod

    # Then run the partial seed procedure (won't create articles, only categories and configs)
    npm run seed:partial

Important

Make sure to replace redis:// with rediss:// if using TLS when hosting Redis database.

  1. Fill the remaining variables
  1. Host the project to your desired platform (make sure to include all the env variables)
  2. Create super-admin user
    Once running visit yoururl.com/auth/register and create the super admin user. Then you can start creating categories, articles, ads and registering new users using the single use links.

Important

If using Vercel replace the build command with npx prisma generate && npm run build.

About

A self-hosted news publishing system.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages