OpenSourceFellows / amplify

Open Source Fellow Sandbox
https://amplify-app-production.herokuapp.com/
MIT License
80 stars 60 forks source link

[Docs] Add documentation for local development #431

Open paramsiddharth opened 1 year ago

paramsiddharth commented 1 year ago

Add documentation for local development

The documentation and wiki currently lack sufficient content on setting up local development environments on Linux, Macintosh, and especially Windows. We have come across several bugs in Codespaces recently, which makes it not the best choice for development.

Although the bootstrap script makes things convenient for Homebrew users, the convenience we desire doesn't necessarily have to be a bootstrapping script but giving the contributors the ability to understand what dependencies and configuration they need to have to develop the application locally. Hence, we need to have documentation on setting up local development environments.

Notes

paramsiddharth commented 1 year ago
smgraywood commented 1 year ago

Started here for MacOS: https://github.com/ProgramEquity/amplify/wiki/Local-Setup

paramsiddharth commented 1 year ago

@smgraywood Good job, Sarah! Here's a suggestion: Try to use block-level codeblocks instead of inline codeblocks.

For example,

Instead of run $ echo 123

run `$echo 123`

Use

echo 123
```shell
echo 123
smgraywood commented 1 year ago

@smgraywood Good job, Sarah! Here's a suggestion: Try to use block-level codeblocks instead of inline codeblocks.

For example,

Instead of run $ echo 123

run `$echo 123`

Use

echo 123
```shell
echo 123

Hey @paramsiddharth is this more what you were thinking? https://github.com/ProgramEquity/amplify/wiki/Local-Setup

paramsiddharth commented 1 year ago

Hey @paramsiddharth is this more what you were thinking? ProgramEquity/amplify/wiki/Local-Setup

Hi @smgraywood ! I meant, I was asking you to use block-level codeblocks than inline codeblocks. :)

If you need an explanation you can text me.

smgraywood commented 1 year ago

Hey @paramsiddharth is this more what you were thinking? ProgramEquity/amplify/wiki/Local-Setup

Hi @smgraywood ! I meant, I was asking you to use block-level codeblocks than inline codeblocks. :)

If you need an explanation you can text me.

I added the "``" instead of the single "" is it still not showing up as a code block rather than inline?

paramsiddharth commented 1 year ago

@smgraywood You're almost correct — Follow this link to see a change I just made to understand how to do it correctly: https://github.com/ProgramEquity/amplify/wiki/Local-Setup/_compare/8ad3ae1afe949b8e3056d2fa2602e3da9865d408...8c9a5835a7562813b8080282b5190d6c994b2afb

smgraywood commented 1 year ago

@smgraywood You're almost correct — Follow this link to see a change I just made to understand how to do it correctly: https://github.com/ProgramEquity/amplify/wiki/Local-Setup/_compare/8ad3ae1afe949b8e3056d2fa2602e3da9865d408...8c9a5835a7562813b8080282b5190d6c994b2afb

Ok it should now be updated correctly.

paramsiddharth commented 1 year ago

@smgraywood If you look carefully, when the code blocks are rendered, there is a tiny copy-to-clipboard button on the right.

image

Whenever we add block-level code-blocks to documentation, we want them to be in a manner such that what gets copied can be simply pasted in the console/IDE by the user and used.

What's happening right now is it is copying run $ npm install instead of npm install, so I'd recommend you remove the run $ part and add that phrase as an instruction prior to the code-blocks.

Another interesting fact about Markdown code-blocks — You can add syntax-highlighting by adding the file-type/extension after the first 3 backquotes. An example is below: Code:

```js
console.log('Sum:', 1 + 2); // Comment
Rendered:
```js
console.log('Sum:', 1 + 2); // Comment

For command-line blocks, you can use shell or bash in place of js as in the above example.

SAUMILDHANKAR commented 1 year ago

@paramsiddharth: Hi Param, the current local setup wiki for windows really helped me in setting up my local environment and I wanted to share the points that I am planning to add as below. Would really appreciate your feedback on this. Thank you.

  1. Make sure the node version installed on your local windows machine is compatible with package.json file. Different versions are available here.
  2. In your local branch's package.json file, replace
    "dev:backend": "PORT=5000 nodemon -w ./server server/server.js",

    with

    "dev:backend": "cross-env PORT=5000 nodemon -w ./server server/server.js",
  3. In your local branch's amplify/server/db/util.js file, add:
    require('dotenv').config()
  4. In your .env file, add:
    POSTGRES_DB: postgres
    POSTGRES_USER: postgres
    POSTGRES_PASSWORD: postgres
    POSTGRES_PORT: 5433