#REPONAME
In order to spin up this repo, you need to spin up both the back end and the front end.
- Clone the repo
- Make sure to
git checkout develop
or TODO: replace this with info about our git standard stuff.
- cd to
backend
nitro add
Enter the hostname [backend.nitro]: api-REPONAME.nitro Enter the web root for the site [web]: Choose a PHP version:- 8.0
- 7.4
- 7.3
- 7.2
- 7.1
- 7.0 Enter your selection: 3 Add a database for the site [Y/n] y Select the database engine:
- mysql-5.7-3306.database.nitro
- postgres-13-5432.database.nitro Enter your selection: 1 Enter the new database name: REPONAME_db_dev Should we update the env file? [y/N] n Apply changes now [Y/n]? y
nitro composer install
- cd to
frontend
- copy the contents of
.env.example
to a new file,.env
- update or double check the following lines:
GRAPHQL_URL=http://api-craftvue.nitro BACKEND_URL=http://api-craftvue.nitro
- Login to
http://api-craftvue.nitro/admin
with the login from onepass. - copy the contents of
.graphqlconfig.example
to a new file,.graphqlconfig
- Get graphql token (You don't need "Authorization: Bearer", just the alphanumeric code)\
- Add to:
.env
and.graphqlconfig
yarn
When you pull, if anything has changed (new packages added, etc) remember to run nitro composer install
and yarn
to grab any new or updated packages. This will happen automatically if you are using PHPStorm and it is properly configured.
Yarn is for frontend, composer is for backend.
- Navigate to Utilities/Database Backup.
- Click Backup Button.
- Add the new file (in backend/storage/backups) to git.
https://craftcms.com/docs/nitro/2.x/importing.html
While developing locally run:
yarn dev
You can build the files for dist with:
yarn build