PM Training App is a training management application built with Laravel. It provides API-based authentication using JSON Web Tokens (JWT) and is designed to streamline training management processes.
- API-based authentication with JWT.
- Modular and scalable architecture.
- Easy-to-use endpoints for managing training sessions, users, and roles.
- File upload support with public access via symbolic links.
Follow these steps to set up and run the application:
Ensure you have the following installed on your system:
- PHP >= 8.0
- Composer
- MySQL or any other supported database
- Node.js and npm (optional, for frontend assets)
-
Clone the repository:
git clone <repository-url> cd pm-training-app
-
Install PHP dependencies:
composer install
-
Copy the
.env.example
file to.env
and configure your environment variables:cp .env.example .env
-
Generate the application key:
php artisan key:generate
-
Generate the JWT secret key:
php artisan jwt:secret
-
Create the database:
mysql -u root -p -e "CREATE DATABASE training_app;"
-
Run database migrations:
php artisan migrate
-
Create a symbolic link for file storage:
php artisan storage:link
This command creates a symbolic link from
public/storage
tostorage/app/public
, allowing public access to uploaded files. -
(Optional) Seed the database with sample data:
php artisan db:seed
-
Start the development server:
php artisan serve
Uploaded files are stored in the storage/app/public
directory. To make them publicly accessible, ensure you have run the following command:
php artisan storage:link
- Allowed file types:
pdf
,doc
,docx
- Maximum file size:
2MB
app/
- Contains the core application code (models, controllers, etc.).routes/
- Defines the API routes.database/
- Contains migrations, seeders, and factories.config/
- Configuration files for the application.resources/
- Views, language files, and frontend assets.tests/
- Unit and feature tests.
The application uses JWT for authentication. To log in, use the /api/v1/login
endpoint with valid credentials. The response will include a token to be used for subsequent API requests.
- File Not Found Errors: Ensure the symbolic link for storage is created using
php artisan storage:link
. - Database Connection Issues: Verify your
.env
file contains the correct database credentials. - Empty Request Data: If
PUT
requests are not sending data, ensure the frontend usesmultipart/form-data
for file uploads and the backend handlesPUT
requests correctly.
This project is open-sourced software licensed under the MIT license.