Git Product home page Git Product logo

documentation's Introduction

Strapi logo Strapi logo

Open-source headless CMS, self-hosted or Cloud you’re in control.

The leading open-source headless CMS, 100% JavaScript/TypeScript, flexible and fully customizable.

Cloud · Try live demo · Strapi 5 (coming soon)


NPM Version Tests Strapi on Discord Strapi Nightly Release Build Status


Administration panel


Strapi Community Edition is a free and open-source headless CMS enabling you to manage any content, anywhere.

  • Self-hosted or Cloud: You can host and scale Strapi projects the way you want. You can save time by deploying to Strapi Cloud or deploy to the hosting platform you want**: AWS, Azure, Google Cloud, DigitalOcean.
  • Modern Admin Panel: Elegant, entirely customizable and a fully extensible admin panel.
  • Multi-database support: You can choose the database you prefer: PostgreSQL, MySQL, MariaDB, and SQLite.
  • Customizable: You can quickly build your logic by fully customizing APIs, routes, or plugins to fit your needs perfectly.
  • Blazing Fast and Robust: Built on top of Node.js and TypeScript, Strapi delivers reliable and solid performance.
  • Front-end Agnostic: Use any front-end framework (React, Next.js, Vue, Angular, etc.), mobile apps or even IoT.
  • Secure by default: Reusable policies, CORS, CSP, P3P, Xframe, XSS, and more.
  • Powerful CLI: Scaffold projects and APIs on the fly.

Getting Started

Read the Getting Started tutorial or follow the steps below:

⏳ Installation

Install Strapi with this Quickstart command to create a Strapi project instantly:

yarn create strapi-app my-project --quickstart

or

  • (Use npm/npx to install the Strapi project.)
npx create-strapi-app my-project --quickstart

This command generates a brand new project with the default features (authentication, permissions, content management, content type builder & file upload). The Quickstart command installs Strapi using a SQLite database which is used for prototyping in development.

Enjoy 🎉

🖐 Requirements

Complete installation requirements can be found in the documentation under Installation Requirements.

Supported operating systems:

  • Ubuntu LTS/Debian 9.x
  • CentOS/RHEL 8
  • macOS Mojave
  • Windows 10
  • Docker

(Please note that Strapi may work on other operating systems, but these are not tested nor officially supported at this time.)

Node:

Strapi only supports maintenance and LTS versions of Node.js. Please refer to the Node.js release schedule for more information. NPM versions installed by default with Node.js are supported. Generally it's recommended to use yarn over npm where possible.

Strapi Version Recommended Minimum
4.14.5 and up 20.x 18.x
4.11.0 and up 18.x 16.x
4.3.9 to 4.10.x 18.x 14.x
4.0.x to 4.3.8 16.x 14.x

Database:

Database Recommended Minimum
MySQL 8.0 5.7.8
MariaDB 10.6 10.3
PostgreSQL 14.0 11.0
SQLite 3 3

We recommend always using the latest version of Strapi stable to start your new projects.

Features

  • Content Types Builder: Build the most flexible publishing experience for your content managers, by giving them the freedom to create any page on the go with fields, components and Dynamic Zones.
  • Media Library: Upload your images, videos, audio or documents to the media library. Easily find the right asset, edit and reuse it.
  • Internationalization: The Internationalization (i18n) plugin allows Strapi users to create, manage and distribute localized content in different languages, called "locales"
  • Role Based Access Control: Create an unlimited number of custom roles and permissions for admin and end users.
  • GraphQL or REST: Consume the API using REST or GraphQL

You can unlock additional features such as SSO, Audit Logs, Review Workflows in Strapi Cloud or Strapi Enterprise.

See more on our website.

Contributing

Please read our Contributing Guide before submitting a Pull Request to the project.

Community support

For general help using Strapi, please refer to the official Strapi documentation. For additional help, you can use one of these channels to ask a question:

Migration

Follow our migration guides on the documentation to keep your projects up-to-date.

Roadmap

Check out our roadmap to get informed of the latest features released and the upcoming ones. You may also give us insights and vote for a specific feature.

Documentation

See our dedicated repository for the Strapi documentation, or view our documentation live:

Try live demo

See for yourself what's under the hood by getting access to a hosted Strapi project with sample data.

License

See the LICENSE file for licensing information.

documentation's People

Contributors

