Skip to content

Commit bddca94

Browse files
committed
better get started instructions
1 parent 1a84291 commit bddca94

File tree

4 files changed

+135
-5
lines changed

4 files changed

+135
-5
lines changed

examples/official-site/get_started.sql

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,12 @@ SELECT 'list' as component,
1515
'Are you comfortable with command line applications ?' as title;
1616

1717
SELECT 'Yes, I can use the terminal' as title,
18-
'?cli=1' as link,
19-
'I can type commands in a terminal and have used the command line before.' as description,
20-
'blue' as color,
21-
'plus' as icon;
18+
'manual_setup.sql' as link,
19+
'I can type commands in a terminal and have used the command line before. I want the technical instructions.' as description,
20+
'black' as color,
21+
'prompt' as icon;
22+
SELECT 'No, I want to do it the easy way' as title,
23+
'hosted.sql' as link,
24+
'I don''t want to have anything to do with scary hacker things. I will pay a monthly fee, and never have to configure a server myself.' as description,
25+
'green' as color,
26+
'mood-happy' as icon;

examples/official-site/hosted.sql

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
select 'shell' as component,
2+
'SQLPage: get started!' as title,
3+
'database' as icon,
4+
'/' as link,
5+
'en-US' as lang,
6+
'Hosted SQLPage: set-up a SQLPage website in three clicks.' as description,
7+
'documentation' as menu_item,
8+
'Poppins' as font;
9+
10+
SELECT 'hero' as component,
11+
'Hosted SQLPage' as title,
12+
'Work In Progress: We are working on a cloud version of SQLPage
13+
that will enable you to effortlessly set up your website online without the need to download any software or configure your own server.' as description,
14+
'https://upload.wikimedia.org/wikipedia/commons/thumb/9/94/Baustelle_H%C3%B6lzla_6066312.jpg/1024px-Baustelle_H%C3%B6lzla_6066312.jpg' as image,
15+
'https://forms.gle/z1qmuCwdNT5Am7gp6' as link,
16+
'Get notified when we are ready' as link_text;

