Skip to content

Commit

Permalink
Work on seeder (#4492)
Browse files Browse the repository at this point in the history
* Add

* Hmm

* Add

* Add

* Update pyproject.toml

* Add

* add

* add

* add

* Add

* Add

* Add

* Add

* Add

* Add

* Add

* Add

* ha

* Add

* Update server.py

* Update server.py

* Add

* Add

* add

* Add
  • Loading branch information
baseplate-admin authored Jan 26, 2025
1 parent fde4ee0 commit 6d7bb82
Show file tree
Hide file tree
Showing 115 changed files with 6,971 additions and 13,056 deletions.
6 changes: 0 additions & 6 deletions backend/django_core/apps/api/apps.py

This file was deleted.

9 changes: 0 additions & 9 deletions seeder/.editorconfig

This file was deleted.

2 changes: 2 additions & 0 deletions seeder/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Auto detect text files and perform LF normalization
* text=auto
16 changes: 16 additions & 0 deletions seeder/.github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file

version: 2
updates:
- package-ecosystem: 'npm'
directory: '/'
schedule:
interval: 'weekly'

- package-ecosystem: 'pip'
directory: '/'
schedule:
interval: 'weekly'
59 changes: 52 additions & 7 deletions seeder/.gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,54 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

# node
node_modules
dist-ssr
build
*.local

# sveltekit
dist-front
.svelte-kit

# poetry
.venv

# pyloid
venv-pyloid
__pycache__

# pyinstaller
dist
out
.DS_Store
*.log*
http_cache.sqlite
seeder.db
*.db-shm
*.db-wal

# npm
package-lock.json

# yarn
yarn.lock

# pnpm
pnpm-lock.yaml

# bun
bun-lock.yaml

# build.py handles that
*.spec
4 changes: 2 additions & 2 deletions seeder/.npmrc
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
electron_mirror=https://npmmirror.com/mirrors/electron/
electron_builder_binaries_mirror=https://npmmirror.com/mirrors/electron-builder-binaries/
engine-strict=true
legacy-peer-deps=true
8 changes: 3 additions & 5 deletions seeder/.prettierignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@

dist
# Package Managers
package-lock.json
pnpm-lock.yaml
LICENSE.md
tsconfig.json
tsconfig.*.json
yarn.lock
15 changes: 15 additions & 0 deletions seeder/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"singleQuote": true,
"trailingComma": "none",
"printWidth": 92,
"tabWidth": 4,
"plugins": ["prettier-plugin-svelte", "prettier-plugin-tailwindcss"],
"overrides": [
{
"files": "*.svelte",
"options": {
"parser": "svelte"
}
}
]
}
8 changes: 0 additions & 8 deletions seeder/.prettierrc.yaml

This file was deleted.

3 changes: 0 additions & 3 deletions seeder/.vscode/extensions.json

This file was deleted.

39 changes: 0 additions & 39 deletions seeder/.vscode/launch.json

This file was deleted.

11 changes: 0 additions & 11 deletions seeder/.vscode/settings.json

This file was deleted.

65 changes: 48 additions & 17 deletions seeder/README.md
Original file line number Diff line number Diff line change
@@ -1,34 +1,65 @@
# core-seeder-on-solid
# Pyloid-SvelteKit

An Electron application with Solid and TypeScript
Pyloid-SvelteKit-boilerplate is a template for projects combining a SvelteKit frontend with a Python backend. Here, we'll explain in detail the project setup, development, and build process.

## Recommended IDE Setup
### Prerequisites