alexandrebodin avatar bidoubiwa avatar bigpreshy avatar boegie19 avatar bolg55 avatar convly avatar cpaczek avatar derrickmehaffy avatar eventyret avatar gpene avatar gu-stav avatar innerdvations avatar jhoward1994 avatar joshuaellis avatar kai687 avatar kasonde avatar laurenskling avatar markkaylor avatar mattiebelt avatar mbonujennifer avatar mcastres avatar meganelacheny avatar petersg83 avatar pwizla avatar soupette avatar stb13579 avatar udimberto avatar walkingpizza avatar yuyokk avatar zpain8464 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

documentation's Issues

strapi.log.debug({ someObject }) logs 'undefined'

Bug report

Describe the bug

strapi.log.debug() cannot be used to print objects unless you pass a string as a first argument first.

Steps to reproduce the behavior

  1. Put strapi.log.debug({works: false}) in your code
  2. Run your code
  3. See undefined printed rather than your passed object
  4. Put strapi.log.debug("", {works: true}) in your code
  5. Run your code
  6. See your passed object printed

Expected behavior

I expect strapi.log.debug() to print exactly what I passed, prefixed with a timestamp.

System

  • Strapi version: 3.4.5

Cannot Write into SQLite3 during unit test

Bug report

Describe the bug

I was following the strapi testing documentation when this arose.

I was trying to test a strapi endpoint and inserting user data into the db when it can gave an error that data could not be inserted into read-only db

I have just copied this test - https://strapi.io/documentation/developer-docs/latest/guides/unit-testing.html#testing-auth-endpoint-controller

const userData = {
  username: 'tester',
  email: '[email protected]',
  provider: 'local',
  password: '1234abc',
  confirmed: true,
  blocked: null,
};

beforeEach(async () => {
			await strapi.plugins['users-permissions'].services.user.add({
				...userData,
			});
		});

The error was this

"before each" hook for "blank request does not give 2xx status code":
     insert into `users-permissions_user` (`blocked`, `confirmed`, `created_at`, `email`, `password`, `provider`, `updated_at`, `username`) values (NULL, true, '2021-01-10 20:15:14.452', '[email protected]', '$2a$10$o/DBLodkVtamQOK.4HHm3Opi6lkB33EVOzswaVOsipEfwtByNaOGW', 'local', '2021-01-10 20:15:14.452', 'tester') - SQLITE_READONLY: attempt to write a readonly database              
  Error: SQLITE_READONLY: attempt to write a readonly database

Steps to reproduce the behavior

Follow the testing documentation - https://strapi.io/documentation/developer-docs/latest/guides/unit-testing.html

Expected behavior

Data to be inserted in the db.

Screenshots

image

Code snippets

My test config for the db is this:

{
		defaultConnection: 'default',
		connections: {
			default: {
				connector: 'bookshelf',
				settings: {
					client: 'postgres',
					database: dbConfig.database,
					host: dbConfig.host,
					port: dbConfig.port,
					username: dbConfig.user,
					password: dbConfig.password,
					ssl: {
						rejectUnauthorized: false,
					},
				},
				options: {
					ssl: true,
				},
			},
		},
	};

System

  • Node.js version: 12.20.1
  • NPM version: 6.14.10
  • Strapi version: 3.4.1
  • Database: SQLite3
  • Operating system: Ubuntu 20.04

Additional context

Add any other context about the problem here.

JWT authentication - HTTP 403 - Invalid credentials - `strapi develop`

Describe the bug
When running Strapi with a custom JWT_TOKEN, login works and returns a JWT. Using this JWT to authenticate API requests results in HTTP 403 with the message "Invalid credentials".

The only way for me to avoid this is to delete jwt.js and let Strapi auto-generate the file. As soon as I change the file, authentication breaks again, and can again only be fixed by deleting jwt.js.

Steps to reproduce the behavior

  1. Create jwt.js exactly as per https://strapi.io/documentation/v3.x/plugins/users-permissions.html#security-configuration
  2. Start Strapi strapi develop
  3. UI: Create user, add to predefined "Authenticated" group. Allow "Authenticated" to "find" on the resource.
  4. Log in - POST /auth/local . Succeeds and returns a JWT.
  5. GET /my-resource with header "Authorization: " returns HTTP 403, "Invalid credentials".

If Step 1. is omitted and jwt.js is deleted instead, the bug does not happen.

Expected behavior
GET /my-resource returns HTTP 200 and data, like what's described before when the jwt.js is re-generated.

Screenshots
image

Code snippets
jwt.js

module.exports = {
  jwtSecret: process.env.JWT_SECRET
};

I verified that JWT_SECRET is set.

System

  • Node.js version: v10.16.3
  • NPM version: v6.13.4
  • Strapi version: v3.1.3
  • Database: PostgreSQL
  • Operating system: linux

