Skip to main content

Interphase - Bridging Backend and Frontend Development with Git Submodule

Introduction

Interphase is a powerful tool + git structure designed to streamline the collaboration between backend and frontend developers by facilitating the sharing of critical information, including types, example data, API URLs, and documentation. The core concept is to provide an interconnected platform that enables seamless communication between these two development environments, thereby reducing friction and enhancing productivity, thus bridging the gap between the two development repository.

Currently Available Support Packages

Requirements

Python >= 3.7

1. Installation

$ pip install Interphase

2. Quick Start

📁 Simple folder structure

📁  your_project
|
├──📁 types (requied)
|   |
│   └──📄api.d.ts (optional)
|
└──📄main.py

📄main.py

from Interphase import Interphase

ts = Interphase("./types")

userData = {
    "name": "John Doe",
    "age": 30,
    "email": "example@demo.com",
    "skills": ["Python", "TypeScript", "JavaScript"]
}

ts.write('api', 'UserData', userData)

📄 api.d.ts

export type UserData = {
    name: string;
    age: number;
    email: string;
    skills: string[];
}

3. Real Life Developer Usage

.gitmodules

[submodule "api"]
	path = api
	url = https://github.com/username/api.git

Frontend

📁 FrontEnd-repo
│
├──📁 api (git submodule)
│   │
│   ├──📄__init__.py
│   ├──📄setup.py
│   │
│   └──📁 types
│       │
│       └──📄 api.d.ts
│
├──📁 src
│   │
│   └──📄 (other frontend files, where /api/types are imported and used)
│   
├──📄 package.json
├──📄 .gitmodules (important)
└──📄 .gitignore

Backend

📁 Backend-repo
│
├──📁 api (git submodule)
│   │
│   ├──📄__init__.py
│   ├──📄setup.py
│   │
│   └──📁 types
│       │
│       └──📄 api.d.ts
│
├──📁 src
│   │
│   └──📄 (other backend files, where helps to create types for /api)
│   
├──📄 requirements.txt
├──📄 .gitmodules (important)
└──📄 .gitignore

4. Configuration

📄 /api/setup.py
config = Interphase("./types", d_ts=True) # base setup
📄 /api/__init__.py
from .setup import config as ts

5. API Reference

export types | interface
ts = Interphase("./types") 

# default is export enabled
ts.write('api', 'UserData', userData)
ts.write('api', 'UserData2', userData, export=False)

# default is type and interface can be enabled
ts.write('api', 'UserData3', userData, interface=True)
ts.write('api', 'UserData3', userData, export=False, interface=True)
export type UserData = {...}
type UserData2 = {...}

export interface UserData3 {...}
interface UserData3 {...}
base folder
# base directory can't be empty string
ts = Interphase("types") 
ts = Interphase("./types") 


# d.ts is defualt
# .ts can be enabled
ts = Interphase("./types", d_ts=False) 
ts.write('api', 'UserData', userData)
export type UserData = {...} // api.ts 
file name
# type name and file name can't be empty string
ts.write('api.ts', 'UserData', userData)
ts.write('api.d.ts', 'UserData', userData)


# d.ts is defualt
ts.write('api', 'UserData', userData)

7. FAQs

List and answer frequently asked questions users might have about your package.

8. Troubleshooting

Provide solutions to common issues users might encounter and how to resolve them.

9. Contributing

Encourage others to contribute to your project. Include guidelines for submitting bug reports, feature requests, and pull requests.

10. License

Specify the license under which your package is released.


Remember that your documentation should be clear, concise, and easy to follow. Use a consistent tone and style throughout, and consider using code snippets, diagrams, and examples to enhance understanding. Regularly update the documentation as your package evolves to ensure it remains accurate and helpful to your users.

Interphase

interface is not supported yet

defualt is export On default is type = need file name need type name need any data

base directory can be empty string d.ts is supported & it is defualt

dev

pip install --upgrade setuptools
pip install --upgrade build #python -m build
$ pip install -q build
$ python -m build

pyproject.toml https://setuptools.pypa.io/en/latest/userguide/pyproject_config.html

dist/
    meowpkg-0.0.1.whl
    meowpkg-0.0.1.tar.gz
$ pip install dist/meowpkg-0.0.1.whl
$ pip install dist/meowpkg-0.0.1.tar.gz

upload to pypi

$ python -m twine upload --repository pypi dist/*

.

Release files for interphase 0.0.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for interphase 0.0.6
File Size Uploaded
interphase-0.0.6.tar.gz 7.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for interphase 0.0.6
File Interpreter ABI Platform
interphase-0.0.6-py3-none-any.whl Python 3 none any Details

Total release size: 13.1 kB

Release files / interphase-0.0.6.tar.gz

Download URL interphase-0.0.6.tar.gz
Size 7.4 kB
Tags Source
SHA-256 checksum
How to use checksums
f13684f104591377489440efef5646e5db507fe56e0322cea6ed224c54c23d72
BLAKE2b-256 checksum
How to use checksums
70100d61eb948669fd4ace8233af93900d38b3a2cb2d97352e8e6f88efd43fcd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.13

Release files / interphase-0.0.6-py3-none-any.whl

Download URL interphase-0.0.6-py3-none-any.whl
Size 5.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8a827e37c090f5586c07966f8865f8a1949aecc7b98ef36c6267e518ee1fae59
BLAKE2b-256 checksum
How to use checksums
ad2d35b5c56308e1d75c19992efaca2816f35576b5041fc75654cf579361f262
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.13

Release history Release notifications | RSS feed

This release

0.0.6 This release

2 release files

0.0.5

2 release files

0.0.3

2 release files

0.0.2

1 release file

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page