engrmarkk / speed_pay

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Speed_Pay



Contributors Forks Stargazers Issues Twitter



Table of Contents
  1. About the project
  2. Usage
  3. Contact

back to top


About The Project

The API is a secure and efficient financial transaction service built with Django Rest Framework. The platform enables users to conduct seamless and reliable fund transfers, and balance inquiries. With the API, managing your finances becomes effortless, ensuring a smooth experience for individuals.

Features

  • Secure Authentication: SpeedPay offers robust user authentication, ensuring that your financial information remains safe and accessible only to you.

  • Automatic Account Generation: When you create an account, a unique 10-digit account number is automatically generated for you, simplifying transactions and enhancing security.

  • Convenient Fund Transfers: Send funds to other users' accounts effortlessly with our user-friendly transfer endpoint. Whether it's a friend, or family member, transferring money is quick and hassle-free.

  • Real-time Balance Inquiries: Keep track of your account balance in real-time. The API allows you to check your available balance at any moment, ensuring you have full control over your finances.

back to top

Built With:

Python Django DjangoRest


back to top

Usage

To get a local copy up and running, follow the steps below.

Prerequisites

Python3: Get Python

Installation

  1. Clone this repo

    git clone https://github.com/engrmarkk/speed_pay.git
  2. Navigate into the directory

    cd speed_pay
  3. Create a virtual environment

    python -m venv your_venv_name
  4. Activate the virtual environment on powershell or cmd

    your_venv_name\Scripts\activate.bat

    On Bash ('Scripts' for windows, 'bin' for linux)

    source your_venv_name/Scripts/activate.csh
  5. Install project dependencies

    pip install -r requirements.txt
  6. Create SQLite database

    python manage.py makemigrations speedpay
    python manage.py migrate
  7. Run App

     python manage.py runserver
  8. Use the link generated on the terminal to access the endpoints

    http://127.0.0.1:8000

    To use swagger-ui, use the link below

     http://127.0.0.1:8000/

Project structure

.
├── README.md
├── .gitignore
├── LICENSE
├── speed_app
│   ├── __init__.py
│   ├── endpoints
│   │   ├── __init__.py
│   │   ├── auth.py
│   │   └── users.py
│   ├── models
│   ├── apps.py
│   ├── managers.py
│   ├── serializers
│   ├── tests.py
│   └── urls.pyy
├── speed_proj
│   ├── __init__.py
│   ├── asgi.py
│   ├── settings.py
│   ├── urls.py
│   └── wsgi.py
├── your_venv_name
├── manage.py
├── Your_sqlite_database
└── requirements.txt

Endpoints


POST (Register) http://127.0.0.1:8000/api/register

To get registered as an admin, make sure your email ends with @speedpay

REQUEST

{
  "firstname": "string",
  "password1": "string",
  "password2": "string",
  "email": "string@string.com",
   "or"
   "email": "string@speedpay.com",
  "username": "string",
  "lastname": "string",
}

POST (Login) http://127.0.0.1:8000/api/login

REQUEST

{
  "email": "user@example.com", 
        'or'
  "username": "string",
  "password": "string"
}

RESPONSE

  {
    "key": "eyJhbGciOiJIUzIEyM...................",
  }

To login with your key,

Token <key>

`

POST (Send fund) http://127.0.0.1:8000/api/send-fund
@login_required

REQUEST

{
  "transaction_amount": 0,
  "transact_user_account": 0
}

RESPONSE

  {
  "message": "Funds transferred successfully"
}

POST (Deposit) http://127.0.0.1:8000/api/deposit

REQUEST

{
  "transaction_amount": 1000
}

RESPONSE

  {
  "message": "Funds deposited successfully"
}

GET (Check Balance) http://127.0.0.1:8000/api/check-balance
@login_required

RESPONSE

{
  "message": "Your balance is $1000"
}

GET (Get all users) http://127.0.0.1:8000/api/users
@admin_required

RESPONSE

  [
  {
    "id": 1,
    "firstname": "string",
    "lastname": "string",
    "username": "string",
    "email": "user@example.com",
    "phone": "091.....",
    "account_number": 91900000,
    "balance": 1200
  },
  {
    "id": 2,
    "firstname": "string",
    "lastname": "string",
    "username": "string1",
    "email": "user1@example.com",
    "phone": "091.....",
    "account_number": 31320000,
    "balance": 2000
  },
  {
    "id": 3,
    "firstname": "string",
    "lastname": "string",
    "username": "speedpay",
    "email": "user1@speedpay.com",
    "phone": "081.....",
    "account_number": 7180000,
    "balance": 1000
  }
]

back to top


Contact

Adeniyi Olanrewaju - @iamengrmark - adeniyiboladale@yahoo.com

Project Link: SpeedPay Test Api

Live Link: Speed Test

back to top


About

License:MIT License


Languages

Language:Python 99.8%Language:Procfile 0.2%