[Request]: Document RedHat Operating system

Summary

Currently our documentation only offers commands for Ubuntu based linux distributions, as we also support RedHat these should be documented.

Why is it needed?

RedHat is an operating system that Strapi supports, and is generally used within enterprise environments.

Suggested solution(s)

Work through documentation to locate Ubuntu based guides and update them to add in specific RedHat commands as well. Similarly we need to document OS requirements (packages) needed within RedHat based systems.

Related issue(s)/PR(s)

Internal TID102

[Bug]: CKEditor doesn't populate with actual data

Link to the documentation page or resource

https://strapi.io/documentation/developer-docs/latest/guides/registering-a-field-in-admin.html#introduction

Describe the bug

Using the current documentation, the CKEditor shows up but doesn't populate with the data related to the rich text input it's representing

Additional context

Node : 12.20.0
Strapi : 3.4.6

Suggested improvements or fixes

The problem comes from the file /plugins/wysiwyg/admin/src/components/Wysiwyg/index.js because the Editor component is rendered even if the value prop is still null. As a hotfix I added conditional rendering {value && <Editor name={name} onChange={onChange} value={value} />} but it must have a cleaner solution.

Related issue(s)/PR(s)

No response

[Request]: Combination of different fields to make a UID field

Summary

Hi first I love Strapi as noob I like the feature to add a field for UIDs but it could be awsome have an option to mix more than one fields to make a UID 😍.

Why is it needed?

It's very helpful creating UID for schools by combining class name, group name and roll number to make and id like
👉 CLS9-SCI-123 [Class-Group-Roll]
Or in banking system like branch and account number and type like 👉 NYC-12458447854-SVN [Btanch-Acc No-Savings]

Suggested solution(s)

Add multiple choice options in UID field 😍

Related issue(s)/PR(s)

No response

[Bug]: The lifecycle hooks example crashes

Link to the documentation page or resource

https://strapi.io/documentation/developer-docs/latest/concepts/models.html#lifecycle-hooks

Describe the bug

Following the example on the documentation about how to create a lifecycle hook causes an error.

I added the following code to ./api/user/models/User.js

module.exports = {
  lifecycles: {
    async beforeCreate(data) {
      console.log(data);
    },
  },
};

Upon executing strapi develop, I got the following error:

[2021-02-10T09:42:37.029Z] debug ⛔️ Server wasn't able to start properly.
[2021-02-10T09:42:37.030Z] error TypeError: Cannot convert undefined or null to object
at Function.keys ()
at checkReservedAttributeNames (/home/user/dev/trying-strapi/node_modules/strapi-database/lib/validation/check-reserved-names.js:33:60)
at /home/user/dev/trying-strapi/node_modules/strapi-database/lib/validation/check-reserved-names.js:62:5
at Array.forEach ()
at module.exports (/home/user/dev/trying-strapi/node_modules/strapi-database/lib/validation/check-reserved-names.js:60:68)
at validateModelSchemas (/home/user/dev/trying-strapi/node_modules/strapi-database/lib/validation/index.js:8:3)
at DatabaseManager.initialize (/home/user/dev/trying-strapi/node_modules/strapi-database/lib/database-manager.js:34:5)
at Strapi.load (/home/user/dev/trying-strapi/node_modules/strapi/lib/Strapi.js:339:19)
at async Strapi.start (/home/user/dev/trying-strapi/node_modules/strapi/lib/Strapi.js:191:9)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] develop: strapi develop
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] develop script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /home/user/.npm/_logs/2021-02-10T09_42_37_049Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] dev: npm run develop
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /home/user/.npm/_logs/2021-02-10T09_42_37_084Z-debug.log

The contents of the log file are the following ones:

