Giter Club home page Giter Club logo

tmetro-2022's Introduction

TMetro* Group 2 Demo

Introduction

[TODO]

Tech stack

  • Next.JS
    • TypeScript
    • React
    • Progressive Web App (PWA)
  • Hosting
    • Azure Static Web Apps

Development

Get started

  1. Install dependencies.

    npm install -D
  2. Start the development server.

    npm run dev
  3. Open http://localhost:3000 in your browser.

Auto-formatting

npm run format

Code quality

npm run lint
npm run check-format

Image processing

Use webp format to reduce size of images. Use the following command to generate webp files from png files.

`for file in **/*.png; do cwebp -q 50 "$file" -o "${file%.*}.webp"; done;`

Deployment

Generate static website files

npm run build

Accelerate development speed

Install PWA app from dev server

It's time wasting if we can only verify changes after deployment, even if deployment is done by the Continuous Deployment system. By establishing a secure connection between our laptop and mobile phone, we can install the app under development.

Example environment

  • Laptop: 192.168.31.100
  • Mobile: 192.168.31.XXX
  1. Run the containers on your laptop. It will start 1) Nginx and 2) Next.JS dev server containers.

    docker compose up -d
    flowchart LR
        mobile-->|HTTPS|nginx
        nginx-->|HTTP|NextDevServer
    
    Loading
  2. From your mobile phone's default browser, go to https://<LAPTOP_IP>. For the example above, it's https://192.168.31.100.

  3. Install the PWA app.

  4. Because the underlying dev server supports hot reloading, you can update codes, then observe the changes from your phone immediately.

tmetro-2022's People

Contributors

chbrianliu avatar hut326521 avatar

Watchers

 avatar  avatar

tmetro-2022's Issues

Performance

What's expected

Images are loaded instantly.

Current status

It takes a few seconds to load the whole page.

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.