Setup Development Environment
In order to work on the API, you'll need to install the source version locally. The application sourcecode is being hosted in the directus/api repo on GitHub.
- A HTTP Web Server that supports URL rewrites
- Comes with .htaccess included for Apache
- MySQL 5.2+
- Database (empty or existing)
- Database User (with access to database)
- PHP 7.1+
xml(Only if you are installing phpunit)
- Node.js v8.11.3 or higher (preferably v10.6+)
- Git to fetch the source code from GitHub
- Composer to install dependencies
1. Clone the repo
Clone the repo by running
git clone https://github.com/directus/api.git
git clone firstname.lastname@example.org:directus/api.git
If you want to work on your fork of the project, remember to replace
directus with your GitHub username in the url above
2. Install the Composer dependencies
If you don't want to install any development package use the
composer install --no-dev
3. Install the npm dependencies of and build the extensions
cd extensions npm install npm run build
Just like the app, if you'd like to actively work on Extensions, use
npm run dev instead of
npm run build.
4. Create a database
On your local server, create a new database to use with the API.
If you'd rather skip the installer (next step), you can simply import the boilerplate schema file from the included schema.sql file.
This file comes with the boilerplate schema as well as some dummy collections, fields, data, and Settings. You can download a demo SQL schema to skip the API's installation process.
If you are skipping the installer and adding the SQL directly to your database, the default login credentials are:
5. Config File Installer
The API uses a config file to know which database to connect to. Copy or rename the
/config/api_sample.php file to
/config/api.php (default project) and edit the settings as indicated.