Skip to content

Commit 4a3cd21

Browse files
committed
kick-off 🚀
0 parents  commit 4a3cd21

33 files changed

Lines changed: 3059 additions & 0 deletions

.editorconfig

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
root = true
2+
3+
[*.{js,ts,mts}]
4+
indent_size = 2

.gitignore

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
pids
2+
logs
3+
node_modules
4+
npm-debug.log
5+
coverage/
6+
run
7+
dist
8+
.DS_Store
9+
.nyc_output
10+
.basement
11+
config.local.js
12+
basement_dist
13+
cache
14+
.idea

.npmignore

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
pids
2+
logs
3+
node_modules
4+
npm-debug.log
5+
coverage/
6+
run
7+
dist
8+
.DS_Store
9+
.nyc_output
10+
.basement
11+
config.local.js
12+
basement_dist

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
16

docs/.vitepress/config.mts

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
import {defineConfig} from 'vitepress'
2+
import fetch from "node-fetch";
3+
4+
let version = 'beta';
5+
let changelog = '';
6+
await fetch('https://api.github.com/repos/tweakphp/tweakphp/releases/latest')
7+
.then(response => response.json()).then((data: any) => {
8+
version = data.tag_name;
9+
changelog = data.html_url;
10+
});
11+
12+
// https://vitepress.dev/reference/site-config
13+
export default defineConfig({
14+
base: '/',
15+
title: "TweakPHP",
16+
description: "Easily tweak your PHP code",
17+
head: [
18+
// [
19+
// 'script',
20+
// {
21+
// src: 'https://www.googletagmanager.com/gtag/js?id=G-9N4ER7K7M6',
22+
// },
23+
// ],
24+
// [
25+
// 'script',
26+
// {},
27+
// "window.dataLayer = window.dataLayer || [];\nfunction gtag(){dataLayer.push(arguments);}\ngtag('js', new Date());\ngtag('config', 'G-9N4ER7K7M6');",
28+
// ]
29+
],
30+
themeConfig: {
31+
logo: "/icon.png",
32+
33+
nav: [
34+
{
35+
text: 'Docs',
36+
items: [
37+
{text: 'Get Started', link: '/getting-started/introduction'},
38+
{text: 'Installation', link: '/getting-started/installation'},
39+
]
40+
},
41+
{
42+
text: version,
43+
items: [
44+
{text: 'Changelog', link: changelog},
45+
{text: 'Contribute', link: '/prologue/contribution-guide'},
46+
]
47+
}
48+
],
49+
50+
// search: {
51+
// provider: 'algolia',
52+
// options: {
53+
// appId: '',
54+
// apiKey: '',
55+
// indexName: '',
56+
// }
57+
// },
58+
59+
sidebar: [
60+
{
61+
text: 'Prologue',
62+
items: [
63+
{text: 'Contribution Guide', link: '/prologue/contribution-guide'}
64+
]
65+
},
66+
{
67+
text: 'Getting Started',
68+
items: [
69+
{text: 'Introduction', link: '/getting-started/introduction'},
70+
{text: 'Installation', link: '/getting-started/installation'},
71+
{text: 'Settings', link: '/getting-started/settings'},
72+
]
73+
},
74+
{text: 'Start Tweaking', link: '/start'},
75+
{text: 'Docker', link: '/docker'},
76+
{text: 'SSH', link: '/ssh'},
77+
{text: 'Client Library', link: '/client'},
78+
],
79+
socialLinks: [
80+
{icon: 'github', link: 'https://github.com/tweakphp/tweakphp'},
81+
{icon: 'discord', link: 'https://discord.gg/Et3UTT4xwC'},
82+
{icon: 'twitter', link: 'https://twitter.com/saeed_vz'},
83+
{icon: 'youtube', link: 'https://www.youtube.com/@saeedvaziry'},
84+
],
85+
footer: {
86+
message: 'Made with ❤️',
87+
copyright: 'Copyright © 2024-present Saeed Vaziry'
88+
}
89+
}
90+
})

