Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
saashqdev committed Oct 31, 2024
1 parent f870b6f commit 5f0958b
Show file tree
Hide file tree
Showing 76 changed files with 343 additions and 424 deletions.
6 changes: 0 additions & 6 deletions CODEOWNERS

This file was deleted.

46 changes: 0 additions & 46 deletions CODE_OF_CONDUCT.md

This file was deleted.

33 changes: 2 additions & 31 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,6 @@
<div align="center">
<picture>
<source media="(prefers-color-scheme: dark)" srcset=".github/saashq-framework-logo-dark.svg">
<img src=".github/saashq-framework-logo.svg" height="50">
</picture>
<h3>
a web framework with <a href="https://www.youtube.com/watch?v=LOjk3m0wTwg">"batteries included"</a>
</h3>
<h5>
it's pronounced - <em>fra-pay</em>
</h5>
</div>

<div align="center">
<a target="_blank" href="#LICENSE" title="License: MIT"><img src="https://img.shields.io/badge/License-MIT-success.svg"></a>
<a target="_blank" href="https://www.python.org/downloads/" title="Python version"><img src="https://img.shields.io/badge/python-%3E=_3.10-success.svg"></a>
<a href="https://saashqframework.com/docs"><img src="https://img.shields.io/badge/docs-%F0%9F%93%96-success.svg"/></a>
<a href="https://github.com/saashq/saashq/actions/workflows/server-tests.yml"><img src="https://github.com/saashq/saashq/actions/workflows/server-tests.yml/badge.svg"></a>
<a href="https://github.com/saashq/saashq/actions/workflows/ui-tests.yml"><img src="https://github.com/saashq/saashq/actions/workflows/ui-tests.yml/badge.svg?branch=develop"></a>
<a href="https://codecov.io/gh/saashq/saashq"><img src="https://codecov.io/gh/saashq/saashq/branch/develop/graph/badge.svg?token=XoTa679hIj"/></a>
</div>