examples/official-site/index.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ SELECT 'hero' as component,
1313
'SQLPage' as title,
1414
'Open-source low-code web application framework. Write full websites using only simple database queries.' as description,
1515
'Lac_de_Zoug.jpg' as image,
16-
'/documentation.sql' as link,
16+
'/get_started.sql' as link,
1717
'Get started !' as link_text;
1818
-- the mantra: fast, beautiful, easy
1919
SELECT 'Fast' as title,
Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
select 'shell' as component,
2+
'SQLPage Manual Setup' as title,
3+
'database' as icon,
4+
'/' as link,
5+
'en-US' as lang,
6+
'SQLPage technical introduction' as description,
7+
'documentation' as menu_item,
8+
'Poppins' as font;
9+
10+
SELECT 'hero' as component,
11+
'SQLPage setup' as title,
12+
'Let''s create your first SQLPage website together, step by step, from downloading SQLPage to making your site available online for everyone to browse.' as description,
13+
'https://upload.wikimedia.org/wikipedia/commons/thumb/c/c4/Backlit_keyboard.jpg/1024px-Backlit_keyboard.jpg' as image,
14+
'mailto:[email protected]' as link,
15+
'Instructions unclear ? Get in touch !' as link_text;
16+
17+
18+
SELECT 'text' as component,
19+
'Download SQLPage' as title;
20+
SELECT 'Download the latest SQLPage' as contents, 'https://github.com/lovasoa/SQLpage/releases' as link;
21+
SELECT ' for your operating system.
22+
SQLPage is distributed as a single executable file, making it easy to get started.' as contents;
23+
24+
SELECT 'text' as component, 'Launch your development server' as title;
25+
SELECT 'Create a folder on your computer where you will store your website.
26+
Then launch the ' as contents;
27+
SELECT 'sqlpage' as contents, TRUE as code;
28+
SELECT ' executable file you just downloaded in a terminal from this folder.' as contents;
29+
SELECT 'text' as component,
30+
'You should see a message in your terminal that includes the sentence ' as contents;
31+
SELECT 'Starting server on 0.0.0.0:8080' as contents, TRUE as code;
32+
SELECT '. This means that sqlpage is running successfully. '
33+
SELECT 'text' as component, 'You can open your website locally by visiting ' as contents;
34+
SELECT 'http://localhost:8080' as contents, TRUE as code, 'http://localhost:8080' as link;
35+
36+
SELECT 'text' as component,
37+
'Your website''s first SQL file' as title;
38+
SELECT 'In the root folder of your SQLPage website, create a new SQL file called "index.sql".' as contents;
39+
SELECT 'text' as component, 'Open the "index.sql" file in a text editor.' as contents;
40+
SELECT 'text' as component, 'Write your SQL code in the "index.sql" file to retrieve data from your database and define how it should be displayed on your website.' as contents;
41+
SELECT 'text' as component, 'For example, you can start with a simple SQL code that displays a list of popular websites from your "website" table. Here''s an example:' as contents;
42+
SELECT 'text' as component;
43+
SELECT 'SELECT
44+
''list'' AS component,
45+
''Popular websites'' AS title;' as contents, TRUE as code;
46+
SELECT 'text' as component;
47+
SELECT '
48+
SELECT
49+
''Hello'' AS title,
50+
''world'' description,
51+
''https://wikipedia.org'' AS link;' as contents, TRUE as code;
52+
53+
SELECT 'text' as component, 'The list of components you can use and their properties is available in ' as contents;
54+
select 'SQLPage''s online documentation' as contents, 'https://sql.ophir.dev/documentation.sql' as link;
55+
SELECT '.' as contents;
56+
57+
SELECT 'text' as component, 'Your database schema' as title;
58+
59+
SELECT 'The database schema for your SQLPage website is defined using SQL scripts located in the "sqlpage/migrations" subdirectory of your website''s root folder.
60+
Each script represents a migration that sets up
61+
or modifies the database structure.
62+
The scripts are executed in alphabetical order, so you can prefix them with a number to control the order in which they are executed.' as contents;
63+
SELECT 'text' as component, 'For example, you can create a file called "0001_create_website_table.sql" with the following contents:' as contents;
64+
SELECT 'text' as component;
65+
SELECT 'CREATE TABLE users (
66+
id INTEGER PRIMARY KEY,
67+
name TEXT NOT NULL
68+
);' as contents, TRUE as code;
69+
70+
SELECT 'text' as component, 'Connect to a custom database' as title;
71+
SELECT 'By default, SQLPage uses a SQLite database stored in a file named "sqlpage.db" in your website''s root folder.
72+
You can change this by creating a file named "sqlpage/config.json" in your website''s root folder with the following contents:' as contents;
73+
SELECT 'text' as component;
74+
SELECT '{
75+
"database_url": "postgres://user:password@localhost:5432/database"
76+
}' as contents, TRUE as code;
77+
SELECT 'text' as component, 'For more information about the properties that can be set in config.json, see ' as contents;
78+
SELECT 'SQLPage''s configuration documentation' as contents, 'https://github.com/lovasoa/SQLpage/blob/main/configuration.md#configuring-sqlpage' as link;
79+
80+
SELECT 'text' as component,
81+
'Deploy your SQLPage website online' as title;
82+
SELECT 'If you want to make your SQLPage website accessible online for everyone to browse, you can deploy it to a VPS (Virtual Private Server). ' as contents;
83+
SELECT 'To get started, sign up for a VPS provider of your choice. Some popular options include: AWS EC2, DigitalOcean, Linode, Hetzner. ' as contents;
84+
SELECT 'text' as component, 'Once you have signed up with a VPS provider, create a new VPS instance. The steps may vary depending on the provider, but generally, you will need to:' as contents;
85+
SELECT 'text' as component, '1. Choose the appropriate server type and specifications. SQLPage uses very few resources, so you should be fine with the cheaper options.' as contents;
86+
SELECT 'text' as component, '2. Set up SSH access.' as contents;
87+
SELECT 'text' as component;
88+
SELECT 'Once your VPS instance is up and running, you can connect to it using SSH. The provider should provide you with the necessary instructions on how to connect via SSH.' as contents;
89+
SELECT 'text' as component,
90+
'For example, if you are using a Linux or macOS terminal, you can use the following command:' as contents;
91+
SELECT 'text' as component;
92+
SELECT 'ssh username@your-vps-ip-address' as contents, TRUE as code;
93+
SELECT 'title' as component,
94+
'Transfer your SQLPage website files to the VPS' as contents, 3 as level;
95+
SELECT 'You need to transfer your SQLPage website files from your local computer to the VPS. There are several ways to achieve this, including using SCP (Secure Copy) or SFTP (SSH File Transfer Protocol).' as contents;
96+
SELECT 'text' as component,
97+
'For example, if you are using SCP, you can run the following command from your local computer, replacing the placeholders with your own information:' as contents;
98+
SELECT 'text' as component;
99+
SELECT 'scp -r /path/to/your/sqlpage/folder username@your-vps-ip-address:/path/to/destination' as contents,
100+
TRUE as code;
101+
102+
SELECT 'title' as component, 'Run sqlpage on the server' as contents, 3 as level;
103+
SELECT 'text' as component, 'Once your SQLPage website files are on the server, you can run sqlpage on the server, just like you did on your local computer.
104+
Download the sqlpage for linux binary and upload it to your server. ' as contents;
105+
SELECT 'text' as component, 'Then, run the following command on your server:' as contents;
106+
SELECT 'text' as component;
107+
SELECT './sqlpage' as contents, TRUE as code;
108+
SELECT 'text' as component,
109+
'To access your website, enter the adress of your VPS in your adress bar, followed by the port on which sqlpage runs. For instance: http://123.123.123.123:8080.' as contents;

0 commit comments

Comments
 (0)