Skip to content

Akram-7869/Paytm-Project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

15 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“± PAYTM-VENAMO-WALLET

DemoVideo.mp4

Welcome to the Paytm! This is a financial technology application that allows users to send, receive, and manage their balances seamlessly. Built with a focus on security and scalability.

πŸ—‚ Table of Contents

🌟 Introduction

Venamo is a payment app that enables peer-to-peer (P2P) transactions, allowing users to transfer money easily and securely. Users can check their balances and view transaction histories. The app is built with Next.js for both the frontend and backend, and Prisma with PostgreSQL for the database. It utilizes Turborepo for efficient monorepo management, with Express.js handling webhooks.

πŸš€ Features

  • πŸ”’ Secure Authentication: Supports login with email and phone number as well as OAuth providers like Google.
  • πŸ’Έ Real-time P2P Transfers: Send and receive money between users.
  • πŸ“Š Balance Management: Displays both available and locked balances.
  • πŸ“… Transaction History: Detailed transaction records, including timestamps and providers.

πŸ›  Tech Stack

Your installation instructions look clear and well-structured! However, there are a few minor improvements and clarifications that can enhance clarity and correctness. Here’s a refined version:


πŸ’» Installation

Use Docker for Installation

  1. Build the Docker image:
    docker build -t image_name .
  2. Run the Docker container:
    docker run -p 3000:3000 image_name

Or Follow These Steps:

  1. Clone the repository:

    git clone https://github.com/miravanisri/Venamo_PaymentApp.git
    cd Venamo_PaymentApp
  2. Install dependencies:

    npm install
  3. Configure environment variables: Create a .env file in the project root and add the following variable:

    DATABASE_URL=your_database_url
    
  4. Set up the database:

    npx prisma migrate dev --name init
  5. Generate the Prisma client:

    npx prisma generate
  6. Seed the database with initial data:

    npx prisma db seed
  7. Run the application:

    npm run dev

Additional Notes

  • Database URL: Make sure to replace your_database_url with the actual database connection string.
  • Container Port: Ensure that the application inside the Docker container is listening on port 3000, as you are mapping it to the host.

πŸ“ Project Structure

project-name/
β”œβ”€β”€ apps
β”‚   └── user-app    # Frontend built with Next.js
β”œβ”€β”€ packages
β”‚   β”œβ”€β”€ db          # Prisma and PostgreSQL database setup
β”‚   └── store       # Recoil state management
β”œβ”€β”€ components      # Reusable UI components
└── ...             # Other files and directories

πŸ—„ Database Schema

model User {
  id                Int                 @id @default(autoincrement())
  email             String?             @unique
  name              String?
  number            String              @unique
  password          String
  OnRampTransaction OnRampTransaction[]
  Balance           Balance[]
  sentTransfers     p2pTransfer[]       @relation(name: "FromUserRelation")
  receivedTransfers p2pTransfer[]       @relation(name: "ToUserRelation")
}

model Merchant {
  id        Int      @id @default(autoincrement())
  email     String   @unique
  name      String?
  auth_type AuthType
}

model OnRampTransaction {
  id        Int          @id @default(autoincrement())
  status    OnRampStatus
  token     String       @unique
  provider  String
  amount    Int
  startTime DateTime
  userId    Int
  user      User         @relation(fields: [userId], references: [id])
}

model p2pTransfer {
  id         Int          @id @default(autoincrement())
  amount     Int
  timestamp  DateTime
  fromUserId Int
  fromUser   User         @relation(name: "FromUserRelation", fields: [fromUserId], references: [id])
  toUserId   Int
  toUser     User         @relation(name: "ToUserRelation", fields: [toUserId], references: [id])
}

model Balance {
  id     Int  @id @default(autoincrement())
  userId Int  @unique
  amount Int
  locked Int
  user   User @relation(fields: [userId], references: [id])
}

enum AuthType {
  Google
  Github
}

enum OnRampStatus {
  Success
  Failure
  Processing
}

πŸ“¦ Modules

1. Authentication

  • OAuth & Credentials Provider: Login via email/phone or Google using secure bcrypt hashing for password storage.

2. P2P Transfer

  • Real-time Transfers: Allows users to send money to other users by providing their phone number.
  • Transaction Logs: Keeps track of all the user’s transactions.

3. Balance Management

  • Available and Locked Balances: Displays the current balance with details about locked funds.

☁️ Deployment

  1. Frontend: Deploy the Next.js frontend on Vercel.
  2. Backend: Host the backend on Heroku or DigitalOcean.
  3. Database: Use NeonDB or Aiven for PostgreSQL hosting.

πŸ“œ License

This project is licensed under the MIT License. See the LICENSE file for details.


Releases

No releases published

Packages

 
 
 

Contributors