Skip to content
This repository has been archived by the owner on May 1, 2021. It is now read-only.

seanblonien/archway

Repository files navigation

Archway

How to Run the Project

The following steps take you through the required steps to install, build, and run the project locally.

  1. Download and install Docker to your computer (verify with Docker -v and docker-compose -v in a terminal).
  2. Download and install Node to your computer so tht we can install our node packages (verify with npm -v in a terminal).
  3. Clone this repository using git clone <url> or your favorite git client.
  4. In a terminal, navigate to the repository directory that you just cloned.
  5. Run docker-compose build to build all of the required Docker images for the project.
  6. Run npm install in the same directory to install all dependencies for the front end app (this is run locally, and not in the container, so that files may be edited in real time and updated in the container).
  7. Once that is done, run docker-compose up to start all of the Docker containers (database, strapi, and app).
    • NOTE: if this is your first time starting, this may take several minutes.
    • NOTE: windows users may have to type net stop http to use port 80

How to Import Data

There won't be anything in the database or backend yet, so you have to import a schema and data to start off with a running project.

Basic Import

Steps
  1. Verify you have Node installed with node -v in a terminal.
  2. Ensure that the project is running successfully (using previous steps) by seeing this in the Strapi Docker container logs. If you do not see this yet, then it is possible the container is still starting up.
    • One more thing...
      Create your first administrator 💻 by going to the administration panel at:
      ┌─────────────────────────────┐
      │ http://localhost:1337/admin │
      └─────────────────────────────┘
    • NOTE: DON'T OPEN YOUR BROWSER YET - the scripts will handle admin account (credentials in last step) creation for you.

    • NOTE: if this is your first time starting, this may take several minutes.

  3. Run npm run import to import all of the required data for project.
  4. Launch the Strapi admin panel (i.e. localhost:1337) to see the new content types and imported data! The username is admin and the password is capstone for the Strapi admin panel.

Advanced Import

If you want more control over what is imported, you can run the specific import scripts to have more control. Why would you want to do this?

  • Import different exports/schemas/data during testing
  • Avoid overwriting data that is in your database, Strapi, or uploads
  • Restore specific backup file
Steps
  1. With the project running successfully, navigate to the database folder of the project (i.e. cd database in project root).
  2. Run node import-strapi.js <strapi-export-file> to import a Strapi schema of content types.
  3. Run node import-database.js <database-export-file> to import the database content that matches the Strapi schema content types.
  4. Run node import-uploads.js <uploads-export-file> to import the file uploads (i.e. images) into the Strapi container.
  5. Each of the scripts take a file as the argument for where to import the data from. These files must come from a data export. For example files, see the BaseExport files which is what the npm run import script uses.

NOTE: You can run any import over and over again. The Strapi import creates and updates what is needed. The uploads import does not delete any newly added data, it just creates or overwrites files. However, the database import is a destructive operation due to the database dump constraints.

How to Export Data

Once you have the project running locally, you may make changes to the project that will require exporting. Why would you want to do this?

  • Create backups and check points
  • Persist Strapi content type schema changes in Git
  • Persist database changes in Git
  • Persist uploads (images) changes in Git
  • Manipulate project schema and data without fear of losing something that works

All of the imports use files created by exporting.

Basic Export

Steps
  1. With the project running successfully, in the project directory, run npm run export to export all of the current data from Strapi, the database, and the file uploads into their own export files, all named variants of BaseExport.
  2. Export created! Running npm run import will restore/import this export.

Advanced Export

Steps
  1. With the project running successfully, navigate to the database folder of the project (i.e. cd database in project root).
  2. Run node export-strapi.js <filename> to export all of the current content types in your Strapi container. You must give the export a filename for it to be created. File format is .json.
  3. Run node export-database.js <filename> to export the Strapi database data. You must give the export a filename for it to be created. File format is .zip.
  4. Run node export-uploads.js <filename> to export the Strapi file uploads data (i.e. images for the sponsors or users). You must give the export a filename for it to be created. File format is .zip.
  5. These three files will be created in the current directory under the given filenames and can be used to in an import on an running instance of the project.

About

Baylor CSI 4337 Capstone Team Project

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages