Giter VIP home page Giter VIP logo

strapi's Introduction

sidebar_position
1

Start Strapi

Clone the Repository to Your Local Machine

# Clone the repository
git clone [email protected]:frameless/strapi.git

# Navigate to the project directory
cd frameless-cms

Prepare the App

Before running the app, make sure you have the following prerequisites installed on your machine:

Follow these steps to prepare the app:

  1. Open your terminal and navigate to the root level of the app.

  2. Install Dependencies:

    yarn install
  3. Build the Project:

    yarn build

These commands will ensure that all necessary dependencies are installed and the project is built successfully. Once completed, you'll be ready to run the app.

Start the Server using Docker

To run the application as a Docker container on your Mac, follow these steps:

  1. Install Docker Desktop:

    • Go to the Docker website and download Docker Desktop for Mac.
    • Install Docker Desktop by following the installation instructions for macOS.
    • Ensure you have docker-compose available. For example by installing docker-compose with Homebrew
  2. Launch Docker Desktop:

    • Once Docker Desktop is installed, launch it from your Applications folder.
  3. Add Environments variables to the project

    Create two files in the project root: .project-name.prod.env and .project-name.dev.env (replace "project-name" with your specific project name, e.g., .pdc.prod.env and .pdc.dev.env). If these files don't exist already, copy the environment variables provided below into these files. The project file will be copied to .env when starting said app.

       ADMIN_JWT_SECRET=someSecretKey==
       API_TOKEN_SALT=someRandomLongString==
       APP_KEYS=key1==,key2==,key3==,key4==
       CSP_CONNECT_SRC_URLS=
       CSP_FONT_SRC_URLS=
       CSP_FORM_ACTION_URLS=
       CSP_FRAME_SRC_URLS=
       CSP_IMG_SRC_URLS=
       CSP_SCRIPT_SRC_URLS=
       CSP_STYLE_SRC_URLS=
       CSP_WORKER_SRC_URLS=
       DATABASE_CLIENT=postgres
       DATABASE_HOST=0.0.0.0
       DATABASE_NAME=postgres
       DATABASE_PASSWORD=strapi
       DATABASE_PORT=5432
       DATABASE_SSL=false
       DATABASE_USERNAME=postgres
       FRONTEND_PUBLIC_URL=http://localhost:3000
       FRONTEND_PUBLIC_URL=http://localhost:3000
       HOST=0.0.0.0
       JWT_SECRET=someOtherSecretKey==
       MATOMO_HOST=
       MATOMO_SITE_ID=
       NODE_ENV=development
       OGONE_PAYMENT_SERVICE_URL=
       OPEN_FORMS_API_TOKEN=
       OPEN_FORMS_API_TOKEN=
       OPEN_FORMS_API_URL=http://localhost:8000/api/v2/
       OPEN_FORMS_API_URL=http://localhost:8000/api/v2/
       OPEN_FORMS_CSS_URL=http://localhost:8000/static/sdk/open-forms-sdk.css
       OPEN_FORMS_SDK_URL=http://localhost:8000/static/sdk/open-forms-sdk.js
       PANDOSEARCH_API_URL= # You can use the following API URL to test the functionality of the SearchBar component: https://public.pandosearch.com/developer.pandosearch.com/. Valid keys that can be used in the searchBar field include: search, server, highlighting, and help.
       [email protected]
       PGADMIN_DEFAULT_PASSWORD=root
       PORT=1337
       PREVIEW_SECRET_TOKEN=someSecretToken== # gained from tribal knowledge
       STRAPI_ENV_LABEL=
       STRAPI_PRIVATE_URL=http://pdc_strapi:1337
       STRAPI_PUBLIC_URL=http://pdc_strapi:1337
       SURVEY_RUN_APIKEY=
       SURVEY_RUN_GUID=
       SURVEY_RUN_URL=
       TRANSFER_TOKEN_SALT=anotherRandomLongString==
  4. Run the Docker Image:

    Start the environment with the following commands:

    # development
    
    cd bin/ && bash ./deploy.sh project-name dev up --build # or
    
    # example cd bin/ && bash ./deploy.sh pdc-dashboard dev up --build
    
    # production
    cd bin/ && bash ./deploy.sh project-name prod up --build
    
    # example cd bin/ && bash ./deploy.sh pdc-dashboard prod up --build

    Valid project names are:

    • pdc-dashboard
    • vth-dashboard
    • kennisbank-dashboard

    Visit http://localhost:1337/admin to set up an admin account. Afterward, configure the right permissions for unauthenticated users and field labels in Settings > CONFIG SYNC > Interface. Click the Import Button.

    Now, you can create products and FAQ items using the Content Manager and view them on the frontend: http://localhost:3000/.

