Smartinvoice is an intuitive application designed for generating professional invoices. It allows users to save their company information, register customer details, and create custom invoices using form inputs. The application features an efficient status management system, viewable through a comprehensive dashboard. Additionally, it supports team collaboration, enabling multiple users to work seamlessly together.
https://smartinvoice-sepia.vercel.app
- Next.js Ver.14 App Router
- Prisma -ORM
- PlanetScale -MySQL DB
- Typescript
- Mantine -UI Library
- Mantine form -Form validation
- Zod -Form Schema Validation
- jose -JWT signing and encryption
- Nodemailer -For Email sending
- AmazonS3 -PDF/Org logo image storage
- Puppeteer -Headless browser to convert html to PDF
- dayjs - Date value formatting
- Revision of Client-Side Rendering vs Server-Side Rendering
- Considering the impact on SQL relational tables, practiced using the
POST
method with manipulation ofdeleted
column for all delete operations, instead of theDELETE
.
// POST /api/customer/:id
// @desc: Update a single customer
export async function POST(
request: Request,
{ params }: { params: { id: string } }
) {
try {
await checkIfUserIsLoggedIn();
const body = await request.json();
const id = params.id;
const res = await prisma.customer.update({
where: {
id: parseInt(id),
},
data: {
...body,
deletedAt: body.deleted ? new Date() : null,
},
include: {
contact: true,
},
});
return NextResponse.json(res, { status: 200 });
} catch (e: any) {
const message = e.message || "Failed to update customer";
const status = e.status || 500;
return NextResponse.json({ message }, { status });
}
}
- UI Enhancement
- Next.js loading/cache optimization
- List sort
- Rich dashboard for data visualization
- Various cases consideration
- In case of users belonging to multiple organizations
- Admin's availability (i.e. Approval for invoice generation by users)
- Security enhancement
- More secure Email verification token
- S3 data protection
- No-bug application
- Implement more secure frontend/backend validation
- Test driven development