docs/.vitepress/theme/index.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// https://vitepress.dev/guide/custom-theme
2+
import {h} from 'vue'
3+
import Theme from 'vitepress/theme'
4+
import './style.css'
5+
6+
export default {
7+
extends: Theme,
8+
Layout: () => {
9+
return h(Theme.Layout, null, {
10+
// https://vitepress.dev/guide/extending-default-theme#layout-slots
11+
})
12+
},
13+
enhanceApp({app, router, siteData}) {
14+
// app.component('Component', Component)
15+
},
16+
}

docs/.vitepress/theme/style.css

Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
:root {
2+
--vp-c-brand-1: #be185d;
3+
--vp-c-brand-2: #db2777;
4+
--vp-c-brand-3: #ec4899;
5+
--vp-c-brand-4: #831843;
6+
--vp-home-hero-name-color: transparent;
7+
--vp-home-hero-name-background: -webkit-linear-gradient(
8+
120deg,
9+
var(--vp-c-brand-1) 30%,
10+
#ec4899
11+
);
12+
13+
--vp-home-hero-image-background-image: linear-gradient(
14+
-45deg,
15+
#be185d 50%,
16+
#df77fc 50%
17+
);
18+
--vp-home-hero-image-filter: blur(40px);
19+
20+
--vp-custom-block-warning-bg: transparent;
21+
--vp-custom-block-warning-border: #eab308;
22+
--vp-custom-block-warning-color: #eab308;
23+
24+
--vp-custom-block-info-bg: transparent;
25+
--vp-custom-block-info-border:#6397f1;
26+
--vp-custom-block-info-color:#6399f1;
27+
28+
--vp-custom-block-success-bg: transparent;
29+
--vp-custom-block-success-border: #10b981;
30+
--vp-custom-block-success-color: #10b981;
31+
32+
--vp-custom-block-danger-bg: transparent;
33+
--vp-custom-block-danger-border: #ef4444;
34+
--vp-custom-block-danger-color: #ef4444;
35+
}
36+
37+
.warning .custom-block-title {
38+
color: var(--vp-custom-block-warning-color);
39+
}
40+
41+
.info .custom-block-title {
42+
color: var(--vp-custom-block-info-color);
43+
}
44+
45+
.success .custom-block-title {
46+
color: var(--vp-custom-block-success-color);
47+
}
48+
49+
.danger .custom-block-title {
50+
color: var(--vp-custom-block-danger-color);
51+
}
52+
53+
.image-container {
54+
max-width: 650px !important;
55+
}
56+
57+
.image-bg {
58+
content: "";
59+
position: absolute;
60+
background: linear-gradient(
61+
60deg,
62+
#f79533,
63+
#f37055,
64+
#ef4e7b,
65+
#a166ab,
66+
#5073b8,
67+
#1098ad,
68+
#07b39b,
69+
#6fba82
70+
) !important;
71+
animation: animatedgradient 3s ease alternate infinite !important;
72+
background-size: 500% 500% !important;
73+
}
74+
75+
.image-src {
76+
max-width: 560px !important;
77+
}
78+
79+
@keyframes animatedgradient {
80+
0% {
81+
background-position: 0% 50%;
82+
}
83+
50% {
84+
background-position: 100% 50%;
85+
}
86+
100% {
87+
background-position: 0% 50%;
88+
}
89+
}
90+
91+
.VPHome .main .text {
92+
font-size: 30px;
93+
}
94+
95+
@media (max-width: 768px) {
96+
.VPHome .main .text {
97+
font-size: 20px;
98+
}
99+
}
100+
101+
.VPImage.logo {
102+
border-radius: 5px;
103+
}
104+
105+
.VPHero .VPImage {
106+
border-radius: 10px;
107+
border: 1px solid #eaeaea;
108+
}
109+
110+
.dark .VPHero .VPImage {
111+
border: 1px solid rgb(68, 68, 68);
112+
}
113+
114+
.VPButton.primary {
115+
background: var(--vp-c-brand-1);
116+
color: white;
117+
border: none;
118+
padding: 5px 10px;
119+
border-radius: 15px;
120+
cursor: pointer;
121+
transition: all 0.3s;
122+
}