Environments Variables Types

Variable name Description Type Default Value Application Note
ADMIN_JWT_SECRET Secret for signing JWTs for the Admin panel String strapi-dashboard Admin panel configuration
APP_KEYS The secret key for session cookie signing String strapi-dashboard Server configuration
API_TOKEN_SALT Salt for generating API tokens String strapi-dashboard Admin panel configuration
CSP_CONNECT_SRC_URLS Space-separated list of URLs to allow in Content-Security-Policy for connect-src
CSP_FONT_SRC_URLS Space-separated list of URLs to allow in Content-Security-Policy for font-src
CSP_FORM_ACTION_URLS Space-separated list of URLs to allow in Content-Security-Policy for form-action
CSP_FRAME_SRC_URLS Space-separated list of URLs to allow in Content-Security-Policy for frame-src
CSP_IMG_SRC_URLS Space-separated list of URLs to allow in Content-Security-Policy for img-src
CSP_SCRIPT_SRC_URLS Space-separated list of URLs to allow in Content-Security-Policy for script-src
CSP_STYLE_SRC_URLS Space-separated list of URLs to allow in Content-Security-Policy for style-src
CSP_WORKER_SRC_URLS Space-separated list of URLs to allow in Content-Security-Policy for worker-src
DATABASE_CLIENT Database client to use String sqlite strapi-dashboard Reference to Strapi Database docs
DATABASE_HOST Database host String strapi-dashboard Reference to Strapi Database docs
DATABASE_NAME Database name String strapi-dashboard Reference to Strapi Database docs
DATABASE_PASSWORD Database password String strapi-dashboard Reference to Strapi Database docs
DATABASE_PORT Database port String strapi-dashboard Reference to Strapi Database docs
DATABASE_SSL For SSL database connection. Use an object to pass certificate files as strings. Boolean or Object strapi-dashboard Reference to Strapi Database docs
DATABASE_USERNAME Database username String strapi-dashboard Reference to Strapi Database docs
FRONTEND_PUBLIC_URL String strapi-dashboard
HOST Number strapi-dashboard Admin panel configuration
I18N_DEBUG When I18N_DEBUG is set, the i18next package will log debug information. String frontend
JWT_SECRET Secret for signing JWTs for the Users-Permissions plugin String strapi-dashboard Admin panel configuration
MATOMO_HOST PDC ONLY / Optional: URL for Matomo URL FRONTEND
MATOMO_SITE_ID PDC ONLY / Optional: container ID for Matomo String FRONTEND
NODE_ENV production | development
OPEN_FORMS_API_TOKEN PDC ONLY: A Token for Open Forms API String strapi-dashboard / frontend
OPEN_FORMS_API_URL PDC ONLY: URL for Open Forms API (usually the origin + /api/v2) String frontend / strapi-dashboard
OPEN_FORMS_CSS_URL PDC ONLY / Optional: URL for Open Forms CSS String frontend
OPEN_FORMS_SDK_URL PDC ONLY / Optional : URL for Open Forms SDK String frontend
PANDOSEARCH_API_URL PDC ONLY String frontend
PGADMIN_DEFAULT_EMAIL String Database
PGADMIN_DEFAULT_PASSWORD String Database
PORT Port on which the server should be running. Number 1337 strapi-dashboard
PREVIEW_SECRET_TOKEN The secret used for the Strapi preview plugin should have the same value for both the frontend and the Strapi dashboard. String strapi-dashboard frontend
STRAPI_PRIVATE_URL String frontend
STRAPI_PUBLIC_URL URL Frontend The Strapi dashboard URL, e.g.,http://localhost:1337/
TRANSFER_TOKEN_SALT Salt for generating Transfer tokens. If no transfer token salt is defined, transfer features will be disabled. String strapi-dashboard Admin panel configuration Secrets can be generated manually by running node -p "require('crypto').randomBytes(48).toString('base64');"
OGONE_PAYMENT_SERVICE_URL PDC ONLY: URL for Open Forms/Payment URL Frontend
SURVEY_RUN_GUID PDC ONLY: Used for the Survey service String Fronend
SURVEY_RUN_APIKEY PDC ONLY: Used for the Survey service String Fronend
SURVEY_RUN_URL PDC ONLY: Used for the Survey service URL Fronend

