Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: integrate Request API with Easy Invoice #2

Merged
Merged
Show file tree
Hide file tree
Changes from 31 commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
e1e07b8
fix: update docker-compose
aimensahnoun Feb 10, 2025
2afcaed
feat: update invoice schema and add creation logic
aimensahnoun Feb 10, 2025
c705656
feat: update invoice schema and connect Request API
aimensahnoun Feb 10, 2025
11d7d4d
refactor: update logo letters
aimensahnoun Feb 10, 2025
1256700
feat: query invoices and display them in dashboard
aimensahnoun Feb 11, 2025
083e818
feat: improve invoice creation flow
aimensahnoun Feb 11, 2025
2f04256
refactor: optimize date and status display
aimensahnoun Feb 11, 2025
5aa389b
feat: update invoice flow to use tokne-list currencies and support co…
aimensahnoun Feb 11, 2025
4417d1c
feat: update payment page to use live data
aimensahnoun Feb 11, 2025
f84d0ce
feat: add appKit wallet to the app
aimensahnoun Feb 11, 2025
ada26ac
feat: add flow to make payment
aimensahnoun Feb 11, 2025
73c4749
refactor: update invoice preview
aimensahnoun Feb 11, 2025
8eda5c8
refactor: drop payer address
aimensahnoun Feb 11, 2025
693eedf
Merge branch 'main' of github.com:RequestNetwork/easy-invoice into 1-…
aimensahnoun Feb 11, 2025
a7279dd
fix: resolve check errors
aimensahnoun Feb 11, 2025
6b96f8d
fix: build error
aimensahnoun Feb 11, 2025
ca7a4e4
feat: implement webhook for updating payment status
aimensahnoun Feb 11, 2025
0116989
refactor: fix dates to international format
aimensahnoun Feb 11, 2025
41187f8
refactor: move invoice table to client
aimensahnoun Feb 11, 2025
ca86470
fix: missing await in transaction
aimensahnoun Feb 11, 2025
a99e1bd
chore: add metadata
aimensahnoun Feb 11, 2025
27d1add
fix: update initialData
aimensahnoun Feb 11, 2025
62b3ef8
refactor: update invoice-table to also include summary cards
aimensahnoun Feb 11, 2025
c9e07f9
refactor: mention Request Network instead of blockchain
aimensahnoun Feb 11, 2025
b8a5a5f
refactor: forward to dashboard instead of invoice details
aimensahnoun Feb 11, 2025
2bc3827
refactor: show "invoice created" when invoice is done
aimensahnoun Feb 12, 2025
810b525
docs: update README
aimensahnoun Feb 12, 2025
6575304
fix: coderabbit fixes
aimensahnoun Feb 12, 2025
3540840
refactor: remove unnecessary check
aimensahnoun Feb 12, 2025
9860d98
refactor: update error to be more clear
aimensahnoun Feb 12, 2025
77a0ead
fix: throw error if invoice not found
aimensahnoun Feb 12, 2025
45bd210
chore: add database migration and generation scripts to package.json
aimensahnoun Feb 12, 2025
09e626c
refactor: update local to use user's locale
aimensahnoun Feb 12, 2025
a2f1844
refactor: update FAU label
aimensahnoun Feb 12, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,7 @@ DATABASE_URL="postgresql://easy-invoice:easy-invoice@localhost:7406/easy-invoice
GOOGLE_CLIENT_ID=""
GOOGLE_CLIENT_SECRET=""
CURRENT_ENCRYPTION_VERSION="v1"
REQUEST_API_URL=""
REQUEST_API_KEY=""
NEXT_PUBLIC_REOWN_PROJECT_ID=""
WEBHOOK_SECRET=""
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2025 Request Network

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
99 changes: 81 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,36 +1,99 @@
This is a [Next.js](https://nextjs.org) project bootstrapped with [`create-next-app`](https://nextjs.org/docs/app/api-reference/cli/create-next-app).
# Easy Invoice - Streamlined Invoice Management with Request Network

## Getting Started
Easy Invoice is a modern, user-friendly web application that demonstrates the power and simplicity of creating and managing invoices using the Request Network API. Built with Next.js and modern web technologies, this application showcases how easy it is to implement crypto-powered payment solutions in your applications.

First, run the development server:
## ✨ Features

- 🧾 **Simple Invoice Creation**: Create professional invoices in minutes
- 💰 **Crypto Payments**: Accept payments in various cryptocurrencies
- 🔄 **Real-time Updates**: Track payment status in real-time
- 🌐 **Web3 Integration**: Seamless integration with blockchain technology

## 🚀 Getting Started

### Prerequisites

- Node.js 18+
- PostgreSQL database
- Google OAuth credentials (for authentication)
- Request Network API key
- Reown Project ID

### Environment Setup

1. Clone the repository:

```bash
npm run dev
git clone [email protected]:RequestNetwork/easy-invoice.git
cd easy-invoice
```

2. Copy the environment variables file:

```bash
cp .env.example .env
```

3. Fill in the required environment variables in `.env`:

- `DATABASE_URL`: Your PostgreSQL connection string
- `GOOGLE_CLIENT_ID` and `GOOGLE_CLIENT_SECRET`: Google OAuth credentials
- `REQUEST_API_KEY`: Your Request Network API key
- `REQUEST_API_URL`: Request Network API URL
- `NEXT_PUBLIC_REOWN_PROJECT_ID`: Your Reown project ID
- Other required environment variables as specified in `.env.example`

### Installation

1. Install dependencies:

```bash
npm install
# or
yarn dev
yarn install
```

2. Set up the database:

```bash
npm run db:push
# or
pnpm dev
yarn db:push
```

3. Start the development server:

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

Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
The application will be available at [http://localhost:3000](http://localhost:3000).

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

This project uses [`next/font`](https://nextjs.org/docs/app/building-your-application/optimizing/fonts) to automatically optimize and load [Geist](https://vercel.com/font), a new font family for Vercel.
- **Framework**: Next.js 14 with App Router
- **Authentication**: Google OAuth
- **Database**: PostgreSQL with Drizzle ORM
- **Styling**: Tailwind CSS
- **State Management**: React Query & tRPC
- **Payment Integration**: Request Network API
- **Web3**: Ethers.js & Viem

## Learn More
## 📖 Documentation

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

- [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.
- [Request Network Documentation](https://docs.request.network/)
- [Next.js Documentation](https://nextjs.org/docs)
- [tRPC Documentation](https://trpc.io/)
- [Drizzle ORM Documentation](https://orm.drizzle.team/)

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

## Deploy on Vercel
Contributions are welcome! Please feel free to submit a Pull Request.

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.
## 📝 License

Check out our [Next.js deployment documentation](https://nextjs.org/docs/app/building-your-application/deploying) for more details.
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
2 changes: 1 addition & 1 deletion dev/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ version: "3.3"
services:
# postgresql://easy-invoice:easy-invoice@localhost:7406/easy-invoice
postgres:
image: postgres:latest
image: postgres:16-alpine
environment:
POSTGRES_USER: easy-invoice
POSTGRES_PASSWORD: easy-invoice
Expand Down
12 changes: 6 additions & 6 deletions drizzle.config.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { type Config } from "drizzle-kit";

export default {
schema: "./src/server/db/schema.ts",
dialect: "postgresql",
dbCredentials: {
url: process.env.DATABASE_URL as string,
},
tablesFilter: ["invoicepro_*"],
schema: "./src/server/db/schema.ts",
dialect: "postgresql",
dbCredentials: {
url: process.env.DATABASE_URL as string,
},
tablesFilter: ["easyinvoice_*"],
} satisfies Config;
Loading