Full-stack web application framework that uses Python and MariaDB on the server side and a tightly integrated client side library. Built for [ERPNexus](https://erpnexus.com).

<div align="center" style="max-height: 40px;">
<a href="https://saashqcloud.com/saashq/signup"><img src=".github/try-on-f-cloud-button.svg" height="40"></a>
<a href="https://labs.play-with-docker.com/?stack=https://raw.githubusercontent.com/gavindsouza/install-scripts/main/saashq/pwd.yml"><img src="https://raw.githubusercontent.com/play-with-docker/stacks/master/assets/images/button.png" alt="Try in PWD" height="37"/></a>
</div>

> Login for the PWD site: (username: Administrator, password: admin)
Expand All @@ -40,11 +14,11 @@ Full-stack web application framework that uses Python and MariaDB on the server

### Production
* [Managed Hosting on Saashq Cloud](https://saashqcloud.com/)
* [Easy install script using Docker images](https://github.com/saashq/bench/tree/develop#easy-install-script)
* [Easy install script using Docker images](https://github.com/saashq/wrench/tree/develop#easy-install-script)
* [Manual install using Docker images](https://github.com/saashq/saashq_docker)

### Development
* [Easy install script using Docker images](https://github.com/saashq/bench/tree/develop#easy-install-script)
* [Easy install script using Docker images](https://github.com/saashq/wrench/tree/develop#easy-install-script)
* [Development installation on bare metal](https://saashqframework.com/docs/user/en/installation)


Expand All @@ -57,10 +31,7 @@ Full-stack web application framework that uses Python and MariaDB on the server
## Resources

1. [saashqframework.com](https://saashqframework.com) - Official documentation of the Saashq Framework.
1. [saashq.school](https://saashq.school) - Pick from the various courses by the maintainers or from the community.
1. [buildwithhussain.dev](https://buildwithhussain.dev) - Watch Saashq Framework being used in the wild to build world-class web apps.

## License
This repository has been released under the [MIT License](LICENSE).

By contributing to Saashq, you agree that your contributions will be licensed under its MIT License.
6 changes: 3 additions & 3 deletions esbuild/esbuild.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const {
log,
log_warn,
log_error,
bench_path,
wrench_path,
get_redis_subscriber,
} = require("./utils");

Expand Down Expand Up @@ -66,7 +66,7 @@ const argv = yargs
.option("using-cached", {
type: "boolean",
description:
"Skips build and uses cached build artifacts to update assets.json (used by Bench)",
"Skips build and uses cached build artifacts to update assets.json (used by Wrench)",
})
.example("node esbuild --apps saashq,erpnexus", "Run build only for saashq and erpnexus")
.example(
Expand Down Expand Up @@ -548,7 +548,7 @@ async function notify_redis({ error, success, changed_files }) {
kind: "error",
terminalWidth: 100,
});
let stack = error.stack.replace(new RegExp(bench_path, "g"), "");
let stack = error.stack.replace(new RegExp(wrench_path, "g"), "");
payload = {
error,
formatted,
Expand Down
18 changes: 9 additions & 9 deletions esbuild/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@ const fg = require("fast-glob");
const path = require("path");
const fs = require("fs");
const chalk = require("chalk");
let bench_path;
if (process.env.SAASHQ_BENCH_ROOT) {
bench_path = process.env.SAASHQ_BENCH_ROOT;
let wrench_path;
if (process.env.SAASHQ_WRENCH_ROOT) {
wrench_path = process.env.SAASHQ_WRENCH_ROOT;
} else {
const saashq_path = path.resolve(__dirname, "..");
bench_path = path.resolve(saashq_path, "..", "..");
wrench_path = path.resolve(saashq_path, "..", "..");
}

const apps_path = path.resolve(bench_path, "apps");
const sites_path = path.resolve(bench_path, "sites");
const apps_path = path.resolve(wrench_path, "apps");
const sites_path = path.resolve(wrench_path, "sites");
const assets_path = path.resolve(sites_path, "assets");
const app_list = get_apps_list();

Expand Down Expand Up @@ -90,7 +90,7 @@ function get_apps_list() {

function get_cloned_apps() {
/**
* Returns saashq apps in the bench/apps folder
* Returns saashq apps in the wrench/apps folder
*/
const apps = [];
for (const app of fs.readdirSync(apps_path)) {
Expand All @@ -103,7 +103,7 @@ function get_cloned_apps() {

function is_saashq_app(app_name, app_path) {
/**
* Same as the is_saashq_app check in saashq/bench
* Same as the is_saashq_app check in saashq/wrench
*/
if (!fs.lstatSync(app_path).isDirectory()) return false;

Expand Down Expand Up @@ -172,7 +172,7 @@ function get_redis_subscriber(kind) {

module.exports = {
app_list,
bench_path,
wrench_path,
assets_path,
sites_path,
apps_path,
Expand Down
20 changes: 10 additions & 10 deletions node_utils.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
const fs = require("fs");
const path = require("path");
const redis = require("@redis/client");
let bench_path;
if (process.env.SAASHQ_BENCH_ROOT) {
bench_path = process.env.SAASHQ_BENCH_ROOT;
let wrench_path;
if (process.env.SAASHQ_WRENCH_ROOT) {
wrench_path = process.env.SAASHQ_WRENCH_ROOT;
} else {
bench_path = path.resolve(__dirname, "..", "..");
wrench_path = path.resolve(__dirname, "..", "..");
}

const dns = require("dns");
Expand All @@ -21,19 +21,19 @@ function get_conf() {
};

var read_config = function (file_path) {
const full_path = path.resolve(bench_path, file_path);
const full_path = path.resolve(wrench_path, file_path);

if (fs.existsSync(full_path)) {
var bench_config = JSON.parse(fs.readFileSync(full_path));
for (var key in bench_config) {
if (bench_config[key]) {
conf[key] = bench_config[key];
var wrench_config = JSON.parse(fs.readFileSync(full_path));
for (var key in wrench_config) {
if (wrench_config[key]) {
conf[key] = wrench_config[key];
}
}
}
};

// get ports from bench/config.json
// get ports from wrench/config.json
read_config("config.json");
read_config("sites/common_site_config.json");

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ test = [
requires = ["flit_core >=3.4,<4"]
build-backend = "flit_core.buildapi"

[tool.bench.dev-dependencies]
[tool.wrench.dev-dependencies]
coverage = "~=6.5.0"
Faker = "~=18.10.1"
pyngrok = "~=6.0.0"
Expand Down
14 changes: 7 additions & 7 deletions saashq/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ def get_site_config(sites_path: str | None = None, site_path: str | None = None)
from saashq.utils import get_sites

all_sites = get_sites()
error_msg += "\n\nSites on this bench:\n"
error_msg += "\n\nSites on this wrench:\n"
error_msg += "\n".join(f"* {site}" for site in all_sites)

raise IncorrectSitePath(error_msg)
Expand Down Expand Up @@ -1599,11 +1599,11 @@ def get_all_apps(with_internal_apps=True, sites_path=None):


@request_cache
def get_installed_apps(*, _ensure_on_bench: bool = False) -> list[str]:
def get_installed_apps(*, _ensure_on_wrench: bool = False) -> list[str]:
"""
Get list of installed apps in current site.
:param _ensure_on_bench: Only return apps that are present on bench.
:param _ensure_on_wrench: Only return apps that are present on wrench.
"""
if getattr(flags, "in_install_db", True):
return []
Expand All @@ -1613,7 +1613,7 @@ def get_installed_apps(*, _ensure_on_bench: bool = False) -> list[str]:

installed = json.loads(db.get_global("installed_apps") or "[]")

if _ensure_on_bench:
if _ensure_on_wrench:
all_apps = cache.get_value("all_apps", get_all_apps)
installed = [app for app in installed if app in all_apps]

Expand Down Expand Up @@ -1642,7 +1642,7 @@ def _load_app_hooks(app_name: str | None = None):
import types

hooks = {}
apps = [app_name] if app_name else get_installed_apps(_ensure_on_bench=True)
apps = [app_name] if app_name else get_installed_apps(_ensure_on_wrench=True)

for app in apps:
try:
Expand Down Expand Up @@ -1711,7 +1711,7 @@ def setup_module_map(include_all_apps: bool = True) -> None:
"""
Function to rebuild map of all modules
:param: include_all_apps: Include all apps on bench, or just apps installed on the site.
:param: include_all_apps: Include all apps on wrench, or just apps installed on the site.
:return: Nothing
"""
if include_all_apps:
Expand All @@ -1724,7 +1724,7 @@ def setup_module_map(include_all_apps: bool = True) -> None:
if include_all_apps:
apps = get_all_apps(with_internal_apps=True)
else:
apps = get_installed_apps(_ensure_on_bench=True)
apps = get_installed_apps(_ensure_on_wrench=True)

for app in apps:
local.app_modules.setdefault(app, [])
Expand Down
4 changes: 2 additions & 2 deletions saashq/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ def setup_assets(assets_archive):
with tarfile.open(assets_archive) as tar:
for file in tar:
if not file.isdir():
dest = "." + file.name.replace("./saashq-bench/sites", "")
dest = "." + file.name.replace("./saashq-wrench/sites", "")
asset_directory = os.path.dirname(dest)
show = dest.replace("./assets/", "")

Expand Down Expand Up @@ -153,7 +153,7 @@ def download_saashq_assets(verbose=True) -> bool:
click.secho(str(e), fg="yellow")

except Exception as e:
# TODO: log traceback in bench.log
# TODO: log traceback in wrench.log
click.secho(str(e), fg="red")

finally:
Expand Down
4 changes: 2 additions & 2 deletions saashq/cache_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def get_doctype_map_key(doctype):

doctype_map_keys = tuple(map(get_doctype_map_key, doctypes_for_mapping))

bench_cache_keys = ("assets_json",)
wrench_cache_keys = ("assets_json",)

global_cache_keys = (
"app_hooks",
Expand Down Expand Up @@ -104,7 +104,7 @@ def clear_global_cache():

clear_doctype_cache()
clear_website_cache()
saashq.cache.delete_value(global_cache_keys + bench_cache_keys)
saashq.cache.delete_value(global_cache_keys + wrench_cache_keys)
saashq.setup_module_map()


Expand Down
6 changes: 3 additions & 3 deletions saashq/change_log/v13/v13_3_0.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
### Features & Enhancements

- Deletion Steps in Data Deletion Tool ([#13124](https://github.com/saashq/saashq/pull/13124))
- Format Option for list-apps in bench CLI ([#13125](https://github.com/saashq/saashq/pull/13125))
- Format Option for list-apps in wrench CLI ([#13125](https://github.com/saashq/saashq/pull/13125))
- Add password fieldtype option for Web Form ([#13093](https://github.com/saashq/saashq/pull/13093))
- Add simple __repr__ for DocTypes ([#13151](https://github.com/saashq/saashq/pull/13151))
- Switch theme with left/right keys ([#13077](https://github.com/saashq/saashq/pull/13077))
Expand All @@ -20,7 +20,7 @@
- Show delete button on portal if user has permission to delete document ([#13149](https://github.com/saashq/saashq/pull/13149))
- Dont disable dialog scroll on focusing a Link/Autocomplete field ([#13119](https://github.com/saashq/saashq/pull/13119))
- Typo in RecorderDetail.vue ([#13086](https://github.com/saashq/saashq/pull/13086))
- Error for bench drop-site. Added missing import. ([#13064](https://github.com/saashq/saashq/pull/13064))
- Error for wrench drop-site. Added missing import. ([#13064](https://github.com/saashq/saashq/pull/13064))
- Report column context ([#13090](https://github.com/saashq/saashq/pull/13090))
- Different service name for push and pull request events ([#13094](https://github.com/saashq/saashq/pull/13094))
- Moving Site folder across different FileSystems failed ([#13033](https://github.com/saashq/saashq/pull/13033))
Expand All @@ -33,7 +33,7 @@
- Don't evaluate dynamic properties to check if conflicts exist ([#13186](https://github.com/saashq/saashq/pull/13186))
- Add __ function in vue global for translation in recorder ([#13089](https://github.com/saashq/saashq/pull/13089))
- Make strings translatable ([#13076](https://github.com/saashq/saashq/pull/13076))
- Show config in bench CLI ([#13128](https://github.com/saashq/saashq/pull/13128))
- Show config in wrench CLI ([#13128](https://github.com/saashq/saashq/pull/13128))
- Add breadcrumbs for list view ([#13091](https://github.com/saashq/saashq/pull/13091))
- Do not skip data in save while using shortcut ([#13182](https://github.com/saashq/saashq/pull/13182))
- Use docfields from options if no docfields are returned from meta ([#13188](https://github.com/saashq/saashq/pull/13188))
Expand Down
4 changes: 2 additions & 2 deletions saashq/commands/redis_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@ def create_rq_users(set_admin_password=False, use_rq_auth=False):
common_site_config_path = os.path.join(sites_path, "common_site_config.json")
update_site_config(
"rq_username",
user_credentials["bench"][0],
user_credentials["wrench"][0],
validate=False,
site_config_path=common_site_config_path,
)
update_site_config(
"rq_password",
user_credentials["bench"][1],
user_credentials["wrench"][1],
validate=False,
site_config_path=common_site_config_path,
)
Expand Down
Loading

0 comments on commit 5f0958b

Please sign in to comment.