Start the server without Docker

Before starting the server without Docker, create a .env file for both the frontend and the Strapi dashboard app.

Frontend env:

FRONTEND_PUBLIC_URL=http://localhost:3000
# these three environments variables below are required to be able to test the openFormsEmbed into the frontend. So you have to start the OpenForms server on your local machine
OPEN_FORMS_API_URL=http://localhost:8000/api/v2/
OPEN_FORMS_CSS_URL=http://localhost:8000/static/sdk/open-forms-sdk.css
OPEN_FORMS_SDK_URL=http://localhost:8000/static/sdk/open-forms-sdk.js
OPEN_FORMS_API_TOKEN=
PANDOSEARCH_API_URL= # You can use the following API URL to test the functionality of the SearchBar component: https://public.pandosearch.com/developer.pandosearch.com/. Valid keys that can be used in the searchBar field include: search, server, highlighting, and help.
PREVIEW_SECRET_TOKEN= # the value should matched the same environment variable on the Strapi dashboard
STRAPI_PRIVATE_URL=http://0.0.0.0:1337/
STRAPI_PUBLIC_URL=http://0.0.0.0:1337/
SURVEY_RUN_APIKEY=
SURVEY_RUN_GUID=
SURVEY_RUN_URL=

Strapi Dashboard env:

NODE_ENV=development
ADMIN_JWT_SECRET=
API_TOKEN_SALT=
APP_KEYS=
FRONTEND_PUBLIC_URL=http://localhost:3000
HOST=0.0.0.0
JWT_SECRET=
OPEN_FORMS_API_TOKEN=
OPEN_FORMS_API_URL=http://localhost:8000/api/v2/
PORT=1337
# the value should matched the same environment variable on the Frontend
PREVIEW_SECRET_TOKEN=
STRAPI_PRIVATE_URL=http://0.0.0.0:1337
STRAPI_PUBLIC_URL=http://0.0.0.0:1337
TRANSFER_TOKEN_SALT=

Two Options to Run the Server

  1. Using the Start Script:

    • Navigate to the app's root level and run the following command:

      yarn development
    • You will be prompted with options to select. For example:

          ❯ yarn development
          yarn run v1.22.19
          $ node scripts/start.js
          ? Select an option: …
          Build # build a specific app or both
          ❯ Dev # start a development server for a specific app or both
          Start # start a production server for a specific app or both
    • Choose the "Dev" option to start a development server for the specified app.

  2. Basic Way:

    • Change to the app's directory (e.g., cd apps/pdc-dashboard) and run:

          yarn dev
  3. Using Yarn Workspaces:

    • Run the following command from the project root:
        yarn workspace @frameless/pdc-dashboard dev

Choose the option that best fits your workflow to start the server without Docker. Once the server is running, you can access the application from your browser.

FAQ

I Have Issues with Building the Project or Starting the Server

If you encounter problems with building the project or starting the server, try the following steps:

  1. Remove Build Folders:

    • Execute the following commands from the app root level:

      yarn clean
      yarn build
    • This will remove the /build or /dist folders and rebuild the entire project.

  2. Remove Node Modules:

    • If the issue persists, remove the node_modules folders for all the apps using the command:

      npx npkill
    • Afterward, reinstall the dependencies with:

      yarn install

These steps can help resolve common issues related to project build and server startup. If you continue to face problems, feel free to reach out for further assistance.

strapi's People

Contributors

alikdhim87 avatar semantic-release-bot avatar bddjong avatar robbert avatar savitris avatar meesopost avatar scar055 avatar yolijn avatar frameless-devops avatar marwaxhello avatar bartjkdp avatar dependabot[bot] avatar

Stargazers

 avatar Olling avatar Jeroen du Chatinier avatar

Watchers

 avatar  avatar  avatar

strapi's Issues

Page edit history

Gemeente Utrecht heeft in hun huidige systeem (Typo3) een pagina wijzigingg historie. Daarmee kunnen zij oudere versies van paginas terug halen. Daarnaast kunnen verwijderde paginas uit een 'prullenbak' gehaald worden.

