Skip to content

Commit

Permalink
Merge pull request #29 from meceware/dev
Browse files Browse the repository at this point in the history
v1.0.0-rc8
  • Loading branch information
meceware authored Jan 14, 2025
2 parents 898fdb2 + 15a3657 commit e5f8977
Show file tree
Hide file tree
Showing 14 changed files with 118 additions and 59 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ jobs:
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=raw,value=latest,enable={{is_default_branch}}
type=raw,value=latest,enable={{startsWith(github.ref, 'refs/tags/')}}
type=raw,value=main,enable={{is_default_branch}}
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}.{{minor}}.{{patch}}
type=sha,format=long
- name: Build and push Docker image
Expand Down
1 change: 1 addition & 0 deletions next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const nextConfig = {
output: "standalone",
poweredByHeader: false,
async headers() {
return [
{
Expand Down
7 changes: 3 additions & 4 deletions src/app/api/cron/route.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,12 @@
import { NextResponse } from 'next/server';
import webpush from 'web-push';
import jsonwebtoken from 'jsonwebtoken';
import { formatDistanceToNowStrict } from 'date-fns';
import { formatDistanceToNowStrict, isEqual } from 'date-fns';
import { Resend } from 'resend';
import { prisma } from '@/lib/prisma';
import { SubscriptionGetNextNotificationDate } from '@/components/subscriptions/lib';
import { DefaultCurrencies } from '@/config/currencies';
import { siteConfig } from '@/components/config';
import { addMinutes } from 'date-fns';

const sendNotification = async (subscription, title, message, markAsPaidUrl, isPaymentDueNow) => {
return subscription.user.push.map(async push => {
Expand Down Expand Up @@ -131,7 +130,7 @@ export async function GET() {
const isEmailEnabled = notificationTypes.includes('EMAIL');

const paymentDate = subscription.nextNotificationDetails?.paymentDate;
const isPaymentDueNow = paymentDate === subscription.nextNotificationTime;
const isPaymentDueNow = isEqual(paymentDate, subscription.nextNotificationTime);
const dueText = isPaymentDueNow
? 'due now'
: `${formatDistanceToNowStrict(paymentDate, {addSuffix: true})}`;
Expand Down Expand Up @@ -182,7 +181,7 @@ export async function GET() {
}));
}

await Promise.all(promises);
await Promise.allSettled(promises);
const endTime = performance.now();
if ((endTime - startTime) > 1000) {
console.log(`Notifications sent in ${endTime - startTime}ms`);
Expand Down
2 changes: 2 additions & 0 deletions src/app/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ body {
--secondary-foreground: 240 5.9% 10%;
--muted: 240 4.8% 95.9%;
--muted-foreground: 240 3.8% 46.1%;
--muted-foreground-light: 240 19.1% 26.6%;
--accent: 240 4.8% 95.9%;
--accent-foreground: 240 5.9% 10%;
--destructive: 0 84.2% 60.2%;
Expand Down Expand Up @@ -47,6 +48,7 @@ body {
--secondary-foreground: 0 0% 98%;
--muted: 240 3.7% 15.9%;
--muted-foreground: 240 5% 64.9%;
--muted-foreground-light: 214 12.2% 83.9%;
--accent: 240 3.7% 15.9%;
--accent-foreground: 0 0% 98%;
--destructive: 0 62.8% 30.6%;
Expand Down
8 changes: 4 additions & 4 deletions src/app/layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export const metadata = {
canonical: '/',
},
title: {
default: siteConfig.name,
default: siteConfig.title,
template: `%s | ${ siteConfig.name }`,
},
description: siteConfig.description,
Expand All @@ -54,14 +54,14 @@ export const metadata = {
type: 'website',
locale: 'en_US',
url: '/',
title: siteConfig.name,
title: siteConfig.title,
description: siteConfig.description,
siteName: siteConfig.name,
images: [ `/og.png` ],
},
twitter: {
card: 'summary_large_image',
title: siteConfig.name,
title: siteConfig.title,
description: siteConfig.description,
images: [ `/og.png` ],
},
Expand Down Expand Up @@ -118,7 +118,7 @@ export default async function RootLayout({ children }) {
{ children }
</div>
</main>
<Footer name={siteConfig.name} author={ siteConfig.author } github={ siteConfig.links.github } />
<Footer author={ siteConfig.author } github={ siteConfig.links.github } />
</div>
{ session && <PushNotificationToggle vapidPublicKey={process.env.NEXT_PUBLIC_VAPID_PUBLIC_KEY || ''} /> }
{ session && <AddToHomeScreen /> }
Expand Down
2 changes: 1 addition & 1 deletion src/app/loading.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export default function Loading() {
return (
<div className='fixed top-0 left-0 w-full h-0.5 overflow-hidden'>
<div className='fixed top-0 left-0 w-full h-0.5 overflow-hidden z-50'>
<div className='animate-progress w-full h-full bg-orange-500 origin-left-right shadow-md'></div>
</div>
);
Expand Down
6 changes: 0 additions & 6 deletions src/app/page.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,3 @@ export default async function PageHome() {

return <HomeMember userId={ session.user.id }/>;
}

export async function generateMetadata() {
return {
title: 'Subscription Manager',
};
};
18 changes: 18 additions & 0 deletions src/app/robots.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { siteConfig } from '@/components/config';

export default function robots() {
return {
rules: {
userAgent: '*',
allow: '/',
disallow: [
'/account',
'/login',
'/new',
'/reports',
],
},
sitemap: `${siteConfig.url}/sitemap.xml`,
host: siteConfig.url,
};
}
30 changes: 30 additions & 0 deletions src/app/sitemap.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import { siteConfig } from '@/components/config';

export default function sitemap() {
return [
{
url: `${siteConfig.url}`,
lastModified: new Date().toISOString(),
changeFrequency: 'monthly',
priority: 1
},
{
url: `${siteConfig.url}/contact`,
lastModified: new Date().toISOString(),
changeFrequency: 'monthly',
priority: 0.5
},
{
url: `${siteConfig.url}/login`,
lastModified: new Date().toISOString(),
changeFrequency: 'monthly',
priority: 0.5
},
{
url: `${siteConfig.url}/privacy`,
lastModified: new Date().toISOString(),
changeFrequency: 'monthly',
priority: 0.8
}
];
}
3 changes: 2 additions & 1 deletion src/components/config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
export const siteConfig = {
name: 'Wapy.dev',
description: 'Subscription and Expense Tracker',
title: 'Wapy.dev - Subscription Manager',
description: 'Track, manage, and optimize your subscriptions and recurring expenses in one powerful and human readable dashboard. Get notified and never miss a payment again.',
keywords: 'subscription, expense, tracker, wapy, meceware',
url: process.env.SITE_URL || 'http://localhost:3000',
links: {
Expand Down
2 changes: 1 addition & 1 deletion src/components/header.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export default function Header({ mainNavigation = (<></>), iconNavigation = (<><

return (
<header className={ cn(
'sticky top-0 w-full shadow border-b bg-background transition-transform duration-300 z-50',
'sticky top-0 w-full shadow border-b bg-background transition-transform duration-300 z-10',
{ 'transform': visible, '-translate-y-full': !visible }
) }>
<div className='container mx-auto px-4'>
Expand Down
17 changes: 14 additions & 3 deletions src/components/home-visitor.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

import Image from 'next/image'
import { Icons } from '@/components/icons';
import { Button } from '@/components/ui/button';
import Link from 'next/link';

export const HomeVisitor = () => {
return (
Expand All @@ -14,9 +16,18 @@ export const HomeVisitor = () => {
<h1 className='text-5xl md:text-6xl font-bold tracking-tight'>
Take Control of Your Subscriptions
</h1>
<p className='text-xl text-muted-foreground max-w-2xl'>
Track, manage, and optimize your recurring expenses in one powerful and human readable dashboard.Never miss a payment again.
</p>
<h2 className='text-xl text-muted-foreground-light max-w-4xl'>
Track, manage, and optimize your subscriptions and recurring expenses in one powerful and human readable dashboard.
</h2>
<h3 className='text-xl text-muted-foreground-light font-semibold max-w-4xl'>
Get notified and never miss a payment again.
</h3>
<Button size='lg' asChild className='text-lg'>
<Link href='/login'>
Get Started
<Icons.arrowRight className='ml-2 h-4 w-4' />
</Link>
</Button>
<Image src='/images/banner.png' alt='Hero' width={960} height={600} />
</div>

Expand Down
74 changes: 38 additions & 36 deletions src/components/icons.js
Original file line number Diff line number Diff line change
@@ -1,71 +1,73 @@
import {
ArrowDown,
ArrowRight,
Bell,
BellRing,
Calendar,
ChartColumn,
Check,
ChevronDown,
CreditCard,
Currency,
EllipsisVertical,
Filter,
Globe,
Link,
LoaderCircle,
LogIn,
LogOut,
Mail,
Menu,
Plus,
Save,
Send,
Settings,
Pen,
ChevronDown,
X,
SwatchBook,
Trash,
Calendar,
Save,
Currency,
ChartColumn,
Filter,
Globe,
Tag,
Pen,
PieChart,
Repeat,
Share,
SquarePlus,
ArrowDown,
EllipsisVertical,
ShieldCheck,
SquarePlus,
Tag,
Trash,
X,
} from 'lucide-react';

export const Icons = {
logo: CreditCard,
bell: Bell,
settings: Settings,
menu: Menu,
add: Plus,
signIn: LogIn,
signOut: LogOut,
spinner: LoaderCircle,
send: Send,
check: Check,
down: ChevronDown,
mail: Mail,
arrowDown: ArrowDown,
arrowRight: ArrowRight,
bell: Bell,
bellRing: BellRing,
edit: Pen,
link: Link,
x: X,
categories: SwatchBook,
trash: Trash,
save: Save,
calendar: Calendar,
currency: Currency,
categories: SwatchBook,
chart: ChartColumn,
check: Check,
currency: Currency,
down: ChevronDown,
edit: Pen,
ellipsisVertical: EllipsisVertical,
filter: Filter,
globe: Globe,
tag: Tag,
link: Link,
logo: CreditCard,
mail: Mail,
menu: Menu,
pieChart: PieChart,
repeat: Repeat,
save: Save,
send: Send,
settings: Settings,
share: Share,
squarePlus: SquarePlus,
arrowDown: ArrowDown,
ellipsisVertical: EllipsisVertical,
shieldCheck: ShieldCheck,
signIn: LogIn,
signOut: LogOut,
spinner: LoaderCircle,
squarePlus: SquarePlus,
tag: Tag,
trash: Trash,
x: X,
github: (props) => (
<svg viewBox='0 0 438.549 438.549' {...props}>
<path
Expand Down
3 changes: 2 additions & 1 deletion tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ theme: {
},
muted: {
DEFAULT: 'hsl(var(--muted))',
foreground: 'hsl(var(--muted-foreground))'
foreground: 'hsl(var(--muted-foreground))',
"foreground-light": 'hsl(var(--muted-foreground-light))'
},
accent: {
DEFAULT: 'hsl(var(--accent))',
Expand Down

0 comments on commit e5f8977

Please sign in to comment.