Skip to content

Commit

Permalink
merge main to main-ru
Browse files Browse the repository at this point in the history
  • Loading branch information
artemsites committed Jun 23, 2024
1 parent 74dcf3c commit bd946d5
Show file tree
Hide file tree
Showing 13 changed files with 89 additions and 40 deletions.
Binary file added .docs/readme/image-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .docs/readme/image-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .docs/readme/image-3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .docs/readme/image-4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .docs/readme/image-5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .docs/readme/image-6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .docs/readme/image-7.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .docs/readme/image-8.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .docs/readme/image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
.env



###> symfony/framework-bundle ###
/.env.local
/.env.local.php
Expand Down
4 changes: 2 additions & 2 deletions .google-scripts/config.gs
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
var host = 'https://some-site.com';
secretToken = '9832yc983c0923yv3y#%r9N83983YR93285-3N89C532984CYN&#%rTC379872C';
var host = 'https://some-site.com/';
secretToken = 'some_your_strong_authorized_token';
89 changes: 51 additions & 38 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# CMS Sheets - a site management system based on Symfony and Google Tables

---


---



# Installation

Expand All @@ -11,84 +15,93 @@ git clone [email protected]:artemsites/cms-sheets.git

## Copy and rename
```
.env.example -> .env
.env.example -> .env
```

## Set connection MySQL in .env
```
DATABASE_URL="mysql://username:[email protected]:3306/dbname"
DATABASE_URL="mysql://username:[email protected]:3306/dbname"
```
With mysql version:
```
DATABASE_URL="mysql://username:[email protected]:3306/dbname?serverVersion=5.7.21"
DATABASE_URL="mysql://username:[email protected]:3306/dbname?serverVersion=5.7.21"
```

## Upload code to your server
One level higher than your public folder for the site!
## Copy Google Table (Sheet) to your drive
https://docs.google.com/spreadsheets/d/19NC3QrrWEvAwljyhzKF9LqCds4gtOvP5OAZUqqd3k-w/edit?usp=sharing

## Create link to public
If the root folder on your server is set to public_html:
## Migration tables to your database
```
ln -s public public_html
php bin/console doctrine:migrations:migrate
```
It is migrate file migrations/Version[id].php to your database!

## Update vendor libs
```
composer update
## Change Key and Domain in Google Table
![alt text](.docs/readme/image.png)
![alt text](.docs/readme/image-1.png)
> Внимание! Если у вас на сайте ещё нет https то необходимо в ссылке заменить https на http!
## And set this key to .env file
![alt text](.docs/readme/image-2.png)

## Compress code to ZIP and upload to server (for example to shared hosting)
![alt text](.docs/readme/image-3.png)
![alt text](.docs/readme/image-4.png)
![alt text](.docs/readme/image-5.png)

## Setting HTTPS and redirect to it and setting last PHP version at you site in hosting panel or you server!

# if shared hosting & composer installed to ~/.local/bin/composer
## Update composer vendors (libs)
For example at shared hosting (beget.com):
```
php8.3 $(which ~/.local/bin/composer) update
```
![alt text](.docs/readme/image-6.png)

## Then create first page at google table!
![alt text](.docs/readme/image-7.png)

## And upload this content to site!
1. Select the line (web page data) that you want to send to the site.
2-3. Send the changes to the website!
![alt text](.docs/readme/image-8.png)

## Create migration Entities (src/Entity) to your db (with mysql connect)
```
php bin/console make:migration
php bin/console doctrine:migrations:migrate
After that, the cache of this page will be reset and the updated content will be displayed on the site!

In this case, the content can be written directly to the content column, so you can place a link to html or md markup there so as not to clutter the table cell!

# if shared hosting
php8.3 bin/console make:migration
php8.3 bin/console doctrine:migrations:migrate
```


---

## Create site files in Google Drive:
1 Create site folder for site files in Google Drive
somesite.com
2 Download file "Pages & Menu"
https://docs.google.com/spreadsheets/d/19NC3QrrWEvAwljyhzKF9LqCds4gtOvP5OAZUqqd3k-w
3 Create in Google Drive:
somesite.com/Pages & Menu
4 Add key to:
1 Расширения -> Apps Script -> config.gs (and domain)
2 .env -> APP_GOOGLE_APP_SCRIPTS_TOKEN


# Features

---
## Fill in the content as HTML or MD
## Insert shortcodes like [[youtube id="7c238trc"]] into the content (HTML or MD)



# Features
---

## Fill in the content as HTML or MD
## Insert shortcodes like [[youtube id="7c238trc"]] into the content (HTML or MD)

---

# Configuration

## Vue the type of interpolation brackets is specified in .env:
## Vue the type of interpolation brackets is specified in .env:
SHORTCODE_START_REGEXP
SHORTCODE_END_REGEXP
> It shouldn't be {{ }} - it's twig
> It shouldn't be [ ] - this is md content
> Probably better [[ ]]
> ! It is important to specify in REGEXP format, that is, special characters should be escaped \[\[ - otherwise they will be incorrectly read in REGEXP and will not be used
---


---



# Shortcodes

Expand Down
35 changes: 35 additions & 0 deletions migrations/Version20240601155844.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?php

declare(strict_types=1);

namespace DoctrineMigrations;

use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;

/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20240601155844 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}

public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE TABLE menu (id INT AUTO_INCREMENT NOT NULL, id_cms BIGINT NOT NULL, url VARCHAR(255) NOT NULL, name VARCHAR(255) NOT NULL, type SMALLINT DEFAULT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE page (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(255) NOT NULL, title LONGTEXT NOT NULL, description LONGTEXT NOT NULL, content LONGTEXT NOT NULL, id_cms BIGINT NOT NULL, created_at DATETIME DEFAULT NULL, updated_at DATETIME DEFAULT NULL, url VARCHAR(255) NOT NULL, template VARCHAR(255) DEFAULT NULL, off VARCHAR(255) DEFAULT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE messenger_messages (id BIGINT AUTO_INCREMENT NOT NULL, body LONGTEXT NOT NULL, headers LONGTEXT NOT NULL, queue_name VARCHAR(190) NOT NULL, created_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', available_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', delivered_at DATETIME DEFAULT NULL COMMENT \'(DC2Type:datetime_immutable)\', INDEX IDX_75EA56E0FB7336F0 (queue_name), INDEX IDX_75EA56E0E3BD61CE (available_at), INDEX IDX_75EA56E016BA31DB (delivered_at), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
}

public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('DROP TABLE menu');
$this->addSql('DROP TABLE page');
$this->addSql('DROP TABLE messenger_messages');
}
}

0 comments on commit bd946d5

Please sign in to comment.