0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli '/home/user/.nvm/versions/node/v14.15.4/bin/node',
1 verbose cli '/home/user/.nvm/versions/node/v14.15.4/bin/npm',
1 verbose cli 'run',
1 verbose cli 'dev'
1 verbose cli ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'predev', 'dev', 'postdev' ]
5 info lifecycle [email protected]predev: [email protected]
6 info lifecycle [email protected]
dev: [email protected]
7 verbose lifecycle [email protected]dev: unsafe-perm in lifecycle true
8 verbose lifecycle [email protected]
dev: PATH: /home/user/.nvm/versions/node/v14.15.4/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/home/user/dev/trying-strapi/node_modules/.bin:/home/user/.vscode-server/bin/5d424b828ada08e1eb9f95d6cb41120234ef57c7/bin:/home/user/.nvm/versions/node/v14.15.4/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/mnt/c/Python27/:/mnt/c/Python27/Scripts:/mnt/c/Windows/system32:/mnt/c/Windows:/mnt/c/Windows/System32/Wbem:/mnt/c/Windows/System32/WindowsPowerShell/v1.0/:/mnt/c/Windows/System32/OpenSSH/:/mnt/c/Program Files (x86)/Intel/Intel(R) Management Engine Components/DAL:/mnt/c/Program Files/Intel/Intel(R) Management Engine Components/DAL:/mnt/c/Program Files (x86)/NVIDIA Corporation/PhysX/Common:/mnt/c/Program Files/NVIDIA Corporation/NVIDIA NvDLISR:/mnt/c/Program Files/nodejs/:/mnt/c/ProgramData/chocolatey/bin:/mnt/c/Program Files (x86)/Microsoft SQL Server/140/Tools/Binn/:/mnt/c/Program Files/Microsoft SQL Server/140/Tools/Binn/:/mnt/c/Program Files (x86)/Microsoft SQL Server/140/DTS/Binn/:/mnt/c/Program Files/Microsoft SQL Server/140/DTS/Binn/:/mnt/c/Program Files/Microsoft SQL Server/Client SDK/ODBC/130/Tools/Binn/:/mnt/c/Program Files (x86)/Microsoft SQL Server/150/DTS/Binn/:/mnt/c/Program Files/Microsoft SQL Server/130/Tools/Binn/:/mnt/c/Program Files/Microsoft SQL Server/Client SDK/ODBC/170/Tools/Binn/:/mnt/c/WINDOWS/system32:/mnt/c/WINDOWS:/mnt/c/WINDOWS/System32/Wbem:/mnt/c/WINDOWS/System32/WindowsPowerShell/v1.0/:/mnt/c/WINDOWS/System32/OpenSSH/:/mnt/c/Program Files/dotnet/:/mnt/c/Program Files (x86)/dotnet/:/mnt/c/Program Files/Git/cmd:/mnt/c/Users/AdriàLópezOrtega/AppData/Local/Microsoft/WindowsApps:/mnt/c/Users/AdriàLópezOrtega/AppData/Roaming/npm:/mnt/c/Users/AdriàLópezOrtega/AppData/Local/Programs/Microsoft VS Code/bin:/mnt/c/Users/AdriàLópezOrtega/.dotnet/tools:/mnt/c/Users/AdriàLópezOrtega/AppData/Local/Programs/Fiddler:/mnt/c/Users/AdriàLópezOrtega/AppData/Local/Microsoft/WindowsApps:/mnt/c/Program Files (x86)/Rico Suter/NSwagStudio/:/mnt/c/Users/AdriàLópezOrtega/.dotnet/tools:/mnt/c/Users/AdriàLópezOrtega/AppData/Local/gitkraken/bin:/snap/bin
9 verbose lifecycle [email protected]dev: CWD: /home/user/dev/trying-strapi
10 silly lifecycle [email protected]
dev: Args: [ '-c', 'npm run develop' ]
11 silly lifecycle [email protected]dev: Returned: code: 1 signal: null
12 info lifecycle [email protected]
dev: Failed to exec dev script
13 verbose stack Error: [email protected] dev: npm run develop
13 verbose stack Exit status 1
13 verbose stack at EventEmitter. (/home/user/.nvm/versions/node/v14.15.4/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:332:16)
13 verbose stack at EventEmitter.emit (events.js:315:20)
13 verbose stack at ChildProcess. (/home/user/.nvm/versions/node/v14.15.4/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:315:20)
13 verbose stack at maybeClose (internal/child_process.js:1048:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5)
14 verbose pkgid [email protected]
15 verbose cwd /home/user/dev/trying-strapi
16 verbose Linux 5.4.72-microsoft-standard-WSL2
17 verbose argv "/home/user/.nvm/versions/node/v14.15.4/bin/node" "/home/user/.nvm/versions/node/v14.15.4/bin/npm" "run" "dev"
18 verbose node v14.15.4
19 verbose npm v6.14.10
20 error code ELIFECYCLE
21 error errno 1
22 error [email protected] dev: npm run develop
22 error Exit status 1
23 error Failed at the [email protected] dev script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]

Additional context

System
     OS: Microsoft Windows [Version 10.0.19042.746]
     WSL: 5.4.72-microsoft-standard-WSL2
     Ubuntu Version: 20.04.1 LTS (Focal Fossa)
Node
     Node: 14.15.4
     npm: 6.14.10