docs/client.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Client Library
2+
3+
- [Introduction](#introduction)
4+
- [Bundle](#bundle)
5+
- [Loaders](#loaders)
6+
7+
## Introduction
8+
9+
TweakPHP uses its own client library written in PHP to load your PHP project and run code inside it. The library is availble on [Github](https://github.com/tweakphp/client).
10+
11+
## Bundle
12+
13+
Since TweakPHP supports any projects having PHP >= `7.4`, The library needs to be available on those PHP versions as well.
14+
15+
TweakPHP uses the [Box Project](https://github.com/box-project/box) to bundle the library into executable `phar` file. Therefore, We run the bundle on every PHP >= `7.4` and store it like `client-8.0.phar`.
16+
17+
These `phar` files will be also transfered to the app's project to be available on the installed machine.
18+
19+
## Loaders
20+
21+
The client library uses different loaders to load your project and bootstrap the app.
22+
23+
Here are the list of the supported loaders:
24+
25+
- Laravel
26+
- Symfony
27+
- Wordpress
28+
- Any composer project out of the box
29+
- More loaders will come soon

docs/docker.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Docker
2+
3+
- [Introduction](#introduction)
4+
- [Connect to Docker](#connect-to-docker)
5+
- [Run Code](#run-code)
6+
- [How it works?](#how-it-works)
7+
8+
## Introduction
9+
10+
TweakPHP enables you to run code inside docker containers.
11+
12+
## Connect to Docker
13+
14+
After you opened a project, You can click on the docker icon at top toolbar and hit the connect item. Then a modal will apear to connect to any container you want.
15+
16+
Select the container and specify the working directory and hit the `connect` button.
17+
18+
::: warning
19+
Make sure the docker service is running on your machine first
20+
:::
21+
22+
## Run Code
23+
24+
Just like running code on the [Local](./start.md#run-code) mode, You can run the code on docker as well.
25+
26+
## How it works?
27+
28+
Everytime you connect to a docker container, TweakPHP detects the PHP version installed and then copies the bundled client file (`.phar`) into the container and then runs the code.
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# Installation
2+
3+
- [MacOS](#macos)
4+
- [Linux](#linux)
5+
- [Snap](#snap)
6+
- [AppImage](#appimage)
7+
- [Deb Package](#deb-package)
8+
- [Windows](#windows)
9+
10+
## MacOS
11+
12+
TweakPHP is available for MacOS (Apple Chip & Intel) in `zip` and `dmg` to download and install.
13+
14+
To install TweakPHP on MacOS, Simply download the app from the [Github Releases](https://github.com/tweakphp/tweakphp/releases) and move the file into the Applications folder.
15+
16+
::: info
17+
Since TweakPHP is in beta and haven't been signed, You need to allow the app to be opened in the Privacy & Security.
18+
19+
Open the app and then navigate to `System Settings` > `Privacy & Security` and scroll down and find TweakPHP and click on `Open Anyway`
20+
:::
21+
22+
## Linux
23+
24+
There are multiple ways to install TweakPHP on a Linux machine.
25+
26+
### Snap
27+
28+
To install from Snapcraft, simply run the following command:
29+
30+
```bash
31+
sudo snap install tweakphp
32+
```
33+
34+
::: info
35+
TweakPHP is only available for `amd64` based CPUs on Snapcraft
36+
:::
37+
38+
### AppImage
39+
40+
The AppImage build can work on any Linux distro and is available for `x64` and `arm64`
41+
42+
Download the AppImage from the [Github Releases](https://github.com/tweakphp/tweakphp/releases) and make the app executable `chmod +x TweakPHP-x.x.x.AppImage`
43+
44+
### Deb Package
45+
46+
TweakPHP is also available as `.deb` package for `x64` only and you can download it from the [Github Releases](https://github.com/tweakphp/tweakphp/releases)
47+
48+
49+
## Windows
50+
51+
We're working on the Windows build and we already have a [PR](https://github.com/tweakphp/tweakphp/pull/64) open 🤞

0 commit comments

Comments
 (0)