- [VSCode](https://code.visualstudio.com/) + [ESLint](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint) + [Prettier](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode)
- [Prerequisites](https://docs.pyloid.com/getting-started/prerequisites)

## Project Setup
## 1. Project Initialization

### Install
Before starting the project, you need to install all necessary dependencies.

```bash
$ npm install
npm install # node
poetry install # python
```

### Development
These commands performs the following tasks:

1. Install npm packages
2. Create a Python virtual environment using poetry (.venv)
3. Install Python dependencies (based on pyproject.toml)

## 2. Running the Development Server

During development, you can run both frontend and backend servers simultaneously with the following command:

```bash
$ npm run dev
npm run dev # sveltekit
poetry run poe dev # pyloid
```

### Build
These commands performs the following tasks:

```bash
# For windows
$ npm run build:win
1. Run the SvelteKit frontend development server using Vite
2. Run the Python backend server (run.py)

# For macOS
$ npm run build:mac
The concurrently package is used to run both processes in parallel.

# For Linux
$ npm run build:linux
## 3. Building the Project

To build the project for production deployment, use the following command:

```bash
npm run build # sveltekit
poetry run poe build # pyloid
```

These commands performs the following tasks:

1. Frontend build using Vite
2. Package the Python backend into an executable using PyInstaller

### How PyInstaller Works

1. Dependency Analysis: PyInstaller analyzes the Python script and its dependencies.
2. File Collection: It collects all necessary Python modules, libraries, and data files.
3. Binary Generation: It packages the collected files into a single directory or a single executable file.

### Important Notes

- Cross-platform Builds: You need to perform the build for each platform on the respective operating system.
- Environment Variables: You may need to set environment variables appropriately depending on the production environment.

This guide should help you understand the process of initializing, developing, and building a project using the Pylon Boilerplate. Backend packaging with PyInstaller simplifies deployment and facilitates dependency management.
10 changes: 10 additions & 0 deletions seeder/build.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
from pyloid.builder import create_spec_from_json, build_from_spec, cleanup_before_build


def main():
spec_path = create_spec_from_json("build_config.json")
cleanup_before_build("build_config.json")
build_from_spec(spec_path)

if __name__ == "__main__":
main()
12 changes: 0 additions & 12 deletions seeder/build/entitlements.mac.plist

This file was deleted.

Binary file removed seeder/build/icon.icns
Binary file not shown.
Binary file removed seeder/build/icon.ico
Binary file not shown.
Binary file removed seeder/build/icon.png
Binary file not shown.
36 changes: 36 additions & 0 deletions seeder/build_config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"$schema": "https://raw.githubusercontent.com/pyloid/pyloid/refs/heads/main/src/pyloid/builder/build_config.schema.json",
"before_build": {
"cleanup_patterns": [
"PySide6/opengl32sw.dll",
"PySide6/translations/*.qm",
"PySide6/translations/qtwebengine_locales/*.pak",
"!PySide6/translations/qtwebengine_locales/en-US.pak"
]
},
"name": "pyloid-app",
"main_script": "run.py",
"datas": [
["src_pyloid/icons/", "src_pyloid/icons/"],
["dist-front/", "dist-front/"]
],
"excludes": [
"PySide6.QtQml",
"PySide6.QtTest",
"PySide6.Qt3D",
"PySide6.QtSensors",
"PySide6.QtCharts",
"PySide6.QtGraphs",
"PySide6.QtDataVisualization",
"PySide6.QtQuick",
"PySide6.QtDesigner",
"PySide6.QtUiTools",
"PySide6.QtHelp"
],
"icon": "src_pyloid/icons/icon.ico",
"bundle": {
"windows": "onefile",
"macos": "app",
"linux": "directory"
}
}
17 changes: 17 additions & 0 deletions seeder/components.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"$schema": "https://next.shadcn-svelte.com/schema.json",
"style": "default",
"tailwind": {
"config": "tailwind.config.ts",
"css": "src\\app.css",
"baseColor": "slate"
},
"aliases": {
"components": "$lib/components",
"utils": "$lib/utils",
"ui": "$lib/components/ui",
"hooks": "$lib/hooks"
},
"typescript": true,
"registry": "https://next.shadcn-svelte.com/registry"
}
3 changes: 0 additions & 3 deletions seeder/dev-app-update.yml

This file was deleted.

Loading

0 comments on commit 6d7bb82

Please sign in to comment.