git clone https://github.com/the-syndrome/meltdown-with-directus.git
cd meltdown-with-directus
touch database/data.db
git clone https://github.com/the-syndrome/meltdown.git app
cp -r pages/* app/src/pages
cp .env.example .env
docker-compose upBy default these services will be up but there are no collections or pages in it yet.
- directus http://127.0.0.1:33764 login with
ADMIN_EMAIL+ADMIN_PASSWORDin your.envfile - meltdown http://127.0.0.1:33765
To automatically use the test pages import them with:
npm install --ignore-scripts
npm rebuild esbuild
npm run schema-import
npm run pages-importUntil we can automate it the public user needs access to the pages collection.
- http://127.0.0.1:33764/admin/settings/policies
- Public
- Permissions ➡️ Add Collection:
pages - Actions ➡️
Read
If you're finding it useful you can begin to change the values in the .env file documented at https://meltdown.dex.yachts/deploy/environment. It's recommended to change the admin information before moving to production. SSG is particularly useful when deploying.
Directus has flexible configuration allowing for any scale. In this project we run it minimally with sqlite but you can opt for other databases, caching, cloud services, and email. See all directus config options.
In this example we only used a basic type of proxying to request pages. If you get committed to directus and want to go deeper you can implement a proxy. The module http-proxy-middleware will be fine in development. In production proxy_pass in nginx or the equivalent in your HTTP server will help serve more from directus like collections, assets, and the rest.
Before going to production the developer should check that secrets from the .env file are not leaked through to the imba bundle.
npm run schema-export./tools/schema-{timestamp}.json is created
npm run pages-export./tools/pages-{timestamp}.json is created
As an aside there is a tool that directus has for exporting and importing but while using that system there were some problems. The ./tools scripts were created as a work-around. If you have the ability to troubleshoot and improve this project using the built-in tools we can update with your PR.
# export
docker-compose exec directus npx directus schema snapshot ./snapshot.yaml
# import
docker-compose exec directus npx directus schema apply --yes ./snapshot.yaml
docker-compose exec directus npx directus schema diff --yes ./snapshot.yamlThe following docs and guides were helpful to make the project, export, and import.
- Directus Export Schema Guide
- Directus Database Migration
- Directus API: Schema
- Directus API: Collections
- Directus API: items
- Meltdown docs
In some containers and runtimes the users and permissions aren't clear so you can set read+write for all as a work-around.
chmod -R 0777 database extensions uploadsJoin the Community


