Skip to content

Instantly share code, notes, and snippets.

React Router Route Params/useParams Practice Exercise

Code a React app to demo Client-Side Route Params & the useParams hook.

The finished sandbox might look like this this sandbox

Instructions

  1. Create a new React-based project in StackBlitz.

React Basics Review - State, Styling & Event Handling

Setup

Create a new React project in stackblitz.com

Exercises

  1. Remove everything other than the <div> from <App>

Guide on How to Build a Browser Game

Intro

Getting started and knowing how to structure the code in an application is one of the most difficult things for students to figure out.

Also, there might be plenty of sources available to learn about how to use a forEach loop, but finding help on how to think like a developer and write code to implement an app's features is difficult at best.

Using Neon for PostgreSQL Hosting

Creating a Database

  1. Sign up at https://neon.tech/.

  2. You get one free "project" which can contain multiple "branches" which can contain multiple databases. Name your project something like "sei" and stick with the default "main" branch.

  3. Click the Database dropdown.

Guide to Add a Feature to a Web App

Intro

This guide is generic in that it does pertain to any particular web framework, e.g., Express.

When the time comes to implement a user story (feature) in a typical web application, following the steps below usually is a good approach to take in most cases...

RESTful ROUTING QUIZ

Name: ________________

Score: ____ out of 18 = ____%


Example resource: cats

HTTP Method
(Verb)
Path (Endpoint) CRUD Operation Has Data
Payload

Guide to User-Centric CRUD using Express & Mongoose

Intro

Typically, logged in users interact with an application that results in data being created, updated and deleted.

In almost every case, the application's code will need to ensure that the logged in user can only update/delete data created by them, not the data of other users.

RESTful Routes to CRUD Mapping

Example resource: posts

HTTP Method
(Verb)
Path/Endpoint/URI CRUD Operation Typical
Controller Action
Has Data
Payload
GET /posts Read all posts index No
GET /posts/:id Read a specific post show No
POST /posts Create a new post create Yes
PUT /posts/:id Update specified post update Yes

<Your Project's Title>

A description of your game. Background info of the game is a nice touch.

Screenshot

Technologies Used

@jim-clark
jim-clark / guide-key-concepts.md
Last active March 28, 2024 13:23
Key Concepts of The Guide To Building a Browser Game

Key Concepts of The Guide To Building a Browser Game

Coders!

Before this morning's Rock-Paper-Scissors code-along and before you begin to code your amazing games for project 1, it's worthwhile to refresh the KEY CONCEPTS of the Guide on How to Build a Browser Game...

The Guide on How to Build a Browser Game is a proven PROCESS that helps students be successful by producing:

  • Well structured code that closely mimics the popular MVC (Model-View-Controller) pattern
  • More concise code (often, less is more)
  • Less buggy code