4 min read

AnyBlog forked by Aneesh Introduction and Tutorial on how to set up a blog based on Parse

Table of Contents

Update 7th January 2019

This post has become super outdated now that Parse has shut down and there are better ways to host your blog on a custom domain free of cost. I have switched to a Github Pages + Jekyll based solution which is detailed here.

Introduction

When I made my first app with Parse.com, I was amazed by the number of services, functionality and most of all, the pricing. You get 30 req/s and 20GB of storage and bandwidth free of cost! How cool is that! What really captured my attention was that they provided hosting with a custom subdomain (subdomain.parseapp.com) and an Express.js backend. To demonstrate this, they had an example called AnyBlog that served pretty good as an example, but not as an end-to-end blogging platform. I always wanted to write my own blog, but looking at this, I thought “Why not make my own blog?” Driven by this singular thought and by my fascination for Parse, I set out to build a fully featured blogging platform based on Parse.

Features:

  • Proper urls for posts with url slugs.

    /blog/this-is-the-post-title
    
  • Post tags. You can add as many tags you want to a post. You can also filter posts by tags.

  • Admin Panel which allows viewing, editing and deleting of posts.

  • Fully featured WYSIWYG post editor which supports HTML editing. Or you can just copy and paste from Word. Powered by CKEditor

    CKEditor

  • Responsive layout with Bootstrap

  • Comments support. Powered by disqus.

  • Share buttons for social networks.

  • No fuss setup. No coding required. Need to modify only 1 file.


Tutorial

  1. Go to Parse.com, sign up and create a new app.

  2. Install the Parse command line tool. The Parse command line tool for Windows is available here. After downloading the zip file and unzipping it, you can launch a parse-aware powershell session by double-clicking ParseConsole.exe. After the first run of the ParseConsole, you can also start the powershell session by hitting Win + R and typing “parse”.

  3. Download/Clone the git repo. If you haven’t used git before, just go here and click on Download ZIP on the right sidebar. Extract the zip to any directory of your choice. Your folder should look like this.

    Folder Structure

  4. Press Shift + Right click and select Open command window here to open a terminal window in that directory. Type

    parse new .
    

    authenticate with your Parse credentials, and choose the app name you created.

  5. Now, we’ll need to configure the url where you can reach your app. Go to your app’s setting page on Parse.com and set a unique subdomain for your Web Hosting url. The subdomain.parseapp.com/ will be your shareAddress. (For Step 7)

    Web Hosting URL Subdomain

  6. Go to Disqus and create a new site profile. Choose a unique disqus url. If you choose myblog.disqus.com, then myblog is now your disqus_shortname. (For Step 7)

  7. Edit cloud/app.js and specify your userDisplayName, shareAddress and disqus_shortname. Also edit the username and password for your blog.

    // We will use HTTP basic auth to protect some routes (e.g. adding a new blog post)
    var basicAuth = express.basicAuth('YOUR_USERNAME','YOUR_PASSWORD');
    
    // The information showed about the poster
    var userDisplayName = 'YOUR_NAME';
    var shareAddress='YOUR SUBDOMAIN.PARSEAPP.COM/';  //Make sure to add a '/' at the end
    var disqus_shortname='YOUR_DISQUS_NAME';    //Go to disqus.com to get a unique short name
    
  8. Type

    parse deploy
    

    in the Parse command shell. This deploys your app to Parse.

  9. Go to subdomain.parseapp.com/blog and view your copy of the blog.

  10. You will see a blank page. Go to subdomain.parseapp.com/blog/admin to create a new post.

  11. Enjoy Anyblog forked by Aneesh!


Notes

By default, the blog is located at subdomain.parseapp.com/blog and not at subdomain.parseapp.com. This allows you to have a static landing page which can point to the blog.