@@ -29,6 +29,8 @@ composer install
2929```
3030
3131Install frontend dependencies using npm:
32+ require node >22.12
33+
3234``` bash
3335npm install
3436```
@@ -52,8 +54,13 @@ To set up your database, execute the SQL migrations provided:
5254php migrations/run.php
5355```
5456
57+ ### Step 5: Build dependancies if needed
58+ ``` bash
59+ npm run build
60+ ```
61+
5562## Running the Application
56- Once you have configured your environment, start your PHP server to run the application:
63+ Once you have configured your environment, start your PHP server from public folder to run the application:
5764
5865``` bash
5966php -S localhost:8000
@@ -78,7 +85,7 @@ Also update WEBSITE_DOMAIN from you env file
7885
7986### Framework & Technologies
8087- ** Backend:** PHP 8.3 with Slim Framework 4
81- - ** Frontend:** Bootstrap 5.3, CountUp.js, Moment.js
88+ - ** Frontend:** Bootstrap 5.3, CountUp.js, Moment.js, Vite.js
8289- ** Database:** MySQL
8390- ** Template Engine:** Twig
8491- ** Dependency Injection:** PHP-DI
@@ -90,18 +97,19 @@ Also update WEBSITE_DOMAIN from you env file
9097```
9198twitch-widget/
9299├── public/ # Web root directory
93- │ ├── css/ # Compiled CSS files
94- │ ├── js/ # Compiled JavaScript files
100+ │ ├── dist/ # Compiled CSS and Javascript files
95101│ └── index.php # Application entry point
96102├── src/ # Application source code
97- │ ├── Controllers/ # Request handlers
103+ │ ├── Assets/ # Assets folders (scss + js)
104+ │ ├── Controllers/ # Request handlers
98105│ ├── Models/ # Data models
99106│ ├── Repositories/ # Data access layer
100107│ ├── Services/ # Business logic services
101108│ ├── Middlewares/ # Request/response middleware
102109│ └── views/ # Twig templates
103110├── migrations/ # Database migration files
104- └── vendor/ # Composer dependencies
111+ └── vendor/ # Composer dependencies
112+ └── node_modules/ # NPM dependencies
105113```
106114
107115### Key Components
@@ -160,12 +168,13 @@ Database schema is managed through SQL migration files in the `migrations/` dire
160168- ` 07-improve-user-rights.sql ` : User permissions
161169
162170### Frontend Assets
163- JavaScript and CSS files are organized in ` public/ js/` and ` public /css/` :
171+ JavaScript and CSS files are organized in ` src/Assets/ js/` and ` src/Assets /css/` :
164172- ** admin.js:** Admin panel functionality
173+ - ** app.js:** App module loader
165174- ** alert.js:** Alert widget logic
166175- ** event.js:** Event widget logic
167176- ** stream.js:** Stream management
168- - ** main.css :** Global styles
177+ - ** main.scss :** Global styles
169178
170179### Environment Configuration
171180Key environment variables include:
0 commit comments