Suggested improvements or fixes

While creating this PR #102 I mentioned that User model lifecycle hooks should be placed at ./extensions/users-permissions/models/User.js. That works for me in diferent local environments and in Heroku.

In case ./api/user/models/User.js was the previous place for that file and at some point the path was changed to the one I mentioned in that PR, I'd suggest to just modify the path in the documentation.

Related issue(s)/PR(s)

No response

Adjust rewrite logic on sample proxy configurations

See: #156 (comment)

Informations

  • Node.js version: 10.14.1
  • NPM version: 6.4.1
  • Strapi version: 3.0.0-alpha.23.1
  • Database: mongodb
  • Operating system: Windows 10 Pro

What is the current behavior?
I am running next.js and strapi.js together on two separated docker containers with docker-compose.
I want Nginx to redirect all the request from www.mydomain.com/admin to strapi admin page.
This is my nginx config:

server {
    listen 80;
    server_name localhost;

    location /admin/ {
        proxy_pass http://api:1337/admin/;
    }

    location / {
        proxy_pass http://frontend:3000;
    }
}

and my server.json

{
  "host": "localhost",
  "port": "${process.env.PORT || 1337}",
  "production": true,
  "proxy": {
    "enabled": false
  },
  "autoReload": {
    "enabled": false
  },
  "cron": {
    "enabled": false
  },
  "admin": {
    "autoOpen": false
  }
}

Everything works fine and the app starts and works normally. However when I try to access the admin page of strapi I have the following error:

screenshot-localhost-2019 03 16-17-37-11

What is the expected behavior?
Admin page should load normally

Suggested solutions

strapi/docs/v3.x/concepts/routing.md add sample cli call to create route

Feature request

Add a sample call example to create a custom route through cli, similar to controllers.

Please describe your feature request

I was doing my custom controller to do a simple function (does not require a content-type)
my controller was called, "globalcalls", needed it to add a function to get counters and statistics for all my main contents (number of posts, number of comments, number of users)
however, reading the docs to find out how to link the controller function to a route, was not clear. I had to read the cli --help and guess that the generate:api is to create a route (obvious but not too obvious since strapi is all an api)

strapi generate:api globalcalls

this created the custom route file for me

Why is it needed?

I like the docs of strapi and thought it should be consistent between different pages.

Suggested solution(s)

just add the sample code below to the page, similar to the creating controllers page

strapi generate:api globalcalls

[Request]: Collection types add group function.

Summary

For example, I use strapi to manage two websites. On the right side, I use "collection types" to display them in groups. I think this will be better.

Why is it needed?

I use strapi to manage two websites or more, I need search "collection types" not friendly

Suggested solution(s)

Add "collection types" group, on the side, like meunu show information.

Related issue(s)/PR(s)

No response

Documentation correction - Guides - Setup a third party client

Documentation update:

https://strapi.io/documentation/developer-docs/latest/guides/client.html#initialize-the-client

With the current implementation the following code gives an error on startup

Path — ./hooks/github/index.js

const GitHubAPI = require('@octokit/rest');

module.exports = strapi => {
  return {
    async initialize() {
      const { token } = strapi.config.get('hook.settings.github');

      strapi.services.github = new GitHubAPI({
        userAgent: `${strapi.config.get('info.name')} v${strapi.config.get('info.version')}`,
        auth: `token ${token}`,
      });
    },
  };
};

Error

error TypeError: Octokit is not a constructor

Solution - replace above code with following

const { Octokit } = require("@octokit/rest");

module.exports = strapi => {
  return {
    async initialize() {
      const { token } = strapi.config.get('hook.settings.github');

      strapi.services.github = new Octokit({
        userAgent: `${strapi.config.get('info.name')} v${strapi.config.get('info.version')}`,
        auth: `token ${token}`,
      });
    },
  };
};

This is as per https://octokit.github.io/rest.js/v18 documentation

[Request]: How to add custom permissions

Summary

Currently, there is no documentation for developers to add custom permissions that can be added to Admin user roles.

Why is it needed?

When I was building a custom plugin, I found it difficult to figure out how to add custom permissions and a section to the Settings > Administration Panel / Roles > Edit Role page for my plugin.

Suggested solution(s)

There should be documentation added about adding Permissions. I'm thinking this could be at Concepts > Permissions or at Local Plugins > Back-end Development > Permissions.

Related issue(s)/PR(s)

No response

["BUG"] 500 while downloading migrate-3.4.0.js file

Link to the documentation resource

