Skip to content

Commit

Permalink
chore: copy over demo files, lightly abstract
Browse files Browse the repository at this point in the history
  • Loading branch information
drewbo committed Jan 17, 2025
1 parent 3c9bcf3 commit 75cfb44
Show file tree
Hide file tree
Showing 155 changed files with 23,170 additions and 221 deletions.
3 changes: 3 additions & 0 deletions .cfignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules
.pnpm-store
.next/cache
34 changes: 34 additions & 0 deletions .cloudgov/manifest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
applications:
- name: ((name))
buildpack: nodejs_buildpack
routes:
- route: payload-test.app.cloud.gov
processes:
- type: web
command: npm run start
disk_quota: 5G
instances: ((instances))
memory: 1G
services:
#! - app-((env))-uaa-client
- pages-editor-((env))-rds
- payload-secret
#! - pages-editor-((env))-domain
env:
NODE_ENV: ((node_env))
APP_ENV: ((env))
OAUTH_AUTH_ENDPOINT: https://login.fr.cloud.gov/oauth/authorize
OAUTH_TOKEN_ENDPOINT: https://uaa.fr.cloud.gov/oauth/token
OAUTH_JWT_SET: https://uaa.fr.cloud.gov/token_keys
LOG_LEVEL: ((log_level))
NPM_CONFIG_PRODUCTION: true
NODE_MODULES_CACHE: false
SHARP_IGNORE_GLOBAL_LIBVIPS: true
OPTIMIZE_MEMORY: true
PUBLIC_URL: https://payload-test.app.cloud.gov
PREVIEW_URL: https://payload-test-preview.app.cloud.gov
PROMPT_URL: https://payload-test-preview-prompt.app.cloud.gov
#! UAA_HOST: ((uaa_host))
health-check-type: http
health-check-http-endpoint: /admin
6 changes: 6 additions & 0 deletions .cloudgov/vars/pages-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
name: pages-editor-dev
#! domain: pages-editor-dev.cloud.gov
instances: 2
env: dev
log_level: verbose
node_env: production
10 changes: 10 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
root = true

[*]
indent_style = space
indent_size = 2
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
end_of_line = lf
max_line_length = null
26 changes: 26 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Database connection string
# DATABASE_URI=mongodb://127.0.0.1/payload-template-website

# Or use a PG connection string
DATABASE_URI=

# Used to encrypt JWT tokens
PAYLOAD_SECRET=

# Used to configure CORS, format links and more. No trailing slash
NEXT_PUBLIC_SERVER_URL=http://localhost:3000

# from pages-website-watcher
PREVIEW_URL=
PROMPT_URL=http://localhost:3000 # should match above but required to be set to run dev

OAUTH_CLIENT_ID=
OAUTH_CLIENT_SECRET=

# pointing to UAA docker by default
OAUTH_AUTH_ENDPOINT=http://localhost:9001/oauth/authorize
OAUTH_TOKEN_ENDPOINT=http://localhost:9001/oauth/token
OAUTH_USERINFO_ENDPOINT=http://localhost:9001/userinfo

ORIGIN=http://localhost:3000

12 changes: 12 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
.tmp
**/.git
**/.hg
**/.pnp.*
**/.svn
**/.yarn/**
**/build
**/dist/**
**/node_modules
**/temp
playwright.config.ts
jest.config.js
8 changes: 8 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module.exports = {
extends: 'next',
root: true,
parserOptions: {
project: ['./tsconfig.json'],
tsconfigRootDir: __dirname,
},
}
230 changes: 11 additions & 219 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,224 +1,16 @@
# General Files
*.log
*.tmp
*.bak
*.swp
*.swo
build
dist / media
node_modules
.DS_Store
Thumbs.db
Desktop.ini
._*
.Trashes
.Spotlight-V100
.TemporaryItems
.Trash-*
*.pid
*.pid.lock
*.seed
*.db
*.dbmdl
*.tlog
*.tmproj
*.tmp_proj
*.un~
*.user
*.userosscache
*.userprefs
*.vbproj.user
*.vssscc
*.vspscc
*.suo
*.cache
*.csproj.user
*.sln.docstates
*.iws

# Byte-compiled / Optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
*.so

# Distribution / Packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg

