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.
- 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
- Video demo: https://www.youtube.com/watch?v=8kg5YBfAeZ8
- Live site: https://open-hearald.vercel.app/
To run this project in a development environment, follow these steps:
- Clone the repository
git clone https://github.com/pavece/OpenHerald.git- Install dependencies
npm install- 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
- Spin up local databases
# Make sure docker is running
docker compose up -d- Run prisma migrations
npx prisma migrate dev --name init- Execute seed procedure
npm run seed- Run the project
npm run dev- 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!
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.
-
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.
-
Clone the project and run locally with the env variables changed
-
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:partialImportant
Make sure to replace redis:// with rediss:// if using TLS when hosting Redis database.
- Fill the remaining variables
- Generate a random secret for the auth
- Generate a Google OAuth ID and secret Google Cloud Console
- Go to Cloudinary and get your API keys
- Host the project to your desired platform (make sure to include all the env variables)
- 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.
