Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve Parse Server AWS guide #893

Open
wants to merge 3 commits into
base: gh-pages
Choose a base branch
from

Conversation

MrMartinR
Copy link
Contributor

Improve Parse Server AWS guide, issue #892

@MrMartinR
Copy link
Contributor Author

MrMartinR commented Aug 4, 2022

Hi @parse-community/docs-review , can someone check this PR?
I don't know what happens with the bundle.js, that is marked as modified but I am pretty sure I only commit the deploying-on-aws-ec2-ubuntu.md

```
Scroll down the file and Add `host, all, all, 0.0.0.0/0, md5`, has to be the first line before `local, all, postgres, , peer`

| TYPE | DATABASE | USER | ADDRESS | METHOD |
| ---- | -------- | ---- | ------- | ------ |
| host | all | all | 0.0.0.0/0 | md5 |
| local | all | postgres | | peer |
{: .docs_table}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
{: .docs_table}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is not styling the tables appropriate? (I was planning to style the tables in all the docs, some docs already had that style, not sure when/who did it)
example of "table" (GH does format the table with borders, but the docs doesn't)
image

Copy link
Member

@mtrezza mtrezza Aug 6, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it. What is the benefit of a table without borders? To me it seems less readable, especially in the example above where the alignment varies.


Close the file and save the changes with `Control+X` and `Y`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Close the file and save the changes with `Control+X` and `Y`
Close the file and save the changes with `Control`+`X` and `Y`

```
Search for `#listen_addresses='localhost'`, uncomment the line and replace `localhost` for `*`

Close the file and save the changes with `Control+X` and `Y`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Close the file and save the changes with `Control+X` and `Y`
Close the file and save the changes with `Control`+`X` and `Y`

Comment on lines +112 to +113
Edit the `package.json` file with your preferences, but do not change the start line inside the scripts.
```jsonc
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Edit the `package.json` file with your preferences, but do not change the start line inside the scripts.
```jsonc
Edit the `package.json` file with your preferences, but do not change the start line inside the scripts.
```jsonc

Comment on lines -112 to -114
Run the bash script and follow the instructions, the script have some visual issues and the keys generation doesn't work.
```bash
sh <(curl -fsSL https://raw.githubusercontent.com/parse-community/parse-server/master/bootstrap.sh)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we abandoning the bash script?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It offers little or no functionality and I decided to install parse-server from npm in this guide (don't remember right now if the bootstrap installs the npm version or the node one..), some functionalities didn't work, and had some visuals faults, I was looking to refactor the bootstrap into a more dynamic one with more options, etc (I think using node installer or something like that, the same I saw in other products), but not sure If I have the knowledge to do it...

```
After that, we need to setup the configuration file, use your own `appId`, `masterKey` and `clientKey`, use random strings or some generator tool to create secured keys.
Close the file and save the changes with `Control+X` and `Y`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Close the file and save the changes with `Control+X` and `Y`
Close the file and save the changes with `Control+X` and `Y`

"appName": "MyApp",
"cloud": "./cloud/main",
"serverURL": "http://<IP_OR_DOMAIN>",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we just use "serverURL": "http://localhost", to simplify this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This guide is for AWS so I think it has to be linked to some real ip/domain, (but this guide should work in local linux distribution too... )

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The serverURL is the local domain for the server to call itself. Localhost should usually work, unless in some special scenarios in which you want to distribute the load over a group of servers.

"appName": "MyApp",
"cloud": "./cloud/main",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we removing the cloud code file?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure/don't remember right now, probably because I saw somewhere? or because in this guide I didn't explain how to add the file... ?🤷‍♂️

Start Parse Server using the script command in the config.json
Check if Parse Server is running typing `http://<IP_OR_DOMAIN>:1337` in your browser's address bar, you should see `{"error":"unauthorized"}`, that means the server is running.

To daemonized parse-server to keep it running and alive all the time, you can use the package [PM2](https://pm2.keymetrics.io).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
To daemonized parse-server to keep it running and alive all the time, you can use the package [PM2](https://pm2.keymetrics.io).
To daemonize Parse Server to keep it running and alive all the time, you can use the package [PM2](https://pm2.keymetrics.io).

Install [yarn](https://yarnpkg.com)
```bash
sudo npm install yarn g
sudo npm install yarn -g
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is yarn required in this example? I don't see any yarn command being executed?

Copy link
Member

@mtrezza mtrezza left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder what the purpose of these instructions are and who the target audience is?

It seems to be a contradiction that this aims to be a basic beginner's guide but it deploys Parse Server onto a raw EC2 instance and even runs a DB on the same instance. I'd think that a beginner would rather deploy it in a more abstracted EB environment that is pre-configured for Node, no need for ssh-ing into the instance or PM2. Then use a MongoDB Atlas free plan as DB, MongoDB being Parse Server's "default" and most-supported DB adapter.

Even deploying Postgres on a raw instance is a rather unusual scenario. Managing a DB on such a low level requires a skill set that goes far beyond that of a beginner. One would usually just use the AWS PostgresQL database service.

We do have a deploying-to-heroku-and-mongodb-atlas guide. I think the AWS-alternative would be "deploy on AWS EB and MongoDB Atlas" or even "deploy on AWS EB and AWS PostgresQL".

@mtrezza
Copy link
Member

mtrezza commented Aug 6, 2022

@MrMartinR before going into the conversations of the review feedback, what do you think about the previous comment?

@MrMartinR
Copy link
Contributor Author

Hi, maybe this guide is not beginner or the advisable/normal way to do things, I did choose this way of deployment for my personal situation. I don't remember why I decided or someone told me to include it in the docs, I wanted to make a guide for my future 'me', if you feel that is not appropriate to be included in the docs, we can just remove it, I have no problem with that.

I have no idea about AWS EB or Atlas (and to be honest I have no energy right now to play with that just to make a guide 🤔😅), and the option of having the EC2 instance for the app + the RDS for the DB was a bit expensive, thats why I decided to merge all in the same EC2, I am not sure if this guide is valid for linux OS / VM or even macOS.

your call... 🤔

@mtrezza
Copy link
Member

mtrezza commented Aug 9, 2022

Got it.

It's not a beginner's guide, as it chooses the rather unnecessarily complex way to deploy Parse Server directly on a EC2 instance. This raises more questions, as to how to secure the instance, how to make it accessible publicly in a controlled way (public gateway), how to preserve the logs in CloudWatch when the instance restarts, etc. This all comes out of the box when deploying in EB.

It's also not an advanced guide, as deploying Parse Server and a raw PostgresQL instance on a EC2 instance is rather unusual for a professional application, and there is likely no new info in the guide for an advanced user.

It provides a fragmented view of how to deploy Parse Server, picking some components and puzzling them together to "just make it work somehow" - a PoC if you will. It seems more an anecdotal account of a challenge you've set for yourself. I would remove the guide, as it doesn't seem to provide value beyond that, specifically for beginners.

@parse-community/server your thoughts?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants