Skip to content

Commit

Permalink
🚀 First commit
Browse files Browse the repository at this point in the history
  • Loading branch information
lovekaizen committed Feb 5, 2021
1 parent 014e111 commit db31787
Show file tree
Hide file tree
Showing 124 changed files with 78,358 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .env.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
CMS_URL="<<[ .learnstrapi.packages.client.url.dev ]>>"
CMS_URL_PRODUCTION="<<[ .learnstrapi.packages.client.url.prod ]>>"
CLIENT_URL="<<[ .learnstrapi.packages.client.url.dev ]>>"
CLIENT_URL_PRODUCTION="<<[ .learnstrapi.packages.client.url.prod ]>>"
GTM_ID="<<[ .learnstrapi.packages.client.gtmId ]>>"
PROVIDER_API_KEY="<<[ .learnstrapi.packages.cms.providers.upload.cloudinary.apiKey ]>>"
PROVIDER_API_SECRET="<<[ .learnstrapi.packages.cms.providers.upload.cloudinary.apiSecret ]>>"
PROVIDER_CLOUD_NAME="<<[ .learnstrapi.packages.cms.providers.upload.cloudinary.cloudName ]>>"
WITH_CMS="false"
129 changes: 129 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
############################
# OS X
############################

.DS_Store
.AppleDouble
.LSOverride
Icon
.Spotlight-V100
.Trashes
._*


############################
# Linux
############################

*~


############################
# Windows
############################

Thumbs.db
ehthumbs.db
Desktop.ini

*.cab
*.msi
*.msm
*.msp


############################
# Packages
############################

*.7z
*.csv
*.dat
*.dmg
*.gz
*.iso
*.jar
*.rar
*.tar
*.zip
*.com
*.class
*.dll
*.exe
*.o
*.seed
*.so
*.swo
*.swp
*.swn
*.swm
*.out
*.pid


############################
# Logs and databases
############################


*.log
*.sql
*.sqlite
*.sqlite3


############################
# Misc.
############################

*#
ssl
.idea
nbproject
public/uploads/*
!public/uploads/.gitkeep

############################
# Node.js
############################

lib-cov
lcov.info
pids
logs
results
node_modules
.node_history


############################
# Tests
############################

testApp
coverage

############################
# Strapi
############################

.env
license.txt
exports
.cache
build

############################
# Next.js
############################

out
.next
.cache

############################
# Template files
############################

**/**/customize.json
*customize.json
10 changes: 10 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.next
*.cache
*.next
*.now
*/cache
api
build
cms
out
public
17 changes: 17 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"printWidth": 80,
"tabWidth": 2,
"useTabs": false,
"semi": false,
"singleQuote": true,
"quoteProps": "as-needed",
"jsxSingleQuote": false,
"trailingComma": "none",
"bracketSpacing": true,
"jsxBracketSameLine": false,
"arrowParens": "avoid",
"proseWrap": "preserve",
"htmlWhitespaceSensitivity": "css",
"endOfLine": "lf",
"embeddedLanguageFormatting": "auto"
}
26 changes: 26 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"grammarly.overrides": [
{
"files": [
"**/packages/client/customize.json"
],
"config": {
"audience": "general",
"dialect": "british",
"domain": "general",
"emotions": [
"neutral"
],
"goals": [
"inform"
]
}
}
],
"extensions.ignoreRecommendations": true,
"files.autoSave": "off",
"typescript.tsc.autoDetect": "off",
"npm.autoDetect": "off",
"debug.allowBreakpointsEverywhere": true,
"html.autoClosingTags": false
}
53 changes: 53 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# 🚀 LearnStrapi Boilerplate

Full stack boilerplate for Strapi + Next.js + Chakra UI projects

Features:

- A monorepo to run Strapi and your Next.js client from a single command `yarn dev` (uses `lerna` under the hood)
- Options to run just the frontend - once you've deployed your project and setup the `CMS_URL_PRODUCTION` in the `client` package
- A basic Next.js app with Chakra UI ready to customise with your own branding (also includes some basic components and Strapi authentication)