# Virtual Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# IDE / Editor Configurations
/.idea/
*.iml
/.vscode/
*.code-workspace
*.sublime-project
*.sublime-workspace
/.vs/
/.atom/
/.eclipse/
/.netbeans/
/.intellij/
/.jbuilder/
/.rubymine/
/.mine/
/.textmate/
/.vim/
/.emacs.d/
*.sw*

# Security - Sensitive files
*.pem
*.key
*.crt
*.csr
*.gpg
*.asc
.secret
*.vault
*.token
*.apikey
*.credentials
secrets.yml
credentials.yml
config/dev.yml
config/private.yml

# Dependency Directories
/node_modules/
/bower_components/
/.jekyll-cache/
/vendor/

# Go specific
/bin/
/pkg/
*.o
*.a
*.out
**/vendor/
Gopkg.lock
Gopkg.toml
go.sum
go.mod

# Binaries for programs and plugins
*.exe
*.exe~
*.dll
*.so
*.dylib

# Test binary, built with `go test -c`
*.test

# Output of the go coverage tool, specifically when used with LiteIDE
*.out

# Ruby specific
/.bundle/
/.yardoc
/_yardoc/
/coverage/
/doc/
/pkg/
/spec/reports/
/tmp/
*.gem
*.rbc
.capistrano/
.rspec
.ruby-version
.ruby-gemset
# Ignore Byebug command history file.
.byebug_history

# Cloud Foundry specific
manifest.yml
manifest-*.yml
*.env
*.vars.yml
*.vars-*.yml
/deployments/

# BOSH specific
*.release
/releases/
/dev_releases/
/.dev_builds/
/blobs/
/config/
/private.yml
*.tgz

# Concourse specific
/fly-*
/concourse-*
/pipelines/
/tasks/
/groups/
/resources/

# Logs, Databases, and Configuration Files
*.log
*.sql
*.sqlite
*.sqlite3
/log/
*.env*
**/log/*.log
**/log/*.log*

# OS Generated Files
.DS_Store
.DS_Store?
.Spotlight-V100
.Trashes
ehthumbs.db
Thumbs.db
.next
.vercel

# Build Artifacts and Directories
/dist/
/tmp/
/out/
/build/
/target/
/coverage/
/Release/
/Debug/
/x64/
/x86/
*.lock
*.DS_Store
*.tgz
/.terraform/
# Payload default media upload directory
public/media/

# Certificates and Keys
*.csr
*.crt
*.key
*.pem
*.pfx
public/robots.txt
public/sitemap*.xml

# System and Miscellaneous
$RECYCLE.BIN/
$tf/
# payload-types should be dynamically generated for now
src/payload-types.ts
2 changes: 2 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
legacy-peer-deps=true
enable-pre-post-scripts=true
14 changes: 14 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
**/payload-types.ts
.tmp
**/.git
**/.hg
**/.pnp.*
**/.svn
**/.yarn/**
**/build
**/dist/**
**/node_modules
**/temp
**/docs/**
tsconfig.json

6 changes: 6 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"singleQuote": true,
"trailingComma": "all",
"printWidth": 100,
"semi": false
}
4 changes: 4 additions & 0 deletions .profile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export DATABASE_URI="$DATABASE_URL"?sslmode=require
export PAYLOAD_SECRET="$(echo "$VCAP_SERVICES" | jq --raw-output --arg service_name "payload-secret" ".[][] | select(.name == \$service_name) | .credentials.PAYLOAD_SECRET")"
export OAUTH_CLIENT_ID="$(echo "$VCAP_SERVICES" | jq --raw-output --arg service_name "payload-secret" ".[][] | select(.name == \$service_name) | .credentials.OAUTH_CLIENT_ID")"
export OAUTH_CLIENT_SECRET="$(echo "$VCAP_SERVICES" | jq --raw-output --arg service_name "payload-secret" ".[][] | select(.name == \$service_name) | .credentials.OAUTH_CLIENT_SECRET")"
24 changes: 24 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Next.js: debug full stack",
"type": "node",
"request": "launch",
"program": "${workspaceFolder}/node_modules/next/dist/bin/next",
"runtimeArgs": ["--inspect"],
"skipFiles": ["<node_internals>/**"],
"serverReadyAction": {
"action": "debugWithChrome",
"killOnServerStop": true,
"pattern": "- Local:.+(https?://.+)",
"uriFormat": "%s",
"webRoot": "${workspaceFolder}"
},
"cwd": "${workspaceFolder}"
}
]
}
Loading

0 comments on commit 75cfb44

Please sign in to comment.