Skip to content

Commit

Permalink
feat(budget-app): add pwa support
Browse files Browse the repository at this point in the history
  • Loading branch information
mildronize committed Apr 15, 2024
1 parent 3001028 commit d1853c9
Show file tree
Hide file tree
Showing 15 changed files with 13,590 additions and 5,619 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ on:
# branches: ['release']
branches:
- main
pull_request:
branches:
- main

# Defines two custom environment variables for the workflow. These are used for the Container registry domain, and a name for the Docker image that this workflow builds.
env:
Expand Down
37 changes: 4 additions & 33 deletions budget-app/README.md
Original file line number Diff line number Diff line change
@@ -1,36 +1,7 @@
This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).

## Getting Started
## Icons

First, run the development server:
- `/static/icon-512x512.png`
- `budget-app/src/app/favicon.ico`

```bash
npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun dev
```

Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.

You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file.

This project uses [`next/font`](https://nextjs.org/docs/basic-features/font-optimization) to automatically optimize and load Inter, a custom Google Font.

## Learn More

To learn more about Next.js, take a look at the following resources:

- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.

You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!

## Deploy on Vercel

The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.

Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.
<a href="https://www.flaticon.com/free-icons/budget" title="budget icons">Budget icons created by Freepik - Flaticon</a>
38 changes: 37 additions & 1 deletion budget-app/next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
// import withOffline from "next-offline";
import nextPWA from '@ducanh2912/next-pwa';
const withPWA = nextPWA({
dest: "public",
});

/** @type {import('next').NextConfig} */
const nextConfig = {
/**
Expand All @@ -8,6 +14,36 @@ const nextConfig = {
serverMinification: false,
},
output: "standalone",
/**
* Next.js Offline
* https://github.com/vercel/next.js/blob/canary/examples/next-offline/next.config.js
*/
// workboxOpts: {
// swDest: process.env.NEXT_EXPORT
// ? "service-worker.js"
// : "static/service-worker.js",
// runtimeCaching: [
// {
// urlPattern: /^https?.*/,
// handler: "NetworkFirst",
// options: {
// cacheName: "offlineCache",
// expiration: {
// maxEntries: 200,
// },
// },
// },
// ],
// },
// async rewrites() {
// return [
// {
// source: "/service-worker.js",
// destination: "/_next/static/service-worker.js",
// },
// ];
// },
};

export default nextConfig;
// export default withOffline(nextConfig);
export default withPWA(nextConfig);
Loading

0 comments on commit d1853c9

Please sign in to comment.