[TODO]
- Next.JS
- TypeScript
- React
- Progressive Web App (PWA)
- Hosting
- Azure Static Web Apps
-
Install dependencies.
npm install -D
-
Start the development server.
npm run dev
-
Open http://localhost:3000 in your browser.
npm run format
npm run lint
npm run check-format
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;`
npm run build
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
-
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
-
From your mobile phone's default browser, go to
https://<LAPTOP_IP>
. For the example above, it'shttps://192.168.31.100
. -
Install the PWA app.
-
Because the underlying dev server supports hot reloading, you can update codes, then observe the changes from your phone immediately.