https://github.com/nerkarso/directus-template
Template of Directus to accelerate setup time
https://github.com/nerkarso/directus-template
directus
Last synced: 6 months ago
JSON representation
Template of Directus to accelerate setup time
- Host: GitHub
- URL: https://github.com/nerkarso/directus-template
- Owner: nerkarso
- Created: 2023-04-11T00:27:35.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2024-04-12T21:19:35.000Z (over 1 year ago)
- Last Synced: 2025-01-29T20:35:38.482Z (8 months ago)
- Topics: directus
- Homepage:
- Size: 203 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Requirements
- Node.js `v18.x`
- pnpm `v8.x`
- MySQL `v2.x`## Getting Started
1. Install Node.js dependencies:
```sh
pnpm install
```2. Create a copy of the `.env.example` file and rename it to `.env`.
3. Generate app key and secret:```sh
pnpm security
```4. Assign the generated strings to the key and secret variable inside the `.env` file.
5. If you're using MySQL:
1. Create a fresh new database.
2. Change the database credentials in the `.env` file.
6. Bootstrap the database:```sh
pnpm bootstrap
```8. Start Directus:
```sh
pnpm start
```9. Open http://localhost:8055 in your browser.
10. Log in with the credentials of `ADMIN_EMAIL` and `ADMIN_PASSWORD` found at the end of the `.env` file.## Directus Commands
### Run an instance
```sh
pnpm start
```### Initialize the database
Either install the database (if it's empty) or migrate it to the latest version (if it already exists and has missing migrations).
```sh
pnpm bootstrap
```### Update the database
```sh
pnpm migrate
```### Generate app key and secret
```sh
npx directus security key:generate
npx directus security secret:generate
```Copy and paste the output in your `.env` file.
## Deployment
> Tip: If you're using Directus in production, it's recommended to lock the version of Directus in your package.json because things might break when this package gets updated.
Example:
```diff
"dependencies": {
- "directus": "^10.0.0"
+ "directus": "10.0.0"
}
```