<p align="center">
<img height="30px" src="https://www.eae.pt/imgs/logo_eae.svg">  
EAST ATLANTIC ENGINEERING
</p>

# EAE Base CMS

EAE Base CMS is a generic Content Management System (CMS) developed by EAST ATLANTIC ENGINEERING. It is designed to provide a flexible foundation for all client projects, allowing users to create and manage menus, pages, blocks, and users with different roles and access levels. Built with Laravel 11 and Vue 3, it uses Inertia.js to facilitate communication between the Laravel backend and the Vue 3 frontend.

## Features

- Menu management
- Page and block creation
- User roles and permissions
- Customizable settings for projects
- User-friendly CMS interface for administrators

## Prerequisites

Before you begin, ensure you have met the following requirements:

- **NVM**: Install and use the Node version specified in `.nvmrc`.
- **Lando**: Version `3.21.2` or higher.
- **Docker**: Version `4.30.0` or higher.

## Installation

Follow these steps to get the project up and running locally:

1. **Copy the environment configuration**:

   ```bash
   cp .env.example .env
   ```

2. **Configure environment variables**:

   Update the `.env` file with your project-specific settings:

   - `APP_NAME`: Project name (use quotes if the name contains spaces).
   - `APP_ENV`: Set to `local` for local development.
   - `APP_DEBUG`: Set to `true` for debugging during development.
   - `APP_URL`: The base URL for your local site (e.g., `http://eae-base-cms.lndo.site`).
   - `DB_*`: Database credentials (default values work with Lando).
   - `MAIL_*`: Email credentials (use Mailhog for local development).
   - `EAE_ADMIN_DEFAULT_PASSWORD`: Admin password for the CMS.

3. **Start Lando (if applicable)**:

   ```bash
   lando start
   ```

4. **Install dependencies**:

   ```bash
   composer install          # or 'lando composer install' if using Lando
   ```

5. **Generate the application key**:

   ```bash
   php artisan key:generate  # or 'lando artisan key:generate' if using Lando
   ```

6. **Run database migrations and seeders**:

   ```bash
   php artisan migrate --path="/database/migrations/backoffice" && php artisan migrate # lando artisan migrate && lando artisan migrate --path="/database/migrations/backoffice"
   php artisan db:seed       # or 'lando artisan db:seed' if using Lando
   ```

   > You can also run: `lando prep-db` to simplify database preparation.

7. **Create the storage symlink**:

   ```bash
   php artisan storage:link  # or 'lando artisan storage:link' if using Lando
   ```

8. **Install Node.js dependencies**:

   ```bash
   nvm use
   npm install
   npm run build
   ```
9. **Run the frontend development server**:

   If you are working on the frontend of the CMS, start the development server to watch for file changes and hot-reload the Vue.js components:

   ```start bash
   npm run dev
   ```end bash

After completing these steps, you should be able to access the CMS at `APP_URL/admin` using:

- **Username**: `admin`
- **Password**: The password set in `.env` under `EAE_ADMIN_DEFAULT_PASSWORD`.

If using Lando, you can verify the `APP_URL` by running:

```bash
lando info
```

## License

This project is licensed by EAST ATLANTIC ENGINEERING. For more details, visit [https://www.eae.pt](https://www.eae.pt).
