Skip to content

Latest commit

 

History

History
133 lines (105 loc) · 5.79 KB

README.md

File metadata and controls

133 lines (105 loc) · 5.79 KB

🚀 Getting started with Strapi

Strapi comes with a full featured Command Line Interface (CLI) which lets you scaffold and manage your project in seconds.

develop

Start your Strapi application with autoReload enabled. Learn more

npm run develop
# or
yarn develop

start

Start your Strapi application with autoReload disabled. Learn more

npm run start
# or
yarn start

build

Build your admin panel. Learn more

npm run build
# or
yarn build

⚙️ Deployment

Strapi gives you many possible deployment options for your project. Find the one that suits you on the deployment section of the documentation.

RENCI Deployment

As of Nov 2023 All work is being done on the master branch until further notice. Anywhere that is says staging is to be replaced with master.

  1. Note: Check if there has been any new changes on the branch you will be deploying. If so pull in the latest changes for the branch you will be deploying (should always be staging)
  2. Note: If new changes, merge them into your local working branch.
  3. Build and test API locally.
  4. Once tested and approved push up your changes.
  5. Create a PR and tag team members for review.
  6. Once PR is approved, team members will tag you so that you can merge it and complete the deployment. (This step is nesseccary to make sure everyone working on the API can also access it and redeploy it)
  7. SSH into server (If you do not have a private key file, reach out to your manager for assistance)
  8. Make sure the newest changes were pushed from github, if not pull them in manually.
  9. From ~ run: pm2 restart ecosystem.config.js
  10. NOTE: To check status of restart run: pm2 logs
  11. The API should now be rebuilt with the newest changes

📚 Learn more

  • Resource center - Strapi resource center.
  • Strapi documentation - Official Strapi documentation.
  • Strapi tutorials - List of tutorials made by the core team and the community.
  • Strapi blog - Official Strapi blog containing articles made by the Strapi team and the community.
  • Changelog - Find out about the Strapi product updates, new features and general improvements.

Feel free to check out the Strapi GitHub repository. Your feedback and contributions are welcome!

Installation

Setting up A Postgres Database on Mac (Quick and easy set up using Postgres App) https://postgresapp.com/downloads.html

  1. Download package
  2. Choose initialize from within the app
  3. Make note of your database information (port, name, username, and password)
(Commands that may be useful once you are in the psql cli)
* \list or \l: list all databases
* \c <db name>: connect to a certain database
* \dt: list all tables in the current database using your search_path
* \dt *.: list all tables in the current database regardless your search_path

Installing the API

  1. Clone repo
  2. npm install
  3. Create a .env file and add the following
HOST=0.0.0.0
PORT=1337
APP_KEYS=your api key 
JWT_SECRET=your jws secret
TRANSFER_TOKEN_SALT=your api token salt
DATABASE_HOST=
DATABASE_PORT=
DATABASE_NAME=
DATABASE_USERNAME=
DATABASE_PASSWORD=
DATABASE_SSL=false
(Make sure db host, port, name, username, and password match your settings previously created in your local psql db creation)
  1. npm run develop
  2. Visit on localhost:1337
  3. Pull in the db From the production site info coming soon

Development/Workflow

As of Nov 2023 All work is being done on the master branch until further notice. Anywhere that is says staging is to be replaced with master.

  1. Make sure you pull down all the latest code (staging). (Crucial)
  2. Note: (If the production data is needed) Transfer data from remote instance to your local instance
    1. In a new terminal window, navigate to the root directory of the destination instance.
    1. npm run strapi transfer -- --from remoteURL
    1. Add the transfer token when prompted to do so.
    1. Answer Yes or No to the CLI prompt: "The transfer will delete all of the local Strapi assets and its database. Are you sure you want to proceed?".
  1. Create a new branch for development (should be linked to a github issue)
  2. Once task is completed and tested push up the branch and create a PR to staging and tag team mates for review.
  3. For deployment see "RENCI Deployment" section.

Amazon Web Services Specific

Restoring the database

To restore a DB instance from a DB snapshot https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_RestoreFromSnapshot.html

  1. Sign in to the AWS Management Console and open the Amazon RDS console at https://console.aws.amazon.com/rds/.
  2. In the navigation pane, choose Snapshots.
  3. Choose the DB snapshot that you want to restore from.
  4. For Actions, choose Restore snapshot.
  5. On the Restore snapshot page, for DB instance identifier, enter the name for your restored DB instance.
  6. Specify other settings, such as allocated storage size.
  7. For information about each setting, see Settings for DB instances.
  8. Choose Restore DB instance.
  9. Take note of the new endpoint which can be found in Connectivity & Security in RDS
  10. SSH into the server
  11. Open up ecosystem.config.js and change the value for DATABASE_HOST to the new endpoint.
  12. Save
  13. RUN pm2 restart ecosystem.config.js