Basic folder structure of the project is as follows:
.
├── backend # Django Backend
├── docs # Documentation
├── npm # NPM Files
├── pip # Pip Files
└── website # NextJs Website
cd backend # Change directory to backend
python3 -m venv .venv # Create virtual environment
source .venv/bin/activate # Activate virtual environment
pip install -r requirements.txt # Install requirements
python manage.py runserver # Run server
Open http://localhost:8000 with your browser to see the result.
docs
└── add-two-numbers # Tool Name in kebab-case
├── README.md # Tools Readme (How to Use)
├── test.js # JavaScript Use Case
├── test.py # Python Use Case
├── test.sh # API Use Case
└── test.ts # TypeScript Use Case
npm
├── jestconfig.json
├── package.json
├── README.md
├── src
│ ├── add-two-numbers # Tool Name in kebab-case
│ │ ├── index.ts # Tool Code
│ │ └── __test__
│ │ └── test.ts # Tool Test Code
│ └── index.ts # Tools Export(s)
├── tsconfig.json
├── tslint.json
└── yarn.lock
cd npm # Change directory to npm
yarn # Install dependencies
Note Keep Tool Function name in
PascalCase
and Tool File name inkebab-case
-
Add the
Tool Source Code
innpm └── src └── tool-name # Tool Name in kebab-case └── index.ts # Tool Source Code
-
Add the
Tools Test Code
innpm └── src └── tool-name # Tool Name in kebab-case └── __test__ └── test.ts # Tool Test Code
-
Add the
Tool Export
innpm ├── jestconfig.json ├── package.json ├── README.md └── src └── index.ts # Tools Export
... import ToolName from "./tool-name"; // Import Local Tool export { ..., ToolName, // Export NPM Tool };
-
Test Before
Commit
yarn run check
pip
├── codinasion_tools # PIP Package
│ ├── add_two_numbers.py # Tools Code / Tools Name in snake_case
│ └── __init__.py # Tools Export
├── PUBLISH.md
├── README.md
├── requirements.txt
├── setup.py
├── tests
│ └── test_add_two_numbers.py # Tool Test
└── tox.ini
cd pip # Change directory to pip
python3 -m venv .venv # Create virtual environment
source .venv/bin/activate # Activate virtual environment
pip install -r requirements.txt # Install requirements
Note Keep Tool Function name in
PascalCase
and Tool File name insnake_case
-
Add the
Tool Source Code
inpip └── codinasion_tools └── tool_name.py # Tools Code / Tools Name in snake_case
-
Add the
Tools Test Code
inpip └── tests └── test_tool_name.py # Tool Test
-
Add the
Tool Export
inpip └── codinasion_tools └── __init__.py # Tools Export
from .tool_name import ToolName
-
Test Before
Commit
tox
cd website # Change directory to website
yarn # Install dependencies
yarn dev # Run local server
Open http://localhost:3000 with your browser to see the result.