├── .eslintrc.js ├── .github ├── ISSUE_TEMPLATE │ ├── bug_report.md │ ├── custom.md │ └── feature_request.md └── workflows │ ├── build.yml │ └── deploy.yml ├── .gitignore ├── .npmrc ├── CHANGELOG.md ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── SECURITY.md ├── apps ├── Bank-WebHook │ ├── .env.example │ ├── package.json │ ├── src │ │ └── index.ts │ ├── tsconfig.json │ └── vercel.json ├── merchant-app │ ├── .env.example │ ├── .eslintrc.js │ ├── README.md │ ├── app │ │ ├── api │ │ │ └── auth │ │ │ │ └── [...nextauth] │ │ │ │ └── route.ts │ │ ├── favicon.ico │ │ ├── globals.css │ │ ├── layout.tsx │ │ ├── page.module.css │ │ └── page.tsx │ ├── lib │ │ └── auth.ts │ ├── next-env.d.ts │ ├── next.config.js │ ├── package.json │ ├── postcss.config.js │ ├── provider.tsx │ ├── tailwind.config.js │ └── tsconfig.json └── user-app │ ├── .env.example │ ├── .eslintrc.js │ ├── AppbarClient.tsx │ ├── ClientWrapper.tsx │ ├── README.md │ ├── app │ ├── (dashboard) │ │ ├── contact │ │ │ └── page.tsx │ │ ├── dashboard │ │ │ └── page.tsx │ │ ├── layout.tsx │ │ ├── p2p │ │ │ └── page.tsx │ │ ├── transactions │ │ │ └── page.tsx │ │ └── transfer │ │ │ └── page.tsx │ ├── Bank │ │ ├── axis │ │ │ └── page.tsx │ │ └── hdfc │ │ │ └── page.tsx │ ├── api │ │ ├── auth │ │ │ └── [...nextauth] │ │ │ │ └── route.ts │ │ ├── numbers │ │ │ └── route.ts │ │ └── user │ │ │ └── route.ts │ ├── auth │ │ └── page.tsx │ ├── favicon.ico │ ├── globals.css │ ├── home │ │ └── page.tsx │ ├── layout.tsx │ ├── lib │ │ ├── actions │ │ │ ├── P2Ptransfer.tsx │ │ │ └── createOnRampTxn.ts │ │ └── auth.ts │ ├── page.module.css │ ├── page.tsx │ ├── privacy │ │ └── page.tsx │ ├── terms │ │ └── page.tsx │ └── test │ │ └── page.tsx │ ├── assests │ ├── HDFC-Bank-Logo.png │ └── axisLogo.png │ ├── components │ ├── AddMoneyCard.tsx │ ├── AxisBank.tsx │ ├── BalanceCard.tsx │ ├── HdfcBank.tsx │ ├── HeroSection.tsx │ ├── MobileNav.tsx │ ├── NumberList.tsx │ ├── OnRampTransaction.tsx │ ├── SendCard.tsx │ └── SiderBarItem.tsx │ ├── next-env.d.ts │ ├── next.config.js │ ├── package.json │ ├── postcss.config.js │ ├── provider.tsx │ ├── providers │ └── LenisProvider.tsx │ ├── tailwind.config.js │ └── tsconfig.json ├── docker └── Dockerfile.user ├── package-lock.json ├── package.json ├── packages ├── db │ ├── .env.example │ ├── .gitignore │ ├── index.ts │ ├── package.json │ ├── prisma │ │ ├── migrations │ │ │ ├── 20241122045410_whole │ │ │ │ └── migration.sql │ │ │ └── migration_lock.toml │ │ ├── schema.prisma │ │ └── seed.ts │ └── tsconfig.json ├── eslint-config │ ├── README.md │ ├── library.js │ ├── next.js │ ├── package.json │ └── react-internal.js ├── store │ ├── package.json │ ├── src │ │ ├── atoms │ │ │ └── balance.ts │ │ └── hooks │ │ │ └── useBalance.ts │ └── tsconfig.json ├── typescript-config │ ├── base.json │ ├── nextjs.json │ ├── package.json │ └── react-library.json └── ui │ ├── .eslintrc.js │ ├── package.json │ ├── src │ ├── Appbar.tsx │ ├── Center.tsx │ ├── Footer.tsx │ ├── Select.tsx │ ├── Textinput.tsx │ ├── button.tsx │ ├── card.tsx │ └── code.tsx │ ├── tsconfig.json │ ├── tsconfig.lint.json │ └── turbo │ └── generators │ ├── config.ts │ └── templates │ └── component.hbs ├── tsconfig.json └── turbo.json /.eslintrc.js: -------------------------------------------------------------------------------- 1 | // This configuration only applies to the package manager root. 2 | /** @type {import("eslint").Linter.Config} */ 3 | module.exports = { 4 | ignorePatterns: ["apps/**", "packages/**"], 5 | extends: ["@repo/eslint-config/library.js"], 6 | parser: "@typescript-eslint/parser", 7 | parserOptions: { 8 | project: true, 9 | }, 10 | }; 11 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Describe the bug** 11 | A clear and concise description of what the bug is. 12 | 13 | **To Reproduce** 14 | Steps to reproduce the behavior: 15 | 1. Go to '...' 16 | 2. Click on '....' 17 | 3. Scroll down to '....' 18 | 4. See error 19 | 20 | **Expected behavior** 21 | A clear and concise description of what you expected to happen. 22 | 23 | **Screenshots** 24 | If applicable, add screenshots to help explain your problem. 25 | 26 | **Desktop (please complete the following information):** 27 | - OS: [e.g. iOS] 28 | - Browser [e.g. chrome, safari] 29 | - Version [e.g. 22] 30 | 31 | **Smartphone (please complete the following information):** 32 | - Device: [e.g. iPhone6] 33 | - OS: [e.g. iOS8.1] 34 | - Browser [e.g. stock browser, safari] 35 | - Version [e.g. 22] 36 | 37 | **Additional context** 38 | Add any other context about the problem here. 39 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/custom.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Custom issue template 3 | about: Describe this issue template's purpose here. 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | 11 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Is your feature request related to a problem? Please describe.** 11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 12 | 13 | **Describe the solution you'd like** 14 | A clear and concise description of what you want to happen. 15 | 16 | **Describe alternatives you've considered** 17 | A clear and concise description of any alternative solutions or features you've considered. 18 | 19 | **Additional context** 20 | Add any other context or screenshots about the feature request here. 21 | -------------------------------------------------------------------------------- /.github/workflows/build.yml: -------------------------------------------------------------------------------- 1 | name: Build on PR 2 | 3 | on: 4 | pull_request: 5 | branches: 6 | - master 7 | 8 | jobs: 9 | build: 10 | runs-on: ubuntu-latest 11 | steps: 12 | - uses: actions/checkout@v3 13 | 14 | - name: Use Node.js 15 | uses: actions/setup-node@v3 16 | with: 17 | node-version: "20" 18 | 19 | - name: Install Dependencies 20 | run: npm install 21 | 22 | - name: Generate prisma client 23 | run: npm run db:generate 24 | 25 | - name: Run Build 26 | run: npm run build 27 | -------------------------------------------------------------------------------- /.github/workflows/deploy.yml: -------------------------------------------------------------------------------- 1 | name: Build and Deploy to Docker Hub 2 | 3 | on: 4 | push: 5 | branches: 6 | - master # Trigger on pushes to the main branch 7 | 8 | jobs: 9 | build-and-push: 10 | runs-on: ubuntu-latest 11 | steps: 12 | - name: Check Out Repo 13 | uses: actions/checkout@v2 14 | 15 | - name: Cleanup Docker resources before build 16 | run: | 17 | echo "Cleaning up Docker resources before build" 18 | sudo docker system prune -a -f --volumes 19 | sudo docker builder prune -a -f 20 | sudo docker container prune -f 21 | sudo docker image prune -a -f 22 | sudo docker volume prune -f 23 | sudo docker network prune -f 24 | 25 | - name: Prepare Dockerfile 26 | run: cp ./docker/Dockerfile.user ./Dockerfile 27 | 28 | - name: Log in to Docker Hub 29 | uses: docker/login-action@v1 30 | with: 31 | username: ${{ secrets.DOCKER_USERNAME }} 32 | password: ${{ secrets.DOCKER_PASSWORD }} 33 | 34 | - name: Build and Push Docker image 35 | uses: docker/build-push-action@v2 36 | with: 37 | context: . 38 | file: ./Dockerfile 39 | push: true 40 | no-cache: true ## Ensure fresh build 41 | tags: pankajkumardev/flowpay:${{ github.sha }} # Tag using the commit hash to avoid conflicts 42 | 43 | - name: Verify Pushed Image 44 | run: docker pull pankajkumardev/flowpay:${{ github.sha }} # Pull the latest image using the commit hash 45 | 46 | - name: Deploy to EC2 47 | uses: appleboy/ssh-action@master 48 | with: 49 | host: ${{ secrets.SSH_HOST }} 50 | username: ${{ secrets.SSH_USERNAME }} 51 | key: ${{ secrets.SSH_KEY }} 52 | script: | 53 | # Pull the latest image and run the container 54 | sudo docker pull pankajkumardev/flowpay:${{ github.sha }} # Pull the image using the commit hash 55 | sudo docker stop web-app || true 56 | sudo docker rm web-app || true 57 | sudo docker run -e DATABASE_URL=${{secrets.DB_URL}} -e JWT_SECRET=${{secrets.JWT_SECRET}} -d --name web-app -p 3005:3000 pankajkumardev/flowpay:${{ github.sha }} # Run with the specific tag 58 | sudo docker exec web-app npm run db:migrate # Run database migration 59 | 60 | - name: Cleanup Docker resources after deployment 61 | run: | 62 | echo "Cleaning up Docker resources after deployment" 63 | # Remove unused Docker images, containers, volumes, and networks to free up space 64 | sudo docker system prune -a -f --volumes 65 | sudo docker builder prune -a -f 66 | sudo docker container prune -f 67 | sudo docker image prune -a -f 68 | sudo docker volume prune -f 69 | sudo docker network prune -f 70 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # Dependencies 4 | node_modules 5 | .pnp 6 | .pnp.js 7 | 8 | # Local env files 9 | .env 10 | .env.local 11 | .env.development.local 12 | .env.test.local 13 | .env.production.local 14 | 15 | # Testing 16 | coverage 17 | 18 | # Turbo 19 | .turbo 20 | 21 | # Vercel 22 | .vercel 23 | 24 | # Build Outputs 25 | .next/ 26 | out/ 27 | build 28 | dist 29 | 30 | 31 | # Debug 32 | npm-debug.log* 33 | yarn-debug.log* 34 | yarn-error.log* 35 | 36 | # Misc 37 | .DS_Store 38 | *.pem 39 | -------------------------------------------------------------------------------- /.npmrc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PankajKumardev/Flowpay/b65f093895e94bd94d17ab92fb27ee47876ebfbe/.npmrc -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | All notable changes to this project will be documented in this file. 4 | 5 | ### Added 6 | - **Initial Release**: Complete implementation of FlowPay with the following features: 7 | - **Wallet Management**: Add funds via HDFC and Axis Bank pages, track transactions (success, failure, pending). 8 | - **Transfer Page**: View unlocked, locked, and total balances; access recent transactions. 9 | - **Home Page (Dashboard)**: Quick overview of balance and access to key features (send money, add funds). 10 | - **Authentication**: Secure login/signup with NextAuth (JWT) and data validation using Zod. 11 | - **Frontend**: Built with Next.js and TailwindCSS; dynamic hero animations using Framer Motion. 12 | - **Backend**: API for wallet operations using Next.js API; database managed by Prisma ORM and PostgreSQL (NeonDB). 13 | - **Deployment**: Deployed using Docker on AWS EC2 and production-ready deployment on Vercel. 14 | 15 | ### Changed 16 | - Enhanced user interface with responsive design for mobile and desktop using TailwindCSS. 17 | - Updated API for secure and efficient handling of funds and wallet operations. 18 | 19 | ## [1.0.2] - 2024-11-10 20 | 21 | ### Added 22 | - Basic project setup with **Next.js**, **TailwindCSS**, and **Prisma ORM** for database management. 23 | - **Authentication System** using NextAuth for secure user management. 24 | 25 | --- 26 | 27 | ## Future Updates 28 | 29 | - **Webhooks** integration (Planned). 30 | - **Merchant App** (Planned). 31 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | 2 | # Contributing to FlowPay 3 | 4 | We welcome contributions to **FlowPay** and appreciate the effort made by every contributor. If you're interested in improving the project, here's how you can get involved: 5 | 6 | ## Table of Contents 7 | - [How to Contribute](#how-to-contribute) 8 | - [Contributing Guidelines](#contributing-guidelines) 9 | - [Suggested Contributions](#suggested-contributions) 10 | - [Code of Conduct](#code-of-conduct) 11 | 12 | ## How to Contribute 13 | 14 | ### Fork the Repository 15 | 1. Fork the repository by clicking the "Fork" button on the [FlowPay GitHub page](https://github.com/PankajKumardev/Flowpay). 16 | 2. Clone your forked repository to your local machine: 17 | ```bash 18 | git clone https://github.com//Flowpay.git 19 | cd Flowpay 20 | ``` 21 | 22 | ### Set Up Your Development Environment 23 | 1. Install dependencies: 24 | ```bash 25 | npm install 26 | ``` 27 | 2. Set up environment variables by copying the `.env.example` file to `.env` and filling in the necessary details (e.g., `JWT_SECRET`, `NEXTAUTH_URL`, `DATABASE_URL`). 28 | 3. Initialize the database: 29 | ```bash 30 | npm run db:migrate 31 | npm run db:generate 32 | ``` 33 | 4. Start the development server: 34 | ```bash 35 | npm run dev 36 | ``` 37 | 38 | ### Create a New Branch 39 | 1. Create a new branch to work on your feature or fix: 40 | ```bash 41 | git checkout -b feature/your-feature-name 42 | ``` 43 | 44 | ### Make Changes 45 | - Write your code and make sure it adheres to the coding standards of this project. 46 | - Test your changes locally and ensure everything works as expected. 47 | 48 | ### Commit and Push Changes 49 | 1. Add your changes: 50 | ```bash 51 | git add . 52 | ``` 53 | 2. Commit your changes with a clear and descriptive message: 54 | ```bash 55 | git commit -m "Add your commit message here" 56 | ``` 57 | 3. Push your changes: 58 | ```bash 59 | git push origin feature/your-feature-name 60 | ``` 61 | 62 | ### Open a Pull Request 63 | - Open a pull request to the `main` branch of this repository. Provide a clear description of the changes you’ve made and any additional information. 64 | 65 | --- 66 | 67 | ## Contributing Guidelines 68 | 69 | ### Code Standards 70 | - Follow best practices for writing clean, readable, and maintainable code. 71 | - Use **ESLint** and **Prettier** to ensure consistent code formatting. Check if the project’s `.eslint.json` and `.prettierrc` configurations are in place. 72 | 73 | ### Commit Messages 74 | - Write **clear** and **concise** commit messages. Follow the [Conventional Commits](https://www.conventionalcommits.org/) style guide if possible. 75 | 76 | ### Testing 77 | - Make sure you write tests for any new features or bug fixes. 78 | - Ensure all existing tests pass by running: 79 | ```bash 80 | npm run test 81 | ``` 82 | 83 | ### Pull Request Reviews 84 | - Be open to feedback and make requested changes before merging your pull request. 85 | 86 | --- 87 | 88 | ## Suggested Contributions 89 | 90 | We appreciate contributions in the following areas: 91 | 92 | - **Bug Fixes**: Help fix any issues found in the project. Check the [open issues](https://github.com/PankajKumardev/Flowpay/issues) for details. 93 | - **Features**: Add new features to enhance the functionality of FlowPay. 94 | - For example, a **merchant app** or integration with additional payment providers. 95 | - Webhooks for event-driven actions. 96 | - **UI/UX Enhancements**: Improve the user interface, accessibility, and design. 97 | - **Documentation**: Help improve the documentation by fixing typos, improving readability, or adding missing information. 98 | 99 | --- 100 | 101 | ## Code of Conduct 102 | 103 | Please be respectful and follow the [Code of Conduct](https://www.contributor-covenant.org/version/2/0/code_of_conduct/) while contributing to this project. 104 | 105 | --- 106 | 107 | Thank you for contributing to FlowPay! Your help is truly appreciated! 🚀 108 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2024 Flowpay 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # FlowPay 2 | 3 | 4 | ![flowpay](https://github.com/user-attachments/assets/afa4d917-9912-4c6b-b995-785d8260abef) 5 | 6 | ![FlowPay](https://img.shields.io/github/stars/PankajKumardev/Flowpay?style=social) ![Forks](https://img.shields.io/github/forks/PankajKumardev/Flowpay?style=social) ![Issues](https://img.shields.io/github/issues/PankajKumardev/Flowpay) ![License](https://img.shields.io/github/license/PankajKumardev/Flowpay) 7 | 8 | ## 🌟 Overview 9 | FlowPay is a cutting-edge peer-to-peer (P2P) payment and wallet management system, designed for effortless fund transfers and wallet functionalities. With a user-friendly interface and robust backend, FlowPay aims to simplify digital transactions for everyone. 10 | 11 | --- 12 | 13 | ## 🚀 Features 14 | ### 🏦 Wallet Management 15 | - **Seamless Fund Transfers:** Add funds via simulated HDFC and Axis bank pages. 16 | - **Transaction Tracking:** Monitor all wallet and P2P transactions, including success, failure, and pending statuses. 17 | - **Secure Transactions:** Supports transfers up to ₹10,000 per transaction. 18 | 19 | ### 💰 Transfer Page 20 | - View **unlocked, locked, and total balance** at a glance. 21 | - Quick access to **recent transactions** for easy tracking. 22 | 23 | ### 🏠 Home Page (Dashboard) 24 | - Overview of available balance. 25 | - One-click options for **sending money**, **adding funds**, and **viewing insights**. 26 | 27 | ### 🔐 Authentication & Security 28 | - **Secure Login/Signup:** Powered by NextAuth and JWT. 29 | - **Data Validation:** Ensured with Zod. 30 | 31 | ### 🎨 Frontend 32 | - Built with **Next.js** and **TailwindCSS** for responsive design. 33 | - Dynamic hero animations using **Framer Motion**. 34 | 35 | ### 🛠 Backend 36 | - **Robust API Features:** Add funds and handle wallet operations using Next.js API. 37 | - Database managed via **Prisma ORM** and **PostgreSQL** (NeonDB). 38 | - Future integration for **webhooks** using Express. 39 | 40 | ### 🌐 Deployment 41 | - Initial deployment with **Docker** on AWS EC2. 42 | - **Production-ready deployment** on Vercel. 43 | 44 | --- 45 | 46 | ## 💻 Tech Stack 47 | | **Category** | **Technology** | 48 | |---------------------|------------------------------| 49 | | Frontend | Next.js, TailwindCSS, Framer Motion | 50 | | Backend | Next.js API, Express (future) | 51 | | Database | PostgreSQL, Prisma ORM | 52 | | State Management | Recoil | 53 | | Tools | Turborepo, TypeScript, Docker | 54 | | Authentication | NextAuth (JWT sessions) | 55 | | Deployment | AWS EC2, Vercel | 56 | 57 | --- 58 | 59 | ## 📥 Installation Process 60 | 1. **Clone the repository:** 61 | ```bash 62 | git clone https://github.com/PankajKumardev/Flowpay.git 63 | cd Flowpay 64 | ``` 65 | 2. **Install dependencies:** 66 | ```bash 67 | npm install 68 | ``` 69 | 3. **Set up environment variables:** 70 | - Copy `.env.example` to `.env`. 71 | - Fill in required fields (`JWT_SECRET`, `NEXTAUTH_URL`, `DATABASE_URL`). 72 | 4. **Initialize the database:** 73 | ```bash 74 | npm run db:migrate 75 | npm run db:generate 76 | ``` 77 | 5. **Start the development server:** 78 | ```bash 79 | npm run dev 80 | ``` 81 | 6. **Build for production:** 82 | ```bash 83 | npm run build 84 | ``` 85 | 86 | --- 87 | 88 | ## 🤝 Contribution Guidelines 89 | ### 🌱 How to Get Involved 90 | We warmly welcome contributions to FlowPay! Here's how you can get started: 91 | 92 | 1. **Fork the repository** by clicking the "Fork" button. 93 | 2. **Clone your fork:** 94 | ```bash 95 | git clone https://github.com//Flowpay.git 96 | ``` 97 | 3. **Create a new branch:** 98 | ```bash 99 | git checkout -b feature/ 100 | ``` 101 | 4. **Set up the environment** (refer to installation steps). 102 | 5. **Make changes** following coding standards. 103 | 6. **Commit your changes:** 104 | ```bash 105 | git add . 106 | git commit -m "Your descriptive commit message" 107 | ``` 108 | 7. **Push changes:** 109 | ```bash 110 | git push origin 111 | ``` 112 | 8. **Open a pull request** with a clear description of changes. 113 | 114 | ### 📌 Suggested Contributions 115 | - **Enhancements:** Improve state management, Docker configuration, and UI/UX. 116 | - **Features:** Develop merchant app, add webhooks, and enhance FAQs. 117 | - **Bug Fixes:** Address open issues. 118 | 119 | ### 🏅 Contributor Badges 120 | Showcase your contribution with pride! 🏆 121 | [![Contributors](https://img.shields.io/github/contributors/PankajKumardev/Flowpay)](https://github.com/PankajKumardev/Flowpay/graphs/contributors) 122 | 123 | --- 124 | 125 | ## 🌟 Motivation & Entrepreneurship 126 | FlowPay was created to make digital finance seamless and accessible to everyone. Our vision is to empower individuals and businesses with innovative tools to simplify financial interactions. We believe in building an inclusive community where contributors and users thrive together. 🚀 127 | 128 | --- 129 | 130 | ## 🗂 Repository Structure 131 | ``` 132 | ├── README.md 133 | ├── apps 134 | │ ├── Bank-WebHook 135 | │ ├── merchant-app 136 | │ └── user-app 137 | ├── docker 138 | │ └── Dockerfile.user 139 | ├── packages 140 | │ ├── db 141 | │ ├── eslint-config 142 | │ ├── store 143 | │ ├── typescript-config 144 | │ └── ui 145 | ├── tsconfig.json 146 | └── turbo.json 147 | ``` 148 | 149 | --- 150 | 151 | ## 🛡 License 152 | FlowPay is available under the MIT License. Feel free to use and modify the code responsibly. 153 | 154 | --- 155 | 156 | ## 📖 Changelog 157 | Refer to [`CHANGELOG.md`](https://github.com/PankajKumardev/Flowpay/blob/main/CHANGELOG.md) for version history and updates. 158 | 159 | --- 160 | 161 | ## 📬 Contact 162 | For queries or collaborations: 163 | - Email: [pankajams1234@gmail.com](mailto:pankajams1234@gmail.com) 164 | - LinkedIn: [Pankaj Kumar](https://www.linkedin.com/in/pankajkumardev0/) 165 | - Twitter: [@pankajkumar_dev](https://x.com/pankajkumar_dev) 166 | 167 | --- 168 | 169 | ## 🌟 Stargazers & Forkers 170 | We appreciate your support! 🌟🍴 171 | 172 | [![Stargazers](https://img.shields.io/github/stars/PankajKumardev/Flowpay)](https://github.com/PankajKumardev/Flowpay/stargazers) [![Forks](https://img.shields.io/github/forks/PankajKumardev/Flowpay)](https://github.com/PankajKumardev/Flowpay/network/members) 173 | 174 | 175 | -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | 2 | # Security Policy 3 | 4 | ## Reporting a Vulnerability 5 | 6 | If you discover a vulnerability in FlowPay, please report it responsibly. We are committed to ensuring the security of our users, and we appreciate your help in identifying and addressing potential security issues. 7 | 8 | ### Steps for Reporting a Vulnerability: 9 | 10 | 1. **Do not disclose the vulnerability publicly** until it has been addressed. 11 | 2. **Email your report** to the repository maintainer at [pankajams1234@gmail.com](mailto:pankajams1234@gmail.com). 12 | 3. Provide clear details about the vulnerability, including: 13 | - Steps to reproduce the issue. 14 | - The impact of the vulnerability. 15 | - Any other relevant information that will help us understand and fix the issue. 16 | 17 | ### Vulnerability Disclosure Timeline: 18 | 19 | - **Initial Report:** We will acknowledge receipt of the report within 48 hours. 20 | - **Assessment:** We will evaluate the reported vulnerability and provide a fix or mitigation within a reasonable timeframe. 21 | - **Public Disclosure:** After fixing the issue, we will disclose the vulnerability and the fix in our changelog and security updates. 22 | 23 | ## Supported Versions 24 | 25 | We support the following versions of FlowPay with security updates: 26 | 27 | - Latest stable release 28 | - Previous stable release (if applicable) 29 | 30 | ## Security Updates 31 | 32 | We will release security patches for vulnerabilities in supported versions as soon as they are available. To stay updated on security releases, please subscribe to our repository's notifications. 33 | 34 | ## Security Best Practices 35 | 36 | We encourage all users and contributors to follow security best practices when developing and using FlowPay: 37 | 38 | - **Use secure authentication methods** (e.g., multi-factor authentication). 39 | - **Keep dependencies up-to-date** to mitigate known vulnerabilities. 40 | - **Regularly audit your code** for security vulnerabilities. 41 | 42 | For additional guidance on securing your application, you can refer to the OWASP top 10 security risks and implement necessary safeguards. 43 | 44 | --- 45 | 46 | Thank you for helping us keep FlowPay secure! 47 | -------------------------------------------------------------------------------- /apps/Bank-WebHook/.env.example: -------------------------------------------------------------------------------- 1 | PORT=3003 -------------------------------------------------------------------------------- /apps/Bank-WebHook/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "bank-webhook", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "build": "npx esbuild ./src/index.ts --bundle --platform=node --outfile=dist/index.js", 8 | "start": "node dist/index.js", 9 | "dev": "npm run build && npm run start" 10 | }, 11 | "keywords": [], 12 | "author": "", 13 | "license": "ISC", 14 | "dependencies": { 15 | "@repo/db": "*", 16 | "@types/express": "^4.17.21", 17 | "esbuild": "^0.20.2", 18 | "express": "^4.19.1" 19 | }, 20 | "devDependencies": { 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /apps/Bank-WebHook/src/index.ts: -------------------------------------------------------------------------------- 1 | import express from 'express'; 2 | import db from '@repo/db/client'; 3 | import { z } from 'zod'; 4 | const Port = process.env.PORT || 3003; 5 | const app = express(); 6 | app.use(express.json()); 7 | 8 | const TranscationSchema = z.object({ 9 | userId: z.string(), 10 | amount: z.number(), 11 | token: z.string(), 12 | }); 13 | // ** Function to handle pending transactions on server startup ** 14 | async function processPendingTransactions() { 15 | try { 16 | const pendingTransactions = await db.onRampTransaction.findMany({ 17 | where: { status: 'Pending' }, 18 | }); 19 | 20 | for (const transaction of pendingTransactions) { 21 | await db.$transaction([ 22 | db.balance.update({ 23 | where: { userId: transaction.userId }, 24 | data: { 25 | amount: { 26 | increment: transaction.amount, // Increment user balance by transaction amount 27 | }, 28 | }, 29 | }), 30 | db.onRampTransaction.update({ 31 | where: { id: transaction.id }, 32 | data: { status: 'Completed' }, 33 | }), 34 | ]); 35 | } 36 | 37 | console.log( 38 | `Processed ${pendingTransactions.length} pending transactions.` 39 | ); 40 | } catch (error) { 41 | console.error('Error processing pending transactions:', error); 42 | } 43 | } 44 | 45 | app.post('/hdfcWebhook', async (req, res) => { 46 | const result = TranscationSchema.safeParse(req.body); 47 | 48 | if (!result.success) { 49 | res.status(400).send(result.error); 50 | return; 51 | } 52 | 53 | const paymentInformation = { 54 | token: req.body.token, 55 | userId: req.body.userId, 56 | amount: req.body.amount, 57 | }; 58 | 59 | try { 60 | await db.$transaction([ 61 | db.balance.updateMany({ 62 | where: { 63 | userId: Number(paymentInformation.userId), 64 | }, 65 | data: { 66 | amount: { 67 | increment: Number(paymentInformation.amount), 68 | }, 69 | }, 70 | }), 71 | db.onRampTransaction.updateMany({ 72 | where: { 73 | token: paymentInformation.token, 74 | }, 75 | data: { 76 | status: 'Completed', 77 | }, 78 | }), 79 | ]); 80 | 81 | res.status(200).json({ message: 'Captured payment' }); 82 | } catch (e) { 83 | console.log(e); 84 | res.status(411).json({ message: 'Error while Processing webhook' }); 85 | } 86 | }); 87 | 88 | 89 | app.listen(Port, async () => { 90 | console.log(`Server is running on ${Port}`); 91 | await processPendingTransactions(); 92 | }); 93 | -------------------------------------------------------------------------------- /apps/Bank-WebHook/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends" : "@repo/typescript-config/base.json", 3 | "compilerOptions": { 4 | "outDir": "./dist" 5 | }, 6 | "include": ["src"], 7 | "exclude": ["node_modules, dist"] 8 | } -------------------------------------------------------------------------------- /apps/Bank-WebHook/vercel.json: -------------------------------------------------------------------------------- 1 | { 2 | "builds": [ 3 | { 4 | "src": "apps/bank-webhook/src/index.ts", 5 | "use": "@vercel/node", 6 | "config": { 7 | "includeFiles": ["packages/db/**"] 8 | } 9 | } 10 | ], 11 | "routes": [ 12 | { "src": "/.*", "dest": "apps/bank-webhook/dist/index.js" } 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /apps/merchant-app/.env.example: -------------------------------------------------------------------------------- 1 | GOOGLE_CLIENT_ID=your-google-client-id 2 | GOOGLE_CLIENT_SECRET=your-google-client-secret 3 | GITHUB_CLIENT_ID=your-github-client-id 4 | GITHUB_CLIENT_SECRET=your-github-client-secret 5 | NEXTAUTH_SECRET=your-nextauth-secret -------------------------------------------------------------------------------- /apps/merchant-app/.eslintrc.js: -------------------------------------------------------------------------------- 1 | /** @type {import("eslint").Linter.Config} */ 2 | module.exports = { 3 | root: true, 4 | extends: ["@repo/eslint-config/next.js"], 5 | parser: "@typescript-eslint/parser", 6 | parserOptions: { 7 | project: true, 8 | }, 9 | }; 10 | -------------------------------------------------------------------------------- /apps/merchant-app/README.md: -------------------------------------------------------------------------------- 1 | ## Getting Started 2 | 3 | First, run the development server: 4 | 5 | ```bash 6 | yarn dev 7 | ``` 8 | 9 | Open [http://localhost:3000](http://localhost:3000) with your browser to see the result. 10 | 11 | You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file. 12 | 13 | To create [API routes](https://nextjs.org/docs/app/building-your-application/routing/router-handlers) add an `api/` directory to the `app/` directory with a `route.ts` file. For individual endpoints, create a subfolder in the `api` directory, like `api/hello/route.ts` would map to [http://localhost:3000/api/hello](http://localhost:3000/api/hello). 14 | 15 | ## Learn More 16 | 17 | To learn more about Next.js, take a look at the following resources: 18 | 19 | - [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API. 20 | - [Learn Next.js](https://nextjs.org/learn/foundations/about-nextjs) - an interactive Next.js tutorial. 21 | 22 | You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome! 23 | 24 | ## Deploy on Vercel 25 | 26 | The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_source=github.com&utm_medium=referral&utm_campaign=turborepo-readme) from the creators of Next.js. 27 | 28 | Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details. 29 | -------------------------------------------------------------------------------- /apps/merchant-app/app/api/auth/[...nextauth]/route.ts: -------------------------------------------------------------------------------- 1 | import NextAuth from "next-auth"; 2 | import { authOptions } from "../../../../lib/auth"; 3 | 4 | //@ts-ignore 5 | const handler = NextAuth(authOptions); 6 | 7 | export { handler as GET, handler as POST }; -------------------------------------------------------------------------------- /apps/merchant-app/app/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PankajKumardev/Flowpay/b65f093895e94bd94d17ab92fb27ee47876ebfbe/apps/merchant-app/app/favicon.ico -------------------------------------------------------------------------------- /apps/merchant-app/app/globals.css: -------------------------------------------------------------------------------- 1 | 2 | @tailwind base; 3 | @tailwind components; 4 | @tailwind utilities; 5 | 6 | ::-webkit-scrollbar { 7 | width: 4px; 8 | } 9 | 10 | ::-webkit-scrollbar-track { 11 | background: #f1f1f1; 12 | } 13 | 14 | ::-webkit-scrollbar-thumb { 15 | background: #888; 16 | border-radius: 4px; 17 | } 18 | 19 | ::-webkit-scrollbar-thumb:hover { 20 | background: #555; 21 | } -------------------------------------------------------------------------------- /apps/merchant-app/app/layout.tsx: -------------------------------------------------------------------------------- 1 | import "./globals.css"; 2 | import type { Metadata } from "next"; 3 | import { Inter } from "next/font/google"; 4 | import { Providers } from "../provider"; 5 | 6 | const inter = Inter({ subsets: ["latin"] }); 7 | 8 | export const metadata: Metadata = { 9 | title: "Create Turborepo", 10 | description: "Generated by create turbo", 11 | }; 12 | 13 | export default function RootLayout({ 14 | children, 15 | }: { 16 | children: React.ReactNode; 17 | }): JSX.Element { 18 | return ( 19 | 20 | 21 | {children} 22 | 23 | 24 | ); 25 | } 26 | -------------------------------------------------------------------------------- /apps/merchant-app/app/page.module.css: -------------------------------------------------------------------------------- 1 | .main { 2 | display: flex; 3 | flex-direction: column; 4 | justify-content: space-between; 5 | align-items: center; 6 | padding: 6rem; 7 | min-height: 100vh; 8 | } 9 | 10 | .vercelLogo { 11 | filter: invert(1); 12 | } 13 | 14 | .description { 15 | display: inherit; 16 | justify-content: inherit; 17 | align-items: inherit; 18 | font-size: 0.85rem; 19 | max-width: var(--max-width); 20 | width: 100%; 21 | z-index: 2; 22 | font-family: var(--font-mono); 23 | } 24 | 25 | .description a { 26 | display: flex; 27 | justify-content: center; 28 | align-items: center; 29 | gap: 0.5rem; 30 | } 31 | 32 | .description p { 33 | position: relative; 34 | margin: 0; 35 | padding: 1rem; 36 | background-color: rgba(var(--callout-rgb), 0.5); 37 | border: 1px solid rgba(var(--callout-border-rgb), 0.3); 38 | border-radius: var(--border-radius); 39 | } 40 | 41 | .code { 42 | font-weight: 700; 43 | font-family: var(--font-mono); 44 | } 45 | 46 | .hero { 47 | display: flex; 48 | position: relative; 49 | place-items: center; 50 | } 51 | 52 | .heroContent { 53 | display: flex; 54 | position: relative; 55 | z-index: 0; 56 | padding-bottom: 4rem; 57 | flex-direction: column; 58 | gap: 2rem; 59 | justify-content: space-between; 60 | align-items: center; 61 | width: auto; 62 | font-family: system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, 63 | "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", 64 | "Segoe UI Symbol", "Noto Color Emoji"; 65 | padding-top: 48px; 66 | 67 | @media (min-width: 768px) { 68 | padding-top: 4rem; 69 | padding-bottom: 6rem; 70 | } 71 | @media (min-width: 1024px) { 72 | padding-top: 5rem; 73 | padding-bottom: 8rem; 74 | } 75 | } 76 | 77 | .logos { 78 | display: flex; 79 | z-index: 50; 80 | justify-content: center; 81 | align-items: center; 82 | width: 100%; 83 | } 84 | 85 | .grid { 86 | display: grid; 87 | grid-template-columns: repeat(4, minmax(25%, auto)); 88 | max-width: 100%; 89 | width: var(--max-width); 90 | } 91 | 92 | .card { 93 | padding: 1rem 1.2rem; 94 | border-radius: var(--border-radius); 95 | background: rgba(var(--card-rgb), 0); 96 | border: 1px solid rgba(var(--card-border-rgb), 0); 97 | transition: background 200ms, border 200ms; 98 | } 99 | 100 | .card span { 101 | display: inline-block; 102 | transition: transform 200ms; 103 | } 104 | 105 | .card h2 { 106 | font-weight: 600; 107 | margin-bottom: 0.7rem; 108 | } 109 | 110 | .card p { 111 | margin: 0; 112 | opacity: 0.6; 113 | font-size: 0.9rem; 114 | line-height: 1.5; 115 | max-width: 30ch; 116 | } 117 | 118 | @media (prefers-reduced-motion) { 119 | .card:hover span { 120 | transform: none; 121 | } 122 | } 123 | 124 | /* Mobile */ 125 | @media (max-width: 700px) { 126 | .content { 127 | padding: 4rem; 128 | } 129 | 130 | .grid { 131 | grid-template-columns: 1fr; 132 | margin-bottom: 120px; 133 | max-width: 320px; 134 | text-align: center; 135 | } 136 | 137 | .card { 138 | padding: 1rem 2.5rem; 139 | } 140 | 141 | .card h2 { 142 | margin-bottom: 0.5rem; 143 | } 144 | 145 | .center { 146 | padding: 8rem 0 6rem; 147 | } 148 | 149 | .center::before { 150 | transform: none; 151 | height: 300px; 152 | } 153 | 154 | .description { 155 | font-size: 0.8rem; 156 | } 157 | 158 | .description a { 159 | padding: 1rem; 160 | } 161 | 162 | .description p, 163 | .description div { 164 | display: flex; 165 | justify-content: center; 166 | position: fixed; 167 | width: 100%; 168 | } 169 | 170 | .description p { 171 | align-items: center; 172 | inset: 0 0 auto; 173 | padding: 2rem 1rem 1.4rem; 174 | border-radius: 0; 175 | border: none; 176 | border-bottom: 1px solid rgba(var(--callout-border-rgb), 0.25); 177 | background: linear-gradient( 178 | to bottom, 179 | rgba(var(--background-start-rgb), 1), 180 | rgba(var(--callout-rgb), 0.5) 181 | ); 182 | background-clip: padding-box; 183 | backdrop-filter: blur(24px); 184 | } 185 | 186 | .description div { 187 | align-items: flex-end; 188 | pointer-events: none; 189 | inset: auto 0 0; 190 | padding: 2rem; 191 | height: 200px; 192 | background: linear-gradient( 193 | to bottom, 194 | transparent 0%, 195 | rgb(var(--background-end-rgb)) 40% 196 | ); 197 | z-index: 1; 198 | } 199 | } 200 | 201 | /* Enable hover only on non-touch devices */ 202 | @media (hover: hover) and (pointer: fine) { 203 | .card:hover { 204 | background: rgba(var(--card-rgb), 0.1); 205 | border: 1px solid rgba(var(--card-border-rgb), 0.15); 206 | } 207 | 208 | .card:hover span { 209 | transform: translateX(4px); 210 | } 211 | } 212 | 213 | .circles { 214 | position: absolute; 215 | min-width: 614px; 216 | min-height: 614px; 217 | pointer-events: none; 218 | } 219 | 220 | .logo { 221 | z-index: 50; 222 | width: 120px; 223 | height: 120px; 224 | } 225 | 226 | .logoGradientContainer { 227 | display: flex; 228 | position: absolute; 229 | z-index: 50; 230 | justify-content: center; 231 | align-items: center; 232 | width: 16rem; 233 | height: 16rem; 234 | } 235 | 236 | .turborepoWordmarkContainer { 237 | display: flex; 238 | z-index: 50; 239 | padding-left: 1.5rem; 240 | padding-right: 1.5rem; 241 | flex-direction: column; 242 | gap: 1.25rem; 243 | justify-content: center; 244 | align-items: center; 245 | text-align: center; 246 | 247 | @media (min-width: 1024px) { 248 | gap: 1.5rem; 249 | } 250 | } 251 | 252 | .turborepoWordmark { 253 | width: 160px; 254 | fill: white; 255 | 256 | @media (min-width: 768px) { 257 | width: 200px; 258 | } 259 | } 260 | 261 | .code { 262 | font-family: Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", 263 | monospace; 264 | font-weight: 700; 265 | } 266 | 267 | /* Tablet and Smaller Desktop */ 268 | @media (min-width: 701px) and (max-width: 1120px) { 269 | .grid { 270 | grid-template-columns: repeat(2, 50%); 271 | } 272 | } 273 | 274 | /* Gradients */ 275 | .gradient { 276 | position: absolute; 277 | mix-blend-mode: normal; 278 | will-change: filter; 279 | pointer-events: none; 280 | } 281 | 282 | .gradientSmall { 283 | filter: blur(32px); 284 | } 285 | 286 | .gradientLarge { 287 | filter: blur(75px); 288 | } 289 | 290 | .glowConic { 291 | background-image: var(--glow-conic); 292 | } 293 | 294 | .logoGradient { 295 | opacity: 0.9; 296 | width: 120px; 297 | height: 120px; 298 | } 299 | 300 | .backgroundGradient { 301 | top: -500px; 302 | width: 1000px; 303 | height: 1000px; 304 | opacity: 0.15; 305 | } 306 | 307 | .button { 308 | background-color: #ffffff; 309 | border-radius: 8px; 310 | border-style: none; 311 | box-sizing: border-box; 312 | color: #000000; 313 | cursor: pointer; 314 | display: inline-block; 315 | font-size: 16px; 316 | height: 40px; 317 | line-height: 20px; 318 | list-style: none; 319 | margin: 0; 320 | outline: none; 321 | padding: 10px 16px; 322 | position: relative; 323 | text-align: center; 324 | text-decoration: none; 325 | transition: color 100ms; 326 | vertical-align: baseline; 327 | user-select: none; 328 | -webkit-user-select: none; 329 | touch-action: manipulation; 330 | } 331 | 332 | .button:hover, 333 | .button:focus { 334 | background-color: #e5e4e2; 335 | } 336 | -------------------------------------------------------------------------------- /apps/merchant-app/app/page.tsx: -------------------------------------------------------------------------------- 1 | "use client"; 2 | 3 | import { useBalance } from "@repo/store/balance"; 4 | 5 | export default function () { 6 | const balance = useBalance(); 7 | return
hi there {balance}
; 8 | } 9 | -------------------------------------------------------------------------------- /apps/merchant-app/lib/auth.ts: -------------------------------------------------------------------------------- 1 | import GoogleProvider from "next-auth/providers/google"; 2 | import db from "@repo/db/client"; 3 | import GithubProvider from "next-auth/providers/github"; 4 | 5 | export const authOptions = { 6 | providers: [ 7 | GoogleProvider({ 8 | clientId: process.env.GOOGLE_CLIENT_ID || "", 9 | clientSecret: process.env.GOOGLE_CLIENT_SECRET || "", 10 | }), 11 | GithubProvider({ 12 | clientId: process.env.GITHUB_CLIENT_ID || "", 13 | clientSecret: process.env.GITHUB_CLIENT_SECRET || "", 14 | }), 15 | ], 16 | callbacks: { 17 | async signIn({ 18 | user, 19 | account, 20 | }: { 21 | user: { 22 | email: string; 23 | name: string; 24 | }; 25 | account: { 26 | provider: "google" | "github"; 27 | }; 28 | }) { 29 | console.log("hi signin"); 30 | if (!user || !user.email) { 31 | return false; 32 | } 33 | 34 | await db.merchant.upsert({ 35 | select: { 36 | id: true, 37 | }, 38 | where: { 39 | email: user.email, 40 | }, 41 | create: { 42 | email: user.email, 43 | name: user.name, 44 | auth_type: account.provider === "google" ? "Google" : "Github", // Use a prisma type here 45 | }, 46 | update: { 47 | name: user.name, 48 | auth_type: account.provider === "google" ? "Google" : "Github", // Use a prisma type here 49 | }, 50 | }); 51 | 52 | return true; 53 | }, 54 | }, 55 | secret: process.env.NEXTAUTH_SECRET || "secret", 56 | }; 57 | -------------------------------------------------------------------------------- /apps/merchant-app/next-env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | /// 3 | 4 | // NOTE: This file should not be edited 5 | // see https://nextjs.org/docs/app/building-your-application/configuring/typescript for more information. 6 | -------------------------------------------------------------------------------- /apps/merchant-app/next.config.js: -------------------------------------------------------------------------------- 1 | /** @type {import('next').NextConfig} */ 2 | module.exports = { 3 | transpilePackages: ["@repo/ui"], 4 | }; 5 | -------------------------------------------------------------------------------- /apps/merchant-app/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "web", 3 | "version": "1.0.0", 4 | "private": true, 5 | "scripts": { 6 | "dev": "next dev", 7 | "build": "next build", 8 | "start": "next start", 9 | "lint": "eslint . --max-warnings 0" 10 | }, 11 | "dependencies": { 12 | "@repo/db": "*", 13 | "@repo/store": "*", 14 | "@repo/ui": "*", 15 | "next": "^14.1.1", 16 | "next-auth": "^4.24.7", 17 | "react": "^18.2.0", 18 | "react-dom": "^18.2.0", 19 | "recoil": "^0.7.7" 20 | }, 21 | "devDependencies": { 22 | "@next/eslint-plugin-next": "^14.1.1", 23 | "@repo/eslint-config": "*", 24 | "@repo/typescript-config": "*", 25 | "@types/eslint": "^8.56.5", 26 | "@types/node": "^20.11.24", 27 | "@types/react": "^18.2.61", 28 | "@types/react-dom": "^18.2.19", 29 | "eslint": "^8.57.0", 30 | "typescript": "^5.3.3" 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /apps/merchant-app/postcss.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | plugins: { 3 | tailwindcss: {}, 4 | autoprefixer: {}, 5 | }, 6 | } 7 | -------------------------------------------------------------------------------- /apps/merchant-app/provider.tsx: -------------------------------------------------------------------------------- 1 | "use client" 2 | import { RecoilRoot } from "recoil"; 3 | import { SessionProvider } from "next-auth/react"; 4 | export const Providers = ({children}: {children: React.ReactNode}) => { 5 | return 6 | 7 | {children} 8 | 9 | 10 | } -------------------------------------------------------------------------------- /apps/merchant-app/tailwind.config.js: -------------------------------------------------------------------------------- 1 | /** @type {import('tailwindcss').Config} */ 2 | module.exports = { 3 | content: [ 4 | "./app/**/*.{js,ts,jsx,tsx,mdx}", 5 | "./pages/**/*.{js,ts,jsx,tsx,mdx}", 6 | "./components/**/*.{js,ts,jsx,tsx,mdx}", 7 | "../../packages/ui/**/*.{js,ts,jsx,tsx,mdx}" 8 | ], 9 | theme: { 10 | extend: {}, 11 | }, 12 | plugins: [], 13 | } -------------------------------------------------------------------------------- /apps/merchant-app/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "@repo/typescript-config/nextjs.json", 3 | "compilerOptions": { 4 | "plugins": [ 5 | { 6 | "name": "next" 7 | } 8 | ] 9 | }, 10 | "include": [ 11 | "next-env.d.ts", 12 | "next.config.js", 13 | "**/*.ts", 14 | "**/*.tsx", 15 | ".next/types/**/*.ts" 16 | ], 17 | "exclude": ["node_modules"] 18 | } 19 | -------------------------------------------------------------------------------- /apps/user-app/.env.example: -------------------------------------------------------------------------------- 1 | JWT_SECRET=test 2 | NEXTAUTH_URL=http://localhost:3001 -------------------------------------------------------------------------------- /apps/user-app/.eslintrc.js: -------------------------------------------------------------------------------- 1 | /** @type {import("eslint").Linter.Config} */ 2 | module.exports = { 3 | root: true, 4 | extends: ["@repo/eslint-config/next.js"], 5 | parser: "@typescript-eslint/parser", 6 | parserOptions: { 7 | project: true, 8 | }, 9 | }; 10 | -------------------------------------------------------------------------------- /apps/user-app/AppbarClient.tsx: -------------------------------------------------------------------------------- 1 | "use client"; 2 | import { signIn, signOut, useSession } from "next-auth/react"; 3 | import { Appbar } from "@repo/ui/appbar"; 4 | import { useRouter } from "next/navigation"; 5 | 6 | export function AppbarClient() { 7 | const session = useSession(); 8 | const router = useRouter(); 9 | return ( 10 |
11 | { 14 | await signOut(); 15 | router.push("/home"); 16 | }} 17 | user={session.data?.user} 18 | /> 19 |
20 | ); 21 | } 22 | -------------------------------------------------------------------------------- /apps/user-app/ClientWrapper.tsx: -------------------------------------------------------------------------------- 1 | "use client"; 2 | 3 | import { usePathname } from "next/navigation"; 4 | import { AppbarClient } from "./AppbarClient"; 5 | import Footer from "@repo/ui/footer"; 6 | 7 | export default function ClientWrapper({ 8 | children, 9 | }: { 10 | children: React.ReactNode; 11 | }) { 12 | const pathname = usePathname(); 13 | 14 | const showAppbarAndFooter = 15 | pathname !== "/home" && 16 | pathname !== "/auth" && 17 | pathname !== "/Bank/hdfc" && 18 | pathname !== "/Bank/axis"; 19 | 20 | return ( 21 | <> 22 | {showAppbarAndFooter && } 23 | 24 | {children} 25 | 26 | {showAppbarAndFooter &&