Skip to content

Commit 04b90fc

Browse files
committed
v2.1 build
1 parent 55d06ef commit 04b90fc

File tree

123 files changed

+19342
-241
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

123 files changed

+19342
-241
lines changed

.env.example

Lines changed: 3 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,12 @@
1-
APP_NAME=Laravel
1+
APP_NAME="TRAX LRS"
22
APP_ENV=local
33
APP_KEY=
44
APP_DEBUG=true
5-
APP_URL=http://localhost
6-
7-
LOG_CHANNEL=stack
8-
LOG_DEPRECATIONS_CHANNEL=null
9-
LOG_LEVEL=debug
5+
APP_URL=http://traxlrs21starter.test
106

117
DB_CONNECTION=mysql
128
DB_HOST=127.0.0.1
139
DB_PORT=3306
14-
DB_DATABASE=laravel
10+
DB_DATABASE=traxlrs21_starter
1511
DB_USERNAME=root
1612
DB_PASSWORD=
17-
18-
BROADCAST_DRIVER=log
19-
CACHE_DRIVER=file
20-
FILESYSTEM_DISK=local
21-
QUEUE_CONNECTION=sync
22-
SESSION_DRIVER=file
23-
SESSION_LIFETIME=120
24-
25-
MEMCACHED_HOST=127.0.0.1
26-
27-
REDIS_HOST=127.0.0.1
28-
REDIS_PASSWORD=null
29-
REDIS_PORT=6379
30-
31-
MAIL_MAILER=smtp
32-
MAIL_HOST=mailpit
33-
MAIL_PORT=1025
34-
MAIL_USERNAME=null
35-
MAIL_PASSWORD=null
36-
MAIL_ENCRYPTION=null
37-
MAIL_FROM_ADDRESS="hello@example.com"
38-
MAIL_FROM_NAME="${APP_NAME}"
39-
40-
AWS_ACCESS_KEY_ID=
41-
AWS_SECRET_ACCESS_KEY=
42-
AWS_DEFAULT_REGION=us-east-1
43-
AWS_BUCKET=
44-
AWS_USE_PATH_STYLE_ENDPOINT=false
45-
46-
PUSHER_APP_ID=
47-
PUSHER_APP_KEY=
48-
PUSHER_APP_SECRET=
49-
PUSHER_HOST=
50-
PUSHER_PORT=443
51-
PUSHER_SCHEME=https
52-
PUSHER_APP_CLUSTER=mt1
53-
54-
VITE_APP_NAME="${APP_NAME}"
55-
VITE_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
56-
VITE_PUSHER_HOST="${PUSHER_HOST}"
57-
VITE_PUSHER_PORT="${PUSHER_PORT}"
58-
VITE_PUSHER_SCHEME="${PUSHER_SCHEME}"
59-
VITE_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,6 @@ yarn-error.log
1717
/.fleet
1818
/.idea
1919
/.vscode
20+
/services/tim
21+
/services/trax/framework
22+
.env.testing

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "services/trax/framework"]
2+
path = services/trax/framework
3+
url = https://github.com/trax-project/trax2-framework.git

LICENSE.txt

Lines changed: 674 additions & 0 deletions
Large diffs are not rendered by default.

README.md

Lines changed: 184 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,66 +1,205 @@
1-
<p align="center"><a href="https://laravel.com" target="_blank"><img src="https://raw.githubusercontent.com/laravel/art/master/logo-lockup/5%20SVG/2%20CMYK/1%20Full%20Color/laravel-logolockup-cmyk-red.svg" width="400" alt="Laravel Logo"></a></p>
1+
# TRAX LRS 2.1 - Starter Edition
22

3-
<p align="center">
4-
<a href="https://github.com/laravel/framework/actions"><img src="https://github.com/laravel/framework/workflows/tests/badge.svg" alt="Build Status"></a>
5-
<a href="https://packagist.org/packages/laravel/framework"><img src="https://img.shields.io/packagist/dt/laravel/framework" alt="Total Downloads"></a>
6-
<a href="https://packagist.org/packages/laravel/framework"><img src="https://img.shields.io/packagist/v/laravel/framework" alt="Latest Stable Version"></a>
7-
<a href="https://packagist.org/packages/laravel/framework"><img src="https://img.shields.io/packagist/l/laravel/framework" alt="License"></a>
8-
</p>
93