Spotlight names should be renamed.

type= "default | info | warning" => " Grijs | Blauw | Geel"

Op dit moment kunnen we de label niet direct aan de lijst koppelen. We moeten ons eigen aangepaste veld maken, zodat we later een scheiding tussen de API-eigenschap en de label kunnen aanbrengen.

Voorbeeld:

API Label
default Grijs
info Blauw
warning Geel

The automated release is failing 🚨

🚨 The automated release from the main branch failed. 🚨

I recommend you give this issue a high priority, so other packages depending on you can benefit from your bug fixes and new features again.

You can find below the list of errors reported by semantic-release. Each one of them has to be resolved in order to automatically publish your package. I’m sure you can fix this 💪.

Errors are usually caused by a misconfiguration or an authentication problem. With each error reported below you will find explanation and guidance to help you to resolve it.

Once all the errors are resolved, semantic-release will release your package the next time you push a commit to the main branch. You can also manually restart the failed CI job that runs semantic-release.

If you are not sure how to resolve this, here are some links that can help you:

If those don’t help, or if this issue is reporting something you think isn’t right, you can always ask the humans behind semantic-release.


No npm token specified.

An npm token must be created and set in the NPM_TOKEN environment variable on your CI environment.

Please make sure to create an npm token and to set it in the NPM_TOKEN environment variable on your CI environment. The token must allow to publish to the registry https://npm.pkg.github.com.


Good luck with your project ✨

Your semantic-release bot 📦🚀

Collection type - Print pagina ondersteuning

Een "mega" pagina waar alle site inhoud te zien is voor print to PDF. Deze pagina moet niet vindbaar zijn in de navigatie en het liefste een unique URL hebben die ook niet door zoekmachines geindexeerd wordt.

Page counter

Voor inzicht in hoeveel paginas een organisatie onderdeel in beheer hebben, heeft de gemeente Utrecht een "Page counter" tabje in hun CMS. Hiermee kunnen ze een overzicht zoals het onderstaande voorbeeld zien.

Cultuur - 15
UVO - 8
Publiekszaken - 24
VTH - 17

Test collectie/map

Voor test paginas die niet publiekelijk zichtbaar zijn kan Utrecht in Typo3 paginas aanmaken onder een test folder. Deze zijn dan door ingelogde redacteuren te zien maar niet door anonieme bezoekers.

Strapi datamodel naamgeving consistentie

Fijn als het zoveel mogelijk gebruikte termen Nederlands zijn en BA's verwachten consistentie in de gebruikte termen door de back-end heen: 0,5 dag samen met Joram

Support multiple strapi applications in single repo

We kunnen dit issue gebruiken om obstakels voor meerdere strapi applicaties in een monorepo bij te houden.

  • Building from package root
    • yarn build:{project-name}
    • yarn start:{project-name}
  • Env file conflict
    • De makkelijkste oplossing is dezelfde env file behouden, maar dat vereist dat developers per applicatie een clone van de repo lokaal bijhouden, of steeds hun environment file aanpassen voor de applicatie waar ze op dat moment aan willen werken. Het zou met 1 environment file niet mogelijk zijn om beide projecten vanuit dezelfde folder te lanceren, tenzij we dubbele keys in het bestand zetten. Voorbeeld: pdc-frontend-public-url en vth-frontend-public-url in plaats van alleen frontend-public-url
  • Docker support
  • Shared components
    • Om gedeelde componenten te kunnen onderhouden willen we waarschijnlijk een plugin maken die door beide strapi applicaties geconsumeerd kan worden

Default rechten / rollen

Description

Om tijd te besparen willen we ervoor zorgen dat de vereiste rollen en benodigde rechten voor het CMS en de APIs geseed worden bij deployment.

  • Juiste rol en toegang voor redacteurs
  • Allow anonymous GET collections zodat de frontend bij de data kan

Vragen

  • Kunnen we het admin panel beschermen zodat "groepen" rollen bepaalde onderdelen wel of niet kunnen zien

Image deployment

Description

Hoewel veel van het deployment werk naar verwachting bij Utrecht valt is het slim om voor overzicht van het project bij te houden wat voor resultaten we verwachten.

  • Test/Acceptatie/Productie omgevingen
  • Image storage support

Footer design tweaks

  • Fix content margin
  • Use link list component
    • Update link list component to use web component icon ipv background image token

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.