> Env. setup

For OS X,
we will need following packages as basic requirements:

  • Homebrew
  • Node.js
  • Git
  • GitHub
  • ATOM or any IDE editor

> Mongodb installation

And we install a instance of Mongodb server on our own server,
here I choose to install on my own DigitalOcean server.

1
2
$ sudo apt-get update
$ sudo apt-get install mongodb

then, we will need to create our own mongod.service file,

1
2
3
4
5
6
7
8
9
10
[Unit]
Description=High-performance, schema-free document-oriented database
After=network.target
[Service]
User=mongodb
ExecStart=/usr/bin/mongod --quiet --config /etc/mongod.conf
[Install]
WantedBy=multi-user.target

then, we can start mongodb now.

1
$ sudo service mongod start

> install Let's Encrypt and retrieve a certificate

Let’s Encrypt is a new Certificate Authority
that provides an easy way to obtain free TLS/SSL certificates.

YOU WILL NEED an A Record on DNS server to point to your server

then we will need the bc package installed.
1
$ sudo apt-get install bc

and we clone letsencrypt repository from GitHub

1
$ sudo git clone https://github.com/letsencrypt/letsencrypt /opt/letsencrypt

retrieve initial certificate

1
cd /opt/letsencrypt && ./letsencrypt-auto certonly --standalone

letsencrypt_01
letsencrypt_02
letsencrypt_03

however, if you pretty sure your DNS setup was correct,
but you see following error, you should go take a nap and come back later.
DNS problem: query timed out looking up CAA for xxx.com

anyway, I get the certificate after couple tries, 🤣
letsencrypt_04
letsencrypt_05

and since it will expired in 90 days,
we should setup auto renew by following commands.

1
2
3
$ cd /usr/local/sbin
$ sudo wget https://dl.eff.org/certbot-auto
$ chmod a+x certbot-auto

then we run once to do setup and confirmation.

1
$ /usr/local/sbin/certbot-auto

letsencrypt_05

> get clone of parse-server application

1
2
3
4
$ git clone https://github.com/ParsePlatform/parse-server-example.git
$ mv parse-server-example/ parse-server/
$ cd parse-server/
$ npm i

> modify setting in index.js

TIPS: you can use md5sum(ubuntu) or md5(osx) command to generate appId and masterKey

1
2
3
4
5
6
7
8
var api = new ParseServer({
databaseURI: 'mongodb://localhost:27017/dev',
cloud: __dirname + '/cloud/main.js', // Absolute path to your Cloud Code
appId: 'myAppId',
masterKey: 'myMasterKey', // Keep this key secret!
fileKey: 'optionalFileKey',
serverURL: 'http://localhost:1337/parse' // Don't forget to change to https if needed
});

> troubleshooting warn: Unable to ensure uniqueness for usernames…

if you got this
>

warn: Unable to ensure uniqueness for usernames: MongoError: auth failed

make sure you have no any special characters inside your password