> For the complete documentation index, see [llms.txt](https://lucid-architecture.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://lucid-architecture.gitbook.io/docs/getting-started/installation.md).

# Installation

Getting Started

{% hint style="danger" %}
You are looking at the depricated version of the docs. See <https://docs.lucidarch.dev> for the latest documentation.
{% endhint %}

{% hint style="danger" %}
This is no longer the way to install Lucid, see [installation docs](https://docs.lucidarch.dev/installation) for the modern method.
{% endhint %}

## Laravel • Lucid Monolith

This example uses Laravel with the Lucid Monolith installation (in contrast with Microservice). For more on the differences see Definitions \[coming soon].

Initialise a Laravel project with Lucid, using the latest version:

```bash
composer create-project lucid-arch/laravel lucid-demo
```

This will install a new Laravel project with the latest version, structured as per the Lucid architecture, as well as the [Lucid Console](https://github.com/lucid-architecture/laravel-console) which provides a command line interface and a user interface to help you manage your Lucid components.

> To install a specific version use notation such as `lucid-arch/laravel=5.8.x` instead of `lucid-arch/laravel`. This is literally `5.8.x` and not `5.8.0` or `5.8.1`.

### Directory Structure

What you should know about the directories that you will find in addition to the ones included in Laravel by default:

```
src
├── Data
├── Domains
    └── * domain name *
            ├── Jobs
├── Foundation
└── Services
    └── * service name *
        ├── Console
        ├── Features
        ├── Http
        ├── Providers
        ├── Tests
        ├── database
        └── resources
```

### Components <a href="#id-87a7f390-d522-40c0-bdea-3c4af7cada95" id="id-87a7f390-d522-40c0-bdea-3c4af7cada95"></a>

Use the table below to help you place the different Lucid components

**Component Definitions**

| Component      | Path                                        | Description                                                                |
| -------------- | ------------------------------------------- | -------------------------------------------------------------------------- |
| **Service**    | `src/Service/[service]`                     | Place for the Services                                                     |
| **Feature**    | `src/Services/[service]/Features/[feature]` | Place for the Features of Services                                         |
| **Job**        | `src/Domains/[domain]/Jobs/[job]`           | Place for the Jobs that expose the functionalities of Domains              |
| **Operation**  | `src/Operations`                            | Place for the Operation that can call multiple Jobs from different domains |
| **Data**       | `src/Data`                                  | Place for models, repositories, value objects and anything data-related    |
| **Foundation** | `src/Foundation`                            | Place for foundational (abstract) elements used across the application     |

## Setup <a href="#id-7c209faf-46cc-4124-8d0c-294b2b539bd7" id="id-7c209faf-46cc-4124-8d0c-294b2b539bd7"></a>

The `lucid` executable will be in `vendor/bin`. If you don't have `./vendor/bin/` as part of your shell `PATH` you will need to execute it using `./vendor/bin/lucid`, otherwise add it with the following command to be able to simply call `lucid` when in the project's root directory \[recommended]:

```bash
export PATH="./vendor/bin:$PATH"
```

For a list of all the commands that are available run `lucid` or see the [CLI Reference](https://github.com/lucid-architecture/console-laravel#available-commands).

{% hint style="info" %}
Seek your shell session's docs to see how to add this to your shell profile permanently.
{% endhint %}

### Description

Before we dive into code, here's what we are about to do:

We will create an application with basic functionality to create and list articles, where an article simply having `title` and `content`. The application will have two services: `Api` and `Admin` . Each will expose the features correspondingly, where the `Api` service will receive and return JSON data, while `Admin` will serve them rendered using [Blade](https://laravel.com/docs/5.8/blade).

## Overview

* [**Part I**](/docs/getting-started/part-i.md)
  1. [Create `Api` Service](/docs/getting-started/part-i.md#698d2928-d627-402f-9e9d-b4f38a98e79a)
  2. [Write functionality & tests](/docs/getting-started/part-i.md#581e54d4-d563-4d28-981a-52ba020f736f)
  3. [Serve feature](/docs/getting-started/part-i.md#74aeb5bd-ff54-4185-b2d4-40659ef3bc08)
* **Part I**I
  1. Create `Admin` Service
  2. Share functionality from `Api`
  3. Add display functionality
  4. Test `Admin` \[manual]
* **Part III**
  * Repository pattern for data storage
  * Optional Job parameters
  * Operations
  * Error handling
    * Abstraction in sharing data provider between validation and feature?

## &#x20;<a href="#id-698d2928-d627-402f-9e9d-b4f38a98e79a" id="id-698d2928-d627-402f-9e9d-b4f38a98e79a"></a>
