rshop / app
RSHOP skeleton app
Requires
- cakephp/cakephp: ~3.6
- cakephp/plugin-installer: ~1.0
- josegonzalez/dotenv: 2.*
- mobiledetect/mobiledetectlib: 2.*
- rshop/admin: dev-p-new-cart-decimal as 3.x-dev
- rshop/frontend: dev-p-new-cart-decimal as 3.x-dev
Requires (Dev)
- dev-master
- v2.0.0
- v1.9.2
- v1.9.1
- v1.9.0
- v1.8.1
- v1.8.0
- v1.7.0
- v1.6.2
- v1.6.1
- v1.6.0
- v1.5.1
- v1.5.0
- v1.4.0
- v1.3.0
- v1.2.2
- v1.2.1
- v1.2.0
- v1.1.9
- v1.1.8
- v1.1.7
- v1.1.6
- v1.1.5
- v1.1.4
- v1.1.3
- v1.1.2
- v1.1.1
- v1.1.0
- v1.0.17
- v1.0.16
- v1.0.15
- v1.0.14
- v1.0.13
- v1.0.12
- v1.0.11
- v1.0.10
- v1.0.9
- v1.0.8
- v1.0.7
- v1.0.6
- v1.0.5
- v1.0.4
- v1.0.3
- v1.0.2
- v1.0.1
- v1.0.0
- dev-RSHOP-882
- dev-app-2.0.0
- dev-2025-07-07
- dev-RSHOP-825
This package is auto-updated.
Last update: 2025-08-04 07:57:59 UTC
README
Installation
1. Create DB ( PHP my Admin ) and Import DB dump
sh ~/Devel/scripts/db_import/import_db.sh <DB_NAME> ~/Devel/db/<DB_DUMP_FILE>.sql
If you are working on svetnapojov
and get errors run mysql -f -u root -proot svetnapojov
In case of errors remove this line from the dump file:
DEFINER=`<USERNAME>`@`localhost` SQL SECURITY DEFINER
2. Composer install
When prompted with Set folder permissions and create symlinks if needed? Run only with sufficient privileges [Y,n]?
accept. In case you failed to do so you can still try again with bin/cake rshop install symlink
.
Decline the remaining prompts.
composer i
3. Rshop update
bin/cake rshop update
4. Set ROOT_PATH env
5. Build and Install
bin/fe i
6. Create admin user
bin/cake rshop:admin-users create
7. Reindex - if project uses elasticsearch
bin/cake rshop:reindex
Dummy data
If there is no data available, you can run seed files for dummy data. Use them only in development phase before the project goes to production.
config/seed.php
- DEPRECEATED! - use migrations for that
bin/cake BasicSeed.basic_seed
- for boxes and banner placesconfig/seed_dev.php
bin/cake BasicSeed.basic_seed -d
- for dummy data & box items/subitems
Migration to Vite - Changelog
Global variables
I would like this to be only temporary since in my opinion explicit imports are more understandable and as we migrate to Typescript there will be a lot of errors since the variables are not imported in the file
Accessing ENV vars
Using Vite we have to access env vars like so:
import.meta.env.[ENV_NAME]
When you want to get TS suggestion for new ENV variable, you have to add it to vite-env.d.ts
file.
Libs
For libraries like jQuery
, the variables are set in /resources/js/common/commonLibs/index.js
, since the file is preloaded.
Common Frontend
For variables primarily from vendor
I updated each of the files, where I added to them default export and inicialization of the global variable in window
. See /resources/js/common/commonFrontend/index.js
Vite
Structure of the file
Plugins
- Vue - plugin for vue
- LiveReload - used for live reload of the
.php and .ctp
files
Build
- For build we have scripts which take all main files. For CSS that's
import.scss
and for JS it'sindex.js
. So every file named like so will be included in the build.
- For build we have scripts which take all main files. For CSS that's
Aliases
- Specified aliases for imports
Importing CSS and JS into PHP
Importing of CSS and JS is happening in base.ctp
file. The HtmlHelper
for these imports is slightly modified. Now instead of the path to the file we only specify "keys" like so:
echo $this->Html->script('[PATH IS EMPTY]', [OPTIONS], ['common', 'commonLibs']);
So as you see in the example above we specified we want file from common
folder and specifically we want commonLibs
file. The modified HtmlHelper
then finds file that corresponds to these keys and returns path to it.
When the DEBUG
env variable in .env
is set to true
the base file path is set to http://localhost:3000
and path is set to file itself - that is so that the Hot module reload
of Vite is working during development.
Running the app
After default setup of the app the only thing left to do is to run
npm run dev
Troubleshooting
Admin has no styles and/or images are not loading
In this case running following commands should do the job:
bin/fe upd:admin
and bin/cake rshop install symlink
Usefull commands
composer install
bin/cake rshop update
bin/fe i
bin/cake rshop install symlink
project migrations
bin/cake migrations create MigrationName
- new migration for projectbin/cake migrations migrate
- run project migrationsbin/cake migrations rollback
- rollback of the last project migrationbin/cake migrations mark_migrated 20240419093004
- mark migration as migratedrshop/admin migrations
bin/cake migrations create MigrationName --plugin=Rshop/Admin
- new migration for rshop/adminbin/cake rshop update migrate
- run rshop/admin migrationsbin/cake rshop update rollback
- rollback of the last rshop/admin migrationbin/cake migrations mark_migrated 20240419093004 -p Rshop/Admin
- mark migration in rshop/admin as migratedcache
bin/cake orm_cache clear
- db cachebin/cake cache clear_all
- clear allbin/cake cache clear cacheName
- clear individual cache_cake_core_
_cake_model_
bin/cake cache list_prefixes
- list all available prefixes