https://github.com/strapi/documentation/blob/documentation/developer-docs/latest/migration-guide/migration-guide-3.3.x-to-3.4.0.md

Describe the bug

When you click on the migrate-3.4.0.js it download an html file with a 500 error

Screenshots

If applicable, add screenshots to help explain your problem.

image

Code snippets

If applicable, add code samples to help explain your problem.

Additional context

Add any other context about the problem here.

[BUG]: GraphQL header example missing quotes

What happened

After installing the graphql using npm.
Then I opened http://localhost:1337/graphql then fetched public data which works fine,
after that I tried to fetched private data which needs the JWT Token.

I copy-paste the header example in the docs. (replaced with working jwt token)

{
  Authorization: "Bearer eyMyVeryLongTokenWhichWorksFineInPostMan"
}

But it returns a super long error JSON with message: "Forbidden" and statusCode: 403 along the line.

It then took me a long time to realize that the "Authorization" word must be enclosed in quotes like the one below.

{
  "Authorization": "Bearer eyMyVeryLongTokenWhichWorksFineInPostMan"
}

After enclosing the Authorization with quotes everything works fine.

Suggestion

In https://strapi.io/documentation/developer-docs/latest/plugins/graphql.html#authentication

Change this

From:
"... header in the form of { Authorization: "Bearer YOUR_JWT_GOES_HERE" }. This can be set in the HTTP Headers ..."

To: (Authorization -> "Authorization")
"... header in the form of { "Authorization": "Bearer YOUR_JWT_GOES_HERE" }. This can be set in the HTTP Headers ..."

This will help future devs copy-pasting from docs save time from a typo.

[Bug]: all js requests in documentation site stuck with pending status

Link to the documentation page or resource

https://strapi.io/documentation/developer-docs/latest/getting-started/introduction.html

Describe the bug

Whenever I open the documentation site, the tab hangs forever, I tried to open the devtools before I open the site to check what is going not, found that all js files requests are pending.

I tried to fetch one js file and fetch it with curl, everything works fine.

I am not sure if this is a chrome, strapi or ubuntu issue, thought it might help if I posted it.

p.s incognito and guest accounts (without any extension) have the same bug too.

Additional context

OS: ubuntu 20.04
chrome version: Version 87.0.4280.88 (Official Build) (64-bit)

Suggested improvements or fixes

not sure

Related issue(s)/PR(s)

No response

Here is a screenshot of how the requests look like.
image

[Request]: Missing languageNativeNames addition in migration guide

Summary

First, thank you for the amazing work you are doing. We have more and more projects using Strapi in my company (Theodo) and we love it!

We recently upgraded from 3.1.4 to 3.3.0 (3.4.0 is coming), and we faced an issue regarding the custom admin translations customization we put in place. After the upgrade we ran into a blank page containing this error in the console without knowing where it came from:

TypeError: Cannot read property 'fr' of undefined
    at LocaleToggle.render (main.e4eafec9.chunk.js:81199)
    at gi (main.e4eafec9.chunk.js:99104)
    at fi (main.e4eafec9.chunk.js:99103)
    at Rj (main.e4eafec9.chunk.js:99185)
    at Qj (main.e4eafec9.chunk.js:99168)
    at Kj (main.e4eafec9.chunk.js:99168)
    at yj (main.e4eafec9.chunk.js:99161)
    at main.e4eafec9.chunk.js:99045
    at push.exports.unstable_runWithPriority (main.e4eafec9.chunk.js:99252)
    at cg (main.e4eafec9.chunk.js:99044)

Why is it needed?

After digging into it we realised the structure of the admin/src/translations/index.js file had changed between 3.1.4 and 3.2.3 in the docs:

In 3.1.4 documentation:

import en from './en.json';
import fr from './fr.json';

const trads = {
  en,
  fr,
};

export default trads;

In 3.2.3 documentation:

import en from './en.json';
import fr from './fr.json';

const trads = {
  en,
  fr,
};

export const languageNativeNames = { // This object was added
  en: 'English',
  fr: 'Français',
};

export default trads;

Suggested solution(s)

I suggest adding a few lines in the 3.1.x to 3.2.3 migration guide to mention adding this object.

Related issue(s)/PR(s)

None so far but I'll be eager to open a PR if that's ok with you !

Theme Suggestion -

Make the suggestion of swapping from our current default Vuepress theme to the Hope theme: https://github.com/vuepress-theme-hope/vuepress-theme-hope

With it there are various additional add-on plugins that should make styling and management of the documentation much easier. Documentation for this theme can be found here: https://vuepress-theme-hope.github.io/