10-
## About Laravel
4+
## About TRAX LRS
115

12-
Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experience to be truly fulfilling. Laravel takes the pain out of development by easing common tasks used in many web projects, such as:
6+
TRAX LRS is an xAPI conformant Learning Record Store (LRS) built with Laravel.
137

14-
- [Simple, fast routing engine](https://laravel.com/docs/routing).
15-
- [Powerful dependency injection container](https://laravel.com/docs/container).
16-
- Multiple back-ends for [session](https://laravel.com/docs/session) and [cache](https://laravel.com/docs/cache) storage.
17-
- Expressive, intuitive [database ORM](https://laravel.com/docs/eloquent).
18-
- Database agnostic [schema migrations](https://laravel.com/docs/migrations).
19-
- [Robust background job processing](https://laravel.com/docs/queues).
20-
- [Real-time event broadcasting](https://laravel.com/docs/broadcasting).
8+
It focuses on the core features of an LRS, and that's it!
219

22-
Laravel is accessible, powerful, and provides tools required for large, robust applications.
10+
We want to keep it simple and clean, and give you the freedom to build what you want around it.
2311

24-
## Learning Laravel
12+
Fore further information, visit http://traxlrs.com
2513

26-
Laravel has the most extensive and thorough [documentation](https://laravel.com/docs) and video tutorial library of all modern web application frameworks, making it a breeze to get started with the framework.
2714

28-
You may also try the [Laravel Bootcamp](https://bootcamp.laravel.com), where you will be guided through building a modern Laravel application from scratch.
15+
## Sofware License & Copyright
2916

30-
If you don't feel like reading, [Laracasts](https://laracasts.com) can help. Laracasts contains thousands of video tutorials on a range of topics including Laravel, modern PHP, unit testing, and JavaScript. Boost your skills by digging into our comprehensive video library.
17+
TRAX LRS **Starter Edition** is distributed under the [GNU-GPL3 license](https://www.gnu.org/licenses/gpl-3.0.fr.html).
3118

32-
## Laravel Sponsors
19+
Copyright 2022-2024 Sébastien Fraysse, http://fraysse.eu, sebastien@fraysse.eu.
3320

34-
We would like to extend our thanks to the following sponsors for funding Laravel development. If you are interested in becoming a sponsor, please visit the [Laravel Partners program](https://partners.laravel.com).
3521

36-
### Premium Partners
22+
## Server Requirements
3723

38-
- **[Vehikl](https://vehikl.com/)**
39-
- **[Tighten Co.](https://tighten.co)**
40-
- **[WebReinvent](https://webreinvent.com/)**
41-
- **[Kirschbaum Development Group](https://kirschbaumdevelopment.com)**
42-
- **[64 Robots](https://64robots.com)**
43-
- **[Curotec](https://www.curotec.com/services/technologies/laravel/)**
44-
- **[Cyber-Duck](https://cyber-duck.co.uk)**
45-
- **[DevSquad](https://devsquad.com/hire-laravel-developers)**
46-
- **[Jump24](https://jump24.co.uk)**
47-
- **[Redberry](https://redberry.international/laravel/)**
48-
- **[Active Logic](https://activelogic.com)**
49-
- **[byte5](https://byte5.de)**
50-
- **[OP.GG](https://op.gg)**
24+
### Apache 2.4
5125

52-
## Contributing
26+
- mod_rewrite
5327

54-
Thank you for considering contributing to the Laravel framework! The contribution guide can be found in the [Laravel documentation](https://laravel.com/docs/contributions).
28+
### PHP 8.1 to 8.3
5529

56-
## Code of Conduct
30+
Check that your PHP version and configuration is valid both for PHP Web & CLI.
31+
The following extensions are required:
5732

58-
In order to ensure that the Laravel community is welcoming to all, please review and abide by the [Code of Conduct](https://laravel.com/docs/contributions#code-of-conduct).
33+
- Ctype
34+
- cURL
35+
- DOM
36+
- Fileinfo
37+
- Filter
38+
- Hash
39+
- Mbstring
40+
- OpenSSL
41+
- PCRE
42+
- PDO (PDO_MYSQL / PDO_PGSQL)
43+
- Session
44+
- Tokenizer
45+
- XML
5946

60-
## Security Vulnerabilities
47+
### Database
6148

62-
If you discover a security vulnerability within Laravel, please send an e-mail to Taylor Otwell via [taylor@laravel.com](mailto:taylor@laravel.com). All security vulnerabilities will be promptly addressed.
49+
- MySQL 5.7.7+
50+
- MariaDB 10.10+
51+
- PostgreSQL 12+
6352

64-
## License
53+
### Utilities
54+
55+
- Git
56+
- Composer 2
57+
58+
59+
## Upgrade from TRAX LRS 2.0.x
60+
61+
In order to upgrade TRAX LRS from version 2.0.x, we recommend to install the last release of TRAX LRS
62+
in a different location and then, to make a copy the `.env` file from your previous installation.
63+
64+
65+
## Fresh install
66+
67+
### First Steps
68+
69+
Assuming that you want to install TRAX LRS in a folder named **traxlrs**:
70+
71+
```
72+
git clone https://github.com/trax-project/trax2-starter-lrs traxlrs
73+
cd traxlrs
74+
composer install
75+
```
76+
77+
### File Permissions
78+
79+
The folders `storage` and `bootstrap/cache` must be writable both by the webserver and the console user.
80+
Assuming that the ownership has been properly set, you should be able to assign a `0775` permission
81+
to the folders and subfolders and a `644` permission to the files.
82+
Check this post for further details: https://laracasts.com/discuss/channels/laravel/proper-folder-permissions
83+
84+
If you are not sure how to configure this, you can use the following commands **FOR TESTING PURPOSE ONLY**.
85+
86+
```
87+
chmod -R 777 bootstrap/cache
88+
chmod -R 777 storage
89+
```
90+
91+
### Web Server
92+
93+
For security reasons, only the `public` folder should be accessible by the web server.
94+
Create a virtual host and configure the document root to `traxlrs/public`.
95+
96+
97+
### Database
98+
99+
Create an empty database with the `utf8mb4_unicode_ci` encoding.
100+
Then, at the root of the application folder, make a copy of the `.env.example` file,
101+
rename it `.env` and enter your database settings.
102+
103+
*MySQL/MariaDB example:*
104+
105+
```ini
106+
DB_CONNECTION=mysql
107+
DB_HOST=127.0.0.1
108+
DB_PORT=3306
109+
DB_DATABASE=traxlrs
110+
DB_USERNAME=root
111+
DB_PASSWORD=
112+
```
113+
114+
*PostgreSQL example:*
115+
116+
```ini
117+
DB_CONNECTION=pgsql
118+
DB_HOST=127.0.0.1
119+
DB_PORT=5432
120+
DB_DATABASE=traxlrs
121+
DB_USERNAME=postgres
122+
DB_PASSWORD=aaaaaa
123+
```
124+
125+
### App URL
126+
127+
In the `.env` file, you must set the public URL of your TRAX LRS application :
128+
129+
```ini
130+
APP_URL=http://traxlrs.test
131+
```
132+
133+
### Last Steps
134+
135+
```
136+
php artisan key:generate
137+
php artisan migrate
138+
```
139+
140+
141+
## Admin Account
142+
143+
You can now create an admin account with the following command.
144+
This will give your credentials to log into the application.
145+
146+
```
147+
php artisan admin:create
148+
```
149+
150+
Additional commands are available to manage the admin accounts:
151+
152+
```powershell
153+
php artisan admin:list
154+
php artisan admin:update
155+
php artisan admin:delete
156+
```
157+
158+
159+
## Production server
160+
161+
In the `.env` file, changes settings from:
162+
163+
```ini
164+
APP_ENV=local
165+
APP_DEBUG=true
166+
```
167+
168+
To:
169+
170+
```ini
171+
APP_ENV=production
172+
APP_DEBUG=false
173+
```
174+
175+
To optimize performances, you can run the following commands.
176+
177+
```powershell
178+
php artisan config:cache
179+
php artisan route:cache
180+
```
181+
182+
The `php artisan config:cache` command must be ran again after each config change.
183+
184+
185+
186+
## Known issues
187+
188+
### SQLSTATE[42000]: Syntax error or access violation: 1071
189+
190+
If you get this error during the `php artisan migrate` command, check your version of MySQL or MariaDB.
191+
Since TRAX LRS 2.0.2, MySQL versions older than 5.7.7 are not supported anymore.
192+
MariaDB versions older than 10.3 are not supported.
193+
194+
### 404 error on the main page
195+
196+
TRAX LRS has a `/public/.htaccess` file with some Apache directives.
197+
When these directives are ignored by Apache, this leads to a 404 error.
198+
In this case, check the `httpd.conf` file of Apache and try to set the `AllowOverride` option to `All`:
199+
200+
```xml
201+
<Directory "path/to/laravel/project/public">
202+
Allowoverride All
203+
</Directory>
204+
```
65205

66-
The Laravel framework is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).

app/Http/Kernel.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,13 @@ class Kernel extends HttpKernel
1515
*/
1616
protected $middleware = [
1717
// \App\Http\Middleware\TrustHosts::class,
18-
\App\Http\Middleware\TrustProxies::class,
19-
\Illuminate\Http\Middleware\HandleCors::class,
18+
// \App\Http\Middleware\TrustProxies::class,
19+
// \Illuminate\Http\Middleware\HandleCors::class,
2020
\App\Http\Middleware\PreventRequestsDuringMaintenance::class,
2121
\Illuminate\Foundation\Http\Middleware\ValidatePostSize::class,
2222
\App\Http\Middleware\TrimStrings::class,
2323
\Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull::class,
24+
\Trax\Auth\Middleware\CorsMiddleware::class,
2425
];
2526

2627
/**

app/Providers/AppServiceProvider.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace App\Providers;
44

55
use Illuminate\Support\ServiceProvider;
6+
use Illuminate\Support\Facades\Schema;
67

78
class AppServiceProvider extends ServiceProvider
89
{
@@ -19,6 +20,6 @@ public function register(): void
1920
*/
2021
public function boot(): void
2122
{
22-
//
23+
Schema::defaultStringLength(191);
2324
}
2425
}

composer.json

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
{
2-
"name": "laravel/laravel",
2+
"name": "trax2/starter-lrs",
33
"type": "project",
4-
"description": "The skeleton application for the Laravel framework.",
5-
"keywords": ["laravel", "framework"],
6-
"license": "MIT",
4+
"description": "TRAX LRS. Starter Edition.",
5+
"keywords": ["trax", "lrs", "xapi"],
6+
"license": "GPL-3.0-or-later",
77
"require": {
88
"php": "^8.1",
99
"guzzlehttp/guzzle": "^7.2",
1010
"laravel/framework": "^10.10",
1111
"laravel/sanctum": "^3.3",
12-
"laravel/tinker": "^2.8"
12+
"laravel/tinker": "^2.8",
13+
"laravel/ui": "^4.4",
14+
"trax2/framework": "2.0.4"
1315
},
1416
"require-dev": {
1517
"fakerphp/faker": "^1.9.1",
@@ -23,6 +25,7 @@
2325
"autoload": {
2426
"psr-4": {
2527
"App\\": "app/",
28+
"Trax\\Lrs\\": "services/trax/lrs/src/",
2629
"Database\\Factories\\": "database/factories/",
2730
"Database\\Seeders\\": "database/seeders/"
2831
}

0 commit comments

Comments
 (0)