A modern invoice management system with GST support, built with Next.js, Supabase, and Razorpay.
- Create and manage services with HSN codes and GST rates
- Manage clients with GSTIN information
- Generate GST-compliant invoices with proper tax calculations
- Process payments through Razorpay
- Responsive design for all devices
- Row Level Security (RLS) to ensure data privacy
git clone https://github.com/your-username/gst-invoice-system.git
cd gst-invoice-systemnpm install- Create a new Supabase project at https://supabase.com
- Get your project URL and anon key from the Supabase dashboard
- Create the required tables in your Supabase project:
- Go to the SQL Editor in your Supabase dashboard
- Run the SQL scripts in the
sql/migrationsdirectory in order (000 first, then 001, then 002)
Create a .env.local file in the root directory with the following variables:
NEXT_PUBLIC_SUPABASE_URL=your-supabase-project-url
NEXT_PUBLIC_SUPABASE_ANON_KEY=your-supabase-anon-key
# Razorpay credentials
NEXT_PUBLIC_RAZORPAY_KEY_ID=your-razorpay-key-id
RAZORPAY_KEY_SECRET=your-razorpay-key-secret
# Application URL for callbacks
NEXT_PUBLIC_APP_URL=http://localhost:3000
npm run devThis application uses Supabase's Row Level Security to ensure that users can only access their own data. The RLS policies are defined in the sql/migrations/001_create_rls_policies.sql file.
Key security features:
- Each table has RLS enabled
- Users can only see, update, and delete their own data
- When inserting new records, the user_id is automatically set to the authenticated user's ID
- For invoice_items, access is controlled based on the parent invoice's user_id
This invoice system is designed specifically for GST compliance:
- Services include HSN codes and GST rates
- Clients can have GSTIN information stored
- Invoices calculate GST correctly based on the rates
- Invoice PDFs include all required GST information
- Push your code to GitHub
- Import your repository in Vercel
- Configure the environment variables in Vercel
- Deploy
If you encounter issues with Supabase connection:
- Check that your environment variables are correctly set
- Ensure that Row Level Security policies are properly configured
- Check the browser console for any errors
For RLS-specific issues:
- Ensure you're properly authenticated with a valid user session
- Check that the user_id column exists in all tables
- Verify that the RLS policies have been correctly applied
- Check the Supabase logs for any error messages
# Install dependencies
npm install
# Start the development server
npm run devCreate a .env.local file with the following variables:
# Supabase credentials
NEXT_PUBLIC_SUPABASE_URL=your-supabase-url
NEXT_PUBLIC_SUPABASE_ANON_KEY=your-supabase-anon-key
# Razorpay credentials
NEXT_PUBLIC_RAZORPAY_KEY_ID=your-razorpay-key-id
RAZORPAY_KEY_SECRET=your-razorpay-key-secret
This project can be deployed to Vercel with one click: