백엔드
strapi
STUFIT
2022. 9. 18. 21:34
반응형
- strapi 란?
https://strapi.io/resource-center
2. strapi 구축 과정
- strapi 는 node.js 기반이며, LTS 버전만을 지원해주고 있다. node 버전으로는 v14 와 v16을 지원하며, npm 버전은 npm v6 버전만을 지원하고 있다. 특히 node 버전 v14.19.1 이상부터 지원이 되므로 버전 관리에 주의하여야 한다.
(1) Strapi 설치 및 프로젝트 생성
- strapi 와 관련된 명령어를 실행하기 위해서는 yarn 도 추가로 설치해야한다.
$ npm install strapi -g
$ npm install yarn -g
$ yarn create strapi-app {프로젝트명}
- 명령어를 입력 후 프로젝트를 생성하게 되면 다음과 같은 메세지들이 나오게 된다.
- 1. Quickstart(recommended) / Custom(manual settings)
- 퀵스타트는 커스텀 없이 자동으로 설치되므로 언어(js or typescript)나 db 종류 등을 커스텀 할 수 없다.
- 커스텀은 내가 원하는 언어설정이나 DB선택 및 포트 설정 등을 할 수 있다.
- 2. 언어 선택
- 3. DB 선택
- 4. DB - host/ port / username/ pw
- ssl 사용여부
- 1. Quickstart(recommended) / Custom(manual settings)
설치가 완료되면 간단한 commands 도 소개하고 있다.
(2) strapi 실행
- 설치가 완료되면 생성한 프로젝트 폴더에 들어가서 strapi를 실행해보도록 한다.
- $ cd bss-ui-test $ yarn develop
- 명령어를 실행하면 다음과 같은 화면으로 들어가게 되며, admin 계정 정보를 입력 후 strapi 를 실행하면 된다.
- $ First name : kwanyoung $ Last name : lee $ Email : stufit@marketboro.com $ Password : Marketboro123
3. playwright 설치 및 eslint 설치
$ npm install playwright
$ npm install eslint@8.22.0
$ npm install babel-eslint@8
4. package.json
{
"name": "tas",
"private": true,
"version": "0.1.0",
"description": "A Strapi application",
"scripts": {
"develop": "strapi develop",
"start": "strapi start",
"build": "strapi build",
"strapi": "strapi"
},
"devDependencies": {},
"dependencies": {
"@strapi/plugin-documentation": "^4.3.8",
"@strapi/plugin-i18n": "4.3.8",
"@strapi/plugin-sentry": "^4.3.8",
"@strapi/plugin-users-permissions": "4.3.8",
"@strapi/strapi": "4.3.8",
"mysql": "2.18.1",
"playwright": "^1.25.2",
"strapi-plugin-cookie-manager": "^1.0.7",
"strapi-plugin-custom-api": "^1.0.3"
},
"author": {
"name": "A Strapi developer"
},
"strapi": {
"uuid": "e9b63d17-f036-44f6-bb6c-68dad062d13e"
},
"engines": {
"node": ">=14.19.1 <=16.x.x",
"npm": ">=6.0.0"
},
"license": "MIT"
}
반응형