Setup instructions for the Directus Pokemon DB
Current the Directus Cloud service does not have an import/export feature that includes all the data and files. So before you can try out the Fresh Pokemon code you will need to import the data and files manually into your own database.
Community Cloud
as the database typeEmpty Project
as the starting templatehttps://c7swx88u.directus.app
then the DB name is c7swx88u
.Users
tab in the left sidebarToken
field and click on the +
button to generate a token, keep a record of this new tokenFiles
tab on the left sidebarpokemon
folder into "Files" using drag and drop1000
from the number of files to showtrash
icon to remove themImport/Export
Export Items
JSON
as the format1000
from the Limit dropdownfiles.json
node add-images.js
This will take the existing pokemon.json
file and add the image IDs to it and create a new file called pokemon-with-images.json
Content
icon on the left sidebarCreate Collection
pokemon
Finish setup
to build the collectionCreate Fields
multiple times to add these fields to the collectionKey | Interface | Type |
---|---|---|
name | input field | string |
type | tags | |
hp | input field | integer |
attack | input field | integer |
defense | input field | integer |
special_attack | input field | integer |
special_defense | input field | integer |
speed | input field | integer |
image | image |
Content
icon on the left sidebarImport/Export
on the right sidebarImport
buttonpokemon-with-images.json
fileStart Import
buttonIf you are just playing around with stuff locally you can use the admin key. But if you want to share the code around you should create a user that has read-only permissions so that your data won't be corrupted (or worse). To make a read-only user follow the instructions below:
Click on the Users
icon on the left sidebar
Click on the +
button to create a new user
Specify a name and email for the user
Scroll down and generate a token for the user and save it
Click the Save
button to save the user
Click on the user and click on the Role button with the +
to create a new role
Name the role readonly
Click on the save button for the user
Click on the Gear icon to bring up the settings page
Click on Roles & Permissions
Select the readonly
role
On the Permissions
table click on the icon under the eye
then select All Access
Open the System Collections
spinner to open up the system collections
Add the eye
permission to Directus Files
Your project is ready to use.