Create your blog using the open-source platform Greenpress

David Meir-Levy
Vue.js Developers
Published in
3 min readJul 2, 2020

A great time to start blogging with your own website, that you can fully control.

Let’s begin with a boring story (I’ll forgive you if you cut to the chase)…

Nowadays, there are plenty of options to create your own static website.
platforms evolved, SaaS services are getting much more friendly for the non-technical user. All true, but if you still want to control your own website and own it and its database and theme- you are probably one of the 75 million websites that still prefer using WordPress.

You would really like to own your own website, and you still want to enjoy that magnificent administrator panel, that you can do anything inside it: manage menus, categories, posts, settings, users, editors, and upload images and other assets to your server, but regardless — you want something more advanced.

From my point of view, I wanted a blog that its content and its theme are not bound together to the git repository, so guests can comment but I can still manage them all from one point.
But also, I wanted something I can test as a developer in my own dev environment, including migrations and upgrades. to test the theme changes or the plugin I add. I wanted something that acknowledges cloud platforms and doesn’t rely on the filesystem to set assets and images, or to change app configuration as a file on the file system.

A bit before the chase: What is Greenpress?

Greenpress is an open-source platform to create and manage blogs and content websites, made for the 21st century, using great tech such as node, Vue, Nuxt, and structured as micro-services to fit into basic hosting and/or cloud services, using docker (compose / swarm / Kubernetes).

The chase: Install Greenpress locally

In order to begin, you will need to install Node.js and Docker before.
After you have those, clone / copy this repository:

Open a terminal (bash / cmd / z-shell…) and go to this project folder, and run:

npm install

After installation finished, you can run this command to start the application:

npm run dev

Populate initial data

I believe you want to see some example data, such as blog name, first post, menu, categories, and a first administrator user.
To get it, wait until the application seems like running (it will tell you in the terminal), and run this command on another terminal (on the same folder):

npm run populate-db

After this script is done, you can go to /gp-admin and log in with the user:
USER: test@test.com
PASSWORD: admin
* consider change it after login. :)

Create a living blog in production

I will show this example on Heroku, but it can work on any server with node.js and MongoDB.

  • Open a new application
  • Install an addon for MongoDB.
  • Optional: install a Redis addon, it will speed up your blog.
  • Connect your blog repository to this app, or use the Heroku git repository and push your blog to it.
  • The blog is live now! You probably need some initial data…
  • Search the “More” button at the top corner, and click on “Run Console”.
  • run the command: npm run populate-db . (Read the notes from the previous section..).

Add some secrets

Please set up some environment variables with good secrets to make your application more secure.
The variables that must be set are:

ASSETS_SECRETS_TOKEN
JWT_SECRET
REFRESH_TOKEN_SECRET
SECRETS_SERVICE_SECRET

Bonus: Set the variable APPLICATION_URL with your application URL (including https://) to support origin redirect.
Let’s say you have your own domain, so going to herokuapp sub-domain will get 301 redirect to the same page on your main domain, and the same for HTTP non-secure protocol.

Join the team!

Greenpress is an open source project, and is looking for code contributors who would like to be a part of the development.

If you want to be a part of it, look out for our GitHub issues, or even comment here and we’ll get in touch. :)

--

--