Giter VIP home page Giter VIP logo

washlava-status's Introduction

How to code a webapp with this skeleton

Initial setup

All teammates will need (explained in https://tinyurl.com/weblab-install-guide)

  • A bash console (on Mac or Linux, this is Terminal. On Windows, we recommend Git Bash)
  • NodeJS version 16. If it is installed correctly, typing "node --version" should give v16.13.1 and "npm --version" should give 8.1.2
  • Visual Studio Code (or another code editor)
  • the Prettier VSCode extension

Also, all of you will need to go through the MongoDB Atlas setup (https://tinyurl.com/weblab-mongo-guide).

Additionally for authentication, one of you will need to obtain a CLIENT_ID, instructions are at https://tinyurl.com/weblab-googleauth-guide

Downloading these files

First, you probably have a team repository somewhere (the link looks like: https://github.com/weblab-class/teammate1-teammate2-teammate3). You each should clone this (empty) repository by navigating to where you want your folder to be (NOT in catbook) and typing: git clone https://github.com/weblab-class/teammate1-teammate2-teammate3.git <-- with the correct link.

Then, one of your team members will need to do the following:

First on GitHub, download the skeleton (this repository) as a zip file, by clicking Code -> Download as ZIP. (Do not clone it, since this will download extra files, like .git, which will lead to GitHub being confused).

Then, drag over all of the files in this skeleton into your team's folder. Make sure to also drag over the hidden files! To see these hidden files, navigate to the skeleton in Finder/File Explorer and press command+shift+period (mac) or View > Show > Hidden items (windows).

The files/folders you must drag over are:

  • .babelrc (hidden)
  • .gitignore (hidden)
  • .npmrc (hidden)
  • .prettierrc (hidden)
  • client (folder)
  • package-lock.json
  • package.json
  • README.md
  • server (folder)
  • webpack.config.js

Quick youtube demo on dragging the files

Then, in terminal, navigate to your teams folder and push all of the files to your team's GitHub repository as usual:

  • git add -A
  • git commit -m "Skeleton code"
  • git push

Now the rest of your teammates can pull all these files with a 'git pull'!

Post on Piazza if you run into any issues

What you need to change in the skeleton

  • Change the Frontend CLIENT_ID (Skeleton.js) to your team's CLIENT_ID (obtain this at https://tinyurl.com/weblab-googleauth-guide)
  • Change the Server CLIENT_ID to the same CLIENT_ID (auth.js)
  • Change the Database SRV (mongoConnectionURL) for Atlas (server.js). You got this in the MongoDB setup. remember to replace and (should be no < or > in your SRV)
  • Change the Database Name for MongoDB to whatever you put in the SRV to replace (server.js)
  • (Optional) Add a favicon to your website at the path client/dist/favicon.ico
  • (Optional) Update website title in client/dist/index.html
  • (Optional) Update this README file ;)
  • (Optional) Update the package.json file with your app name :) (line 2)

How to run this skeleton

First, 'npm install' Then open two seperate terminals, and 'npm run hotloader' in the first, and 'npm start' in the second. Then open http://localhost:5000

How to go from this skeleton to your actual app

Check out this How to Get Started Guide

Socket stuff

Note: we'll be getting to this in lecture in week 2, so don't worry if you don't know it yet

  • If you're not using realtime updating or don't need server->client communication, you can remove socket entirely! (server-socket.js, client-socket.js, and anything that imports them)
  • If you are using sockets, consider what you want to do with the FIXME in server-socket.js

Edit at your own risk

the following files students do not need to edit. feel free to read them if you would like.

client/src/index.js
client/src/utilities.js
client/src/client-socket.js
server/validator.js
server/server-socket.js
.babelrc
.npmrc
.prettierrc
package-lock.json
webpack.config.js

Good luck on your project :)

washlava-status's People

Contributors

cory2067 avatar a-lchen avatar shannenwu avatar asipser avatar tchomphoochan avatar nsinghal7 avatar akshajk avatar mfarejowicz avatar johancc avatar blueknight10001 avatar vincenthuang75025 avatar

Stargazers

Nathan Wang avatar Colin C avatar Rohan Kanchana avatar Itamar Chinn avatar Syamantak Payra avatar Gabriel Rodríguez avatar Krit Boonsiriseth avatar

Watchers

 avatar

washlava-status's Issues

Fix reauthentication issue

The website <laundry.tcpc.me> seems to crash about every 24 hours, suggesting that the auth refresh logic never worked properly. The unhandled exception upon auth expiration causes the server to crash, and we lose data in the process.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.