dundunbug / MERN-practice

Some practice about MERN project

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

MERN Practice

Mongo + Fastify + React + Node

Create frontend (React) project

npx create-react-app frontend --template typescript
...

Create backend (Fastify) project

ref

mkdir backend
cd backend
npm init -y
npm i fastify fastify-static pino-pretty mongoose dotenv
npm i -D typescript @types/node @types/mongoose
npx tsc --init
npm i -D concurrently nodemon
...

Quickstart with Gitpod

Step by step tutorial about how to start using Gitpod on MERN Practice project.

1. Sign in to GitHub

Click Sign in.

sign_in

sign_in_2

2. Fork the MERN-practice repository

Click Fork.

fork

If you have other organizations, please select your own account.

fork_2

And then you will see the fork message under the repository title.

fork_3

gitpod

4. Log in Gitpod with GitHub account

Click Login

gitpod_2

Click Continue with GitHub

gitpod_3

Check your account is correct.

gitpod_4

5. Create workspace with git repository URL

Open a new tab of browser, and type in https://gitpod.io/#https://github.com/{YOUR_GITHUB_ACCOUNT}/MERN-practice.

gitpod_5

After processing, the page will jump to Gitpod editor.

gitpod_6

gitpod_7

6. Grant git privilege to Gitpod

Back to the https://gitpod.io, and click Settings.

gitpod_8

Select Integrations and then Edit Permissions.

gitpod_9

Check public_repo, which will grant Write privilege of your public git repository to Gitpod, and then click Update Permissions.

gitpod_10

(Optional) Change your Gitpod theme to Visual Studio dark theme

Press F1 in Gitpod editor and select Preferences: Color Theme.

gitpod_11

Select Dark (Visual Studio) (or other themes you like).

gitpod_12

gitpod_13

7. Create own branch

First check your current branch: git status.

git status

branch

Create local branch: git checkout -b {YOUR_ACCOUNT_OR_NAME}_dev, e.g.

git checkout -b ym_dev
git status

branch_2

Create remote branch and link: git push -u origin {SAME_AS_YOUR_LOCAL_BRANCH}, e.g.

git push -u origin ym_dev
git status

branch_3

After above steps, you can find your own branch in GitHub.

branch_4

8. Push your changes

After coding, if you want to push your changes, first check your current branch and changed files: git status.

git status

push

Add all changes: git add ., and then commit: git commit -m "{SOME_MEANINGFUL_COMMENT}".

git add .
git commit -m "add gitpod tutorial"

push_2

Push to remote repository: git push, and check the commit log: git log

git push
git log

push_3

About

Some practice about MERN project


Languages

Language:TypeScript 75.6%Language:CSS 12.0%Language:HTML 10.2%Language:JavaScript 1.5%Language:Shell 0.7%