A Laravel-based web application for the Archethic Foundation. This project uses PHP 8.3, Laravel, and Node.js (with Vite) to deliver a modern development experience. Whether you’re contributing to the codebase or deploying it for production, this guide will help you get started.
- Prerequisites
- Installation
- Configuration
- Running the Application
- Running Tests
- Adding a page
- Adding a redirection
- Deploying production
- Docker (Optional)
- License
- PHP 8.3
- Composer
- Node.js (latest LTS preferred)
- npm or yarn
- MySQL or SQLite (or any other database supported by Laravel)
Note: If you don’t have all these installed locally, you can skip manual setup and use the optional Docker configuration described in Docker (Optional).
-
Clone the repository:
git clone https://github.com/archethic-foundation/archethic-laravel.git cd archethic-laravel
-
Install PHP dependencies:
composer install
-
Install JavaScript dependencies:
npm install
Or if you prefer yarn:
yarn
-
Copy the example environment file and configure it:
cp .env.example .env
- Database: Set your database credentials in the
.env
file. - App URL: Update
APP_URL
to match your local environment (e.g.http://localhost:8000
). - Other settings: Configure mail, caching, etc., as needed.
- Database: Set your database credentials in the
-
Generate the application key:
php artisan key:generate
-
Run database migrations:
php artisan migrate
If you are using SQLite, just ensure you have a
database/database.sqlite
file and update your.env
accordingly.
- Environment Variables: All major settings (database, caching, mail, etc.) are controlled via
.env
. For production, be sure to setAPP_ENV=production
,APP_DEBUG=false
, and secure any other sensitive values. - Logging: Laravel logs to
storage/logs
by default. Check your.env
for log settings (e.g.,LOG_CHANNEL
).
- Start the Laravel development server:
By default, this will serve your application at
composer run dev
http://127.0.0.1:8000
.
If you prefer running everything in Docker containers, we have a Docker Compose setup that handles PHP, queue workers, the scheduler, and more. This ensures a consistent environment for all developers and simplifies deployment.
- Install Docker and Docker Compose (MacOS users: OrbStack is the way)
- Copy or adapt the
docker-compose.dev.yml
from the repository. - Build and start containers:
docker-compose -f docker-compose.dev.yml up -d
- Run static analysis (PHPStan):
./vendor/bin/phpstan analyse --memory-limit=2G
- Run automated tests (Pest):
This will execute your unit and feature tests, providing a summary of the results.
php artisan test
If you want to add a page which is not references by any hyperlink, you will have to export it explicitely.
To do so, edit config/export.php
. Add your file in the paths
array.
If you need to redirect one URL to another, you must duplicate the page. This is the simplest solution becaues GitHub pages does not support redirection setup.
To do so, edit .github/workflows/deploy.yaml
.
Add a cp
command in the # Simulate redirections '-_-
section.
Website has been hitorically created with Laravel 11. For hosting simplicity, we convert it to a static website before publishing it to GitHub Pages.
To deploy, simply push your changes to the main
branch. This will trigger the deploy GitHub Action.
This project is open-sourced software licensed under the MIT license.
- Website: archethic.net
- GitHub Issues: Please open a ticket if you spot a bug or want to request a feature.
- Pull Requests: Contributions are welcome! Fork this repo, make your changes, and submit a PR.
Happy coding!