## Getting Started

### Initial setup

Setup `gomplate` and copy env and customization files.

```bash
sh $PWD/scripts/init
```

### Customize your project

1. Setup your repos (or you can add the links later)
2. Add your project settings to `customize.json`.

---

NOTE: If you need to generate an admin JWT secret token for Strapi

```bash
node -e "console.log(require('crypto').randomBytes(64).toString('base64'))" | pbcopy
```

---

### Generate your project

```bash
sh $PWD/scripts/customize
```

### Running your project locally

##### `lerna bootstrap` Install dependencies

##### `lerna run build` Build Admin UI & Frontend

##### `lerna run start` Start frontend and backend with `lerna`


### Recommendations

We recommend using a submodule for the `packages/cms` package so you can freely deploy this on Heroku, Digital Ocean, AWS or anywhere you can host a node server.
15 changes: 15 additions & 0 deletions README_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# <<[ .learnstrapi.branding.name ]>>

## Getting Started

### Local dev

#### `lerna bootstrap` Install dependencies

#### `yarn dev` Start frontend using production CMS (for frontend dev only)

#### `yarn dev:cms` Start frontend with local backend CMS backend with `lerna`

Local CMS (Admin): <<<[ .learnstrapi.packages.cms.config.url.dev ]>>/admin>
Local CMS (GraphQl playground): <<<[ .learnstrapi.packages.cms.config.url.dev ]>>/graphql>
Local client: <<<[ .learnstrapi.packages.client.url.dev ]>>>
13 changes: 13 additions & 0 deletions codegen.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
overwrite: true
schema: '<<[ .learnstrapi.packages.client.url.dev ]>>/graphql'
documents: 'lib/gql/**/**.ts'
generates:
packages/client/lib/gql/types.ts:
plugins:
- 'typescript'
- 'typescript-operations'
- 'typescript-react-apollo'
- 'fragment-matcher'
packages/client/lib/gql/graphql.schema.json:
plugins:
- 'introspection'
78 changes: 78 additions & 0 deletions customize.json.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
{
"branding": {
"name": "",
"strapLine": "",
"socials": {
"instagram": "https://instagram.com/",
"linkedin": "https://www.linkedin.com/company/",
"twitter": "https://twitter.com/"
}
},
"author": {
"name": "",
"email": "",
"url": ""
},
"workspace": {
"description": "",
"license": "MIT",
"name": "",
"repository": "",
"private": true
},
"packages": {
"client": {
"description": "",
"license": "MIT",
"name": "",
"repository": "",
"private": true,
"gtmId": "",
"url": {
"dev": "http://localhost:3000",
"prod": ""
}
},
"cms": {
"description": "",
"license": "MIT",
"name": "",
"repository": "",
"private": true,
"config": {
"adminJwtSecret": "",
"strapiVersion": "^3.4.6",
"url": {
"dev": "http://localhost:1337",
"prod": ""
}
},
"database": {
"client": "postgres",
"host": "localhost",
"name": "",
"password": "postgres",
"port": 5432,
"username": "postgres"
},
"providers": {
"email": {
"aws": {
"sesFrom": "",
"sesKey": "",
"sesRegionUrl": "",
"sesReply": "",
"sesSecret": "
}
},
"upload": {
"cloudinary": {
"apiKey": "",
"apiSecret": "",
"cloudName": ""
}
}
}
}
}
}
6 changes: 6 additions & 0 deletions lerna.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"npmClient": "yarn",
"packages": ["packages/*"],
"useWorkspaces": true,
"version": "0.0.1"
}
7 changes: 7 additions & 0 deletions now.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"version": 2,
"public": true,
"build": {
"env": {}
}
}
Loading

0 comments on commit db31787

Please sign in to comment.