Additional plugins for this theme (some maintained by the theme author, others are community maintained): https://vuepress-theme-hope.github.io/config/plugin/#build-in-plugins

strapi-helper-plugin style guide

  • I have created my request on the Product Board before I submitted this issue
  • I have looked at all the other requests on the Product Board before I submitted this issue

Please describe your feature request:

If you want to extend the function, you will create own plugin. strapi provides some shared helper component which you can use for building UI of plugin. I think it's better to use those components as much as possible to make components can provide same experience.
Currently we don't have style guide of strapi-helper-plugin, so it's hard to use those components. If there is style guide, developers can easily find component which developer wants.

[Request]: A Step-By-Step Guide on how to use the Strapi CLI with a self-hosted service, that is NOT part of the popular services

Summary

A Proper guide on how to use the Strapi CLI using

npx create-strapi-app my-project

Specifically WITHOUT the --quickstart flag.

Why is it needed?

So it can describe every step the user needs to take if they are not using services like Heroku. Currently, there are only good step-by-step tutorials on how to deploy on services like Heroku.

I just tried to see how to deploy it myself, but I can't wrap my head around it to understand it fully. When it asked for Database, host, port, username and password, I answered it with my FTP credentials. But was it the correct thing to do? I got an error message at least. So a guide on how to properly do it would be great.

Suggested solution(s)

Either a YouTube VIdeo on how to do that or a guide on the documentation.

Related issue(s)/PR(s)

No response

NOTICE: The Documentation is currently under a change freeze

Just wanted to give a small update to those submitting issues and PRs (sorry on the late notice)

Our documentation has been under a change freeze for the beginning part of 2021 and this will probably continue until the end of Feb 2021 as we are doing some major restructuring. Please note that small PRs will most likely not be merged unless they are based on the new structure.

We will hold this PRs and once we are ready to review and merge we may ask you to modify it to point to the new location of the file. You are welcome to still submit just please note we may not look at them until March.

If you have any questions about this please do let me know.

[Request]: AWS hosting video or better documentation

Summary

Create a video for deployment to AWS or a shorter or maybe updated version of AWS hosting.

Why is it needed?

I found the documentation of AWS hosting is really hard to follow and I wasn't able to deploy it to AWS successfully following the documentation.

Suggested solution(s)

No response

Related issue(s)/PR(s)

No response

[Bug]: Cannot see documentation for older versions

Link to the documentation page or resource

https://strapi.io/documentation/developer-docs/latest/getting-started/introduction.html

Describe the bug

There used to be a dropdown menu for selecting the strapi version used in order to check the documentation. Now there's onle strapi 'Latest - 3.x.x'

Additional context

The problem is that I wanted to see how to activate a sendgrid provider for my strapi version 3.0.0.beta20 and following the documentation it doesn't work. Luckily I had another old proyect where I did that and I could figure out how to do it for that version. Why would the old version docs be removed?

Suggested improvements or fixes

Have documentation for older strapi versions as it used to be.

Related issue(s)/PR(s)

No response

strapi docs: sample config for api.js results in broken install

Reference/example api config doc:

https://strapi.io/documentation/developer-docs/latest/concepts/configurations.html#api

has: privateAttributes: ['_v', 'id', 'created_at'],
This means these attributes will be "sanitized" out of the returned object.

However id attribute is needed on client-side.

TypeError: Cannot read property 'toString' of undefined
    at main.9fbb8e53.chunk.js:formatted:267791
    at Array.find (<anonymous>)
    at main.9fbb8e53.chunk.js:formatted:267790
    at e.t.produce (main.9fbb8e53.chunk.js:formatted:169057)
    at f (main.9fbb8e53.chunk.js:formatted:267692)
    at Object.Ja [as useReducer] (main.9fbb8e53.chunk.js:formatted:114552)
    at t.useReducer (main.9fbb8e53.chunk.js:formatted:111229)
    at S (main.9fbb8e53.chunk.js:formatted:267020)
    at Ka (main.9fbb8e53.chunk.js:formatted:114443)
    at Li (main.9fbb8e53.chunk.js:formatted:115028)

image

What I would expect...

The example documentation doesn't contain sample config that is broken with a default install as it may take users a long time poking through the code-base and adding debug logging statements to track down why this is broken.

["BUG"]

Error: ER_PARSE_ERROR: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '(NULL)' at line 1
facing this problem when I upload multiple files to the database using node.js

[Request]: It is recommended to add a README-CN.md

Summary

"docs" folder, README-CN.md

Why is it needed?

Adding README-CN.md can make it easier for native Chinese developers to read README.

Suggested solution(s)

Step 1. Add a "docs" folder, so that you can add more languages to the README in the future.
Step 2. Add README-CN.md in the "docs" folder.
Step 3. Set a hyperlink in README.md to jump to README-CN.md.

Related issue(s)/PR(s)

No response

[Request]: How to extend registration fields (create custom fields)

I have been looking for documentation about adding custom fields to the default registration process by found nothing in particular detailing the process - neither on the docs nor in the forums.

How to define custom fields for the UsersPermissionsRegisterInput type?

[Request]: Cannot change color and logo in the admin panel as there is no admin folder but docs tells it can be done in the admin folder

Link to the documentation page or resource

https://strapi.io/documentation/developer-docs/latest/admin-panel/customization.html#styles

Describe the bug

If anyone needs to change the Strapi admin panel's Left-Menu-Header's color, the documentation tells to change the style in this folder :
./admin/src/components/LeftMenu/LeftMenuHeader/Wrapper.js
But in actual the admin folder is missing in the Strapi folder structure!

This even implies if anyone needs to change the logo in the admin panel and also in the login screen, the documentation tells to add a custom image in this folder :
./admin/src/assets/images/logo-strapi.png
But in actual the admin folder is missing in the Strapi folder structure!

Additional context

But there's a .cache folder and inside that folder there is an admin folder!
So, it would be really helpful if this specified sections docs is updated!

Suggested improvements or fixes

No response

Related issue(s)/PR(s)

No response

Screenshot_2021-01-21 Customization

Error log is suppressed in unit test when following unit testing guide

Describe the bug
I’m following the unit testing guide and I hit an error because I didn’t have sqlite3 installed. No error was printed at the command line and I had to console.log from inside the framework to see what was wrong.

Steps to reproduce the behavior

  1. Follow the unit testing guide. Add a database.json for the test env that references the sqlite client.
  2. Do not install the npm module sqlite3
  3. Copy in the test helper and the app test outlined in the guide.
  4. yarn run test

Expected behavior
These lines in the framework are executing, thus an error should be printed:

        strapi.log.error('The client `' + connection.settings.client + '` is not installed.');
        strapi.log.error(
          'You can install it with `$ npm install ' + connection.settings.client + ' --save`.'
        );

Actual behavior
A callstack referencing knex.js is printed but the log messages are not visible.

Code snippets
The line in strapi code that I expect an error from: https://github.com/strapi/strapi/blob/master/packages/strapi-connector-bookshelf/lib/knex.js#L79.

System

  • Node.js version: v12.8.1
  • NPM version: yarn 1.22.4
  • Strapi version: 3.0.5
  • Database: sqlite
  • Operating system: Debian linux (running in docker desktop on macOS)

Additional context
I don't know if jest is swallowing the error or if strapi.log.error isn't emitting it. I followed the guide so I'd expect it to work. Also the guide should probably mention installing sqlite3. Thanks!

[Bug]: content-types-builder documentation 404

[Request]: How to increase relations depth in strapi API response?

Summary

I use Strapi for building API for my small app. In a model, I have the following entities:

Article, Article Translation, Tag, Tag translation. One Article has Many Article Translations. Each Article Translation has Many Tags. Each Tag has Many Tags translations.

My problem is that when I make a GET-request to Article, I don't receive Tags translations. I suppose they are too deep for Strapi. If I just make a GET-request to Tag or to Tag Translation, the response is correct.

How can I increase the depth of relations responses?

Why is it needed?

Because this way it will be clear how to use Strapi fully with deep requests inside.

Suggested solution(s)

No response

Related issue(s)/PR(s)

No response

[Bug]: Searched (by algolia) item between docs gets 404 page

Link to the documentation page or resource

https://strapi.io/documentation/developer-docs/latest/getting-started/introduction.html

Describe the bug

Steps to reproduce:

  1. Being on developer docs type "plugins" into search box
  2. Click on "Introduction to plugins"

Expected results:
https://strapi.io/documentation/user-docs/latest/plugins/introduction-to-plugins.html#introduction-to-plugins page opens.

Actual results:
https://strapi.io/documentation/developer-docs/documentation/user-docs/latest/plugins/introduction-to-plugins.html#introduction-to-plugins (broken) url opens.

  • Page got 404 error.

Additional context

I suppose problem could be either during url creation.

or related to base url in config file.

Suggested improvements or fixes

if (suggestion.url.startsWith('https://') {
  return this.$router.push(suggestion.url);
}

Related issue(s)/PR(s)

No response

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.