├── .editorconfig ├── .env ├── .env.defaults ├── .env.example ├── .gitignore ├── .gitignore.app ├── .nvmrc ├── .vscode ├── extensions.json ├── launch.json └── settings.json ├── LICENSE ├── README.md ├── README_APP.md ├── api ├── .babelrc.js ├── db │ ├── schema.prisma │ └── seeds.js ├── jest.config.js ├── jsconfig.json ├── package.json └── src │ ├── functions │ └── graphql.js │ ├── graphql │ └── .keep │ ├── lib │ └── db.js │ └── services │ └── .keep ├── babel.config.js ├── graphql.config.js ├── package.json ├── prettier.config.js ├── redwood.toml ├── web ├── .babelrc.js ├── jest.config.js ├── jsconfig.json ├── package.json ├── public │ ├── README.md │ ├── favicon.png │ └── robots.txt └── src │ ├── Routes.js │ ├── components │ └── .keep │ ├── index.css │ ├── index.html │ ├── index.js │ ├── layouts │ └── .keep │ └── pages │ ├── FatalErrorPage │ └── FatalErrorPage.js │ └── NotFoundPage │ └── NotFoundPage.js └── yarn.lock /.editorconfig: -------------------------------------------------------------------------------- 1 | # editorconfig.org 2 | root = true 3 | 4 | [*] 5 | charset = utf-8 6 | end_of_line = lf 7 | indent_size = 2 8 | indent_style = space 9 | insert_final_newline = true 10 | trim_trailing_whitespace = true 11 | -------------------------------------------------------------------------------- /.env: -------------------------------------------------------------------------------- 1 | # THIS FILE SHOULD NOT BE CHECKED INTO YOUR VERSION CONTROL SYSTEM 2 | # 3 | # Environment variables set here will override those in .env.defaults. 4 | # Any environment variables you need in production you will need to setup with 5 | # your hosting provider. For example in Netlify you can add environment 6 | # variables in Settings > Build & Deploy > environment 7 | # 8 | # DATABASE_URL=postgres://user:pass@postgreshost.com:5432/database_name 9 | # TEST_DATABASE_URL=postgres://user:pass@postgreshost.com:5432/test_database_name 10 | -------------------------------------------------------------------------------- /.env.defaults: -------------------------------------------------------------------------------- 1 | # These environment variables will be used by default if you do not create any 2 | # yourself in .env. This file should be safe to check into your version control 3 | # system. Any custom values should go in .env and .env should *not* be checked 4 | # into version control. 5 | 6 | # schema.prisma defaults 7 | DATABASE_URL=file:./dev.db 8 | 9 | # location of the test database for api service scenarios (defaults to ./.redwood/test.db if not set) 10 | # TEST_DATABASE_URL=file:./.redwood/test.db 11 | 12 | # disables Prisma CLI update notifier 13 | PRISMA_HIDE_UPDATE_MESSAGE=true 14 | -------------------------------------------------------------------------------- /.env.example: -------------------------------------------------------------------------------- 1 | # DATABASE_URL=file:./dev.db 2 | # BINARY_TARGET=native -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | .DS_Store 3 | .redwood 4 | dist 5 | dist-babel 6 | node_modules 7 | yarn-error.log 8 | 9 | -------------------------------------------------------------------------------- /.gitignore.app: -------------------------------------------------------------------------------- 1 | .idea 2 | .DS_Store 3 | .env 4 | .netlify 5 | .redwood 6 | dev.db 7 | dist 8 | dist-babel 9 | node_modules 10 | yarn-error.log 11 | web/public/mockServiceWorker.js 12 | -------------------------------------------------------------------------------- /.nvmrc: -------------------------------------------------------------------------------- 1 | lts/* 2 | -------------------------------------------------------------------------------- /.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": [ 3 | "redwoodjs.redwood", 4 | "dbaeumer.vscode-eslint", 5 | "eamodio.gitlens", 6 | "ofhumanbondage.react-proptypes-intellisense", 7 | "mgmcdermott.vscode-language-babel", 8 | "wix.vscode-import-cost", 9 | "pflannery.vscode-versionlens", 10 | "editorconfig.editorconfig", 11 | "prisma.prisma", 12 | "graphql.vscode-graphql" 13 | ], 14 | "unwantedRecommendations": [] 15 | } 16 | -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "0.2.0", 3 | "configurations": [ 4 | { 5 | "command": "yarn redwood dev", 6 | "name": "launch development", 7 | "request": "launch", 8 | "type": "node-terminal" 9 | }, 10 | { 11 | "type": "pwa-node", 12 | "request": "launch", 13 | "name": "launch api", 14 | "skipFiles": [ 15 | "/**" 16 | ], 17 | "cwd": "${workspaceFolder}/api", 18 | "envFile": "${workspaceFolder}/.env.defaults", 19 | "program": "${workspaceFolder}/node_modules/.bin/dev-server" 20 | } 21 | ] 22 | } 23 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "editor.tabSize": 2, 3 | "files.trimTrailingWhitespace": true, 4 | "editor.formatOnSave": false, 5 | "editor.codeActionsOnSave": { 6 | "source.fixAll.eslint": true 7 | }, 8 | "[prisma]": { 9 | "editor.formatOnSave": true 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Redwood 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ARCHIVED 2 | ## This repository has been archived. 3 | The template codebase is now located within the Redwood Framework Repository: 4 | https://github.com/redwoodjs/redwood/tree/main/packages/create-redwood-app/template 5 | 6 | 7 | --- 8 | 9 | # Redwood 10 | >👉 **"This is not the Repo you are looking for"** _...most likely_. If your goal is to start building an app using RedwoodJS, you'll want to read through the [Tutorial](https://redwoodjs.com/tutorial/welcome-to-redwood) and get started from the command line: 11 | >$ `yarn create redwood-app ` 12 | > 13 | **This repo is a template used by the RedwoodJS app bootstrap package 'Create Redwood App'**, which is located at [`redwood/packages/create-redwood-app/`](https://github.com/redwoodjs/redwood/tree/main/packages/create-redwood-app). If you're looking to do things like contributing to RedwoodJS development or reference Redwood's full-stack building blocks, then you're in the right place!🌲🎉 14 | 15 | ## Releases 16 | To ensure `yarn.lock` is in sync with latest @redwoodjs packages, follow these steps: 17 | 1. confirm your local branch is up to date with `main`, then run `git clean -fxd` 18 | 2. update root, web/, and api/ `package.json` to latest @redwoodjs package version 19 | 3. run `yarn` 20 | 4. Commit all changes including `yarn.lock` 21 | 5. Create new release 22 | 23 | ## Development: Getting Started 24 | Before you begin, please read the RedwoodJS [Contributor Covenant Code of Conduct](https://github.com/redwoodjs/redwood/blob/main/CODE_OF_CONDUCT.md) 25 | 26 | Most likely, you'll need to set up a development environment linked to packages from a local clone of [`redwoodjs/redwood/packages`](https://github.com/redwoodjs/redwood/tree/main/packages). This doc will help get you started: 27 | [Contributing to RedwoodJS](https://github.com/redwoodjs/redwood/blob/main/CONTRIBUTING.md) 28 | -------------------------------------------------------------------------------- /README_APP.md: -------------------------------------------------------------------------------- 1 | # Redwood 2 | 3 | > **WARNING:** RedwoodJS software has not reached a stable version 1.0 and should not be considered suitable for production use. In the "make it work; make it right; make it fast" paradigm, Redwood is in the later stages of the "make it work" phase. 4 | 5 | ## Getting Started 6 | - [Tutorial](https://redwoodjs.com/tutorial/welcome-to-redwood): getting started and complete overview guide. 7 | - [Docs](https://redwoodjs.com/docs/introduction): using the Redwood Router, handling assets and files, list of command-line tools, and more. 8 | - [Redwood Community](https://community.redwoodjs.com): get help, share tips and tricks, and collaborate on everything about RedwoodJS. 9 | 10 | ### Setup 11 | 12 | We use Yarn as our package manager. To get the dependencies installed, just do this in the root directory: 13 | 14 | ```terminal 15 | yarn install 16 | ``` 17 | 18 | ### Fire it up 19 | 20 | ```terminal 21 | yarn redwood dev 22 | ``` 23 | 24 | Your browser should open automatically to `http://localhost:8910` to see the web app. Lambda functions run on `http://localhost:8911` and are also proxied to `http://localhost:8910/.redwood/functions/*`. 25 | -------------------------------------------------------------------------------- /api/.babelrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { extends: "../babel.config.js" } 2 | -------------------------------------------------------------------------------- /api/db/schema.prisma: -------------------------------------------------------------------------------- 1 | datasource DS { 2 | // optionally set multiple providers 3 | // example: provider = ["sqlite", "postgresql"] 4 | provider = "sqlite" 5 | url = env("DATABASE_URL") 6 | } 7 | 8 | generator client { 9 | provider = "prisma-client-js" 10 | binaryTargets = "native" 11 | } 12 | 13 | // Define your own datamodels here and run `yarn redwood db save` to create 14 | // migrations for them. 15 | // TODO: Please remove the following example: 16 | model UserExample { 17 | id Int @id @default(autoincrement()) 18 | email String @unique 19 | name String? 20 | } 21 | -------------------------------------------------------------------------------- /api/db/seeds.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable no-console */ 2 | const { PrismaClient } = require('@prisma/client') 3 | const dotenv = require('dotenv') 4 | 5 | dotenv.config() 6 | const db = new PrismaClient() 7 | 8 | async function main() { 9 | // Seed data is database data that needs to exist for your app to run. 10 | // Ideally this file should be idempotent: running it multiple times 11 | // will result in the same database state (usually by checking for the 12 | // existence of a record before trying to create it). For example: 13 | // 14 | // const existing = await db.user.findMany({ where: { email: 'admin@email.com' }}) 15 | // if (!existing.length) { 16 | // await db.user.create({ data: { name: 'Admin', email: 'admin@email.com' }}) 17 | // } 18 | 19 | console.info('No data to seed. See api/db/seeds.js for info.') 20 | } 21 | 22 | main() 23 | .catch((e) => console.error(e)) 24 | .finally(async () => { 25 | await db.$disconnect() 26 | }) 27 | -------------------------------------------------------------------------------- /api/jest.config.js: -------------------------------------------------------------------------------- 1 | const { getConfig } = require('@redwoodjs/core') 2 | 3 | const config = getConfig({ type: 'jest', target: 'node' }) 4 | config.displayName.name = 'api' 5 | 6 | module.exports = config 7 | -------------------------------------------------------------------------------- /api/jsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "baseUrl": ".", 4 | "paths": { 5 | "src/*": ["./src/*"] 6 | } 7 | }, 8 | "include": ["src/**/*", "../.redwood/index.d.ts"] 9 | } 10 | -------------------------------------------------------------------------------- /api/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "api", 3 | "version": "0.0.0", 4 | "private": true, 5 | "dependencies": { 6 | "@redwoodjs/api": "^0.23.0" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /api/src/functions/graphql.js: -------------------------------------------------------------------------------- 1 | import { 2 | createGraphQLHandler, 3 | makeMergedSchema, 4 | makeServices, 5 | } from '@redwoodjs/api' 6 | 7 | import schemas from 'src/graphql/**/*.{js,ts}' 8 | import services from 'src/services/**/*.{js,ts}' 9 | import { db } from 'src/lib/db' 10 | 11 | export const handler = createGraphQLHandler({ 12 | schema: makeMergedSchema({ 13 | schemas, 14 | services: makeServices({ services }), 15 | }), 16 | onException: () => { 17 | // Disconnect from your database with an unhandled exception. 18 | db.$disconnect() 19 | }, 20 | }) 21 | -------------------------------------------------------------------------------- /api/src/graphql/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redwoodjs/create-redwood-app/ae1e31e93894842916358b4242628dc52388b11e/api/src/graphql/.keep -------------------------------------------------------------------------------- /api/src/lib/db.js: -------------------------------------------------------------------------------- 1 | // See https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client/constructor 2 | // for options. 3 | 4 | import { PrismaClient } from '@prisma/client' 5 | 6 | export const db = new PrismaClient() 7 | -------------------------------------------------------------------------------- /api/src/services/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redwoodjs/create-redwood-app/ae1e31e93894842916358b4242628dc52388b11e/api/src/services/.keep -------------------------------------------------------------------------------- /babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: ['@redwoodjs/core/config/babel-preset'], 3 | } 4 | -------------------------------------------------------------------------------- /graphql.config.js: -------------------------------------------------------------------------------- 1 | const { getConfig } = require('@redwoodjs/internal') 2 | 3 | const config = getConfig() 4 | 5 | module.exports = { 6 | schema: `http://${config.api.host}:${config.api.port}/graphql`, 7 | } 8 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "workspaces": { 4 | "packages": [ 5 | "api", 6 | "web" 7 | ] 8 | }, 9 | "devDependencies": { 10 | "@redwoodjs/core": "^0.23.0" 11 | }, 12 | "eslintConfig": { 13 | "extends": "@redwoodjs/eslint-config" 14 | }, 15 | "engines": { 16 | "node": ">=12", 17 | "yarn": ">=1.15" 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /prettier.config.js: -------------------------------------------------------------------------------- 1 | // https://prettier.io/docs/en/options.html 2 | module.exports = { 3 | trailingComma: 'es5', 4 | bracketSpacing: true, 5 | tabWidth: 2, 6 | semi: false, 7 | singleQuote: true, 8 | arrowParens: 'always', 9 | overrides: [ 10 | { 11 | files: 'Routes.js', 12 | options: { 13 | printWidth: 200, 14 | }, 15 | }, 16 | ], 17 | } 18 | -------------------------------------------------------------------------------- /redwood.toml: -------------------------------------------------------------------------------- 1 | # This file contains the configuration settings for your Redwood app. 2 | # This file is also what makes your Redwood app a Redwood app. 3 | # If you remove it and try to run `yarn rw dev`, you'll get an error. 4 | # 5 | # For the full list of options, see the "App Configuration: redwood.toml" doc: 6 | # https://redwoodjs.com/docs/app-configuration-redwood-toml 7 | 8 | [web] 9 | port = 8910 10 | apiProxyPath = "/.redwood/functions" 11 | [api] 12 | port = 8911 13 | schemaPath = "./api/db/schema.prisma" 14 | [browser] 15 | open = true 16 | -------------------------------------------------------------------------------- /web/.babelrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { extends: "../babel.config.js" } 2 | -------------------------------------------------------------------------------- /web/jest.config.js: -------------------------------------------------------------------------------- 1 | const { getConfig } = require('@redwoodjs/core') 2 | 3 | const config = getConfig({ type: 'jest', target: 'browser' }) 4 | config.displayName.name = 'web' 5 | 6 | module.exports = config 7 | -------------------------------------------------------------------------------- /web/jsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "baseUrl": ".", 4 | "paths": { 5 | "src/*": ["./src/*"] 6 | }, 7 | "jsx": "preserve" 8 | }, 9 | "include": ["src/**/*", "../.redwood/index.d.ts"] 10 | } 11 | -------------------------------------------------------------------------------- /web/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "web", 3 | "version": "0.0.0", 4 | "private": true, 5 | "browserslist": { 6 | "development": [ 7 | "last 1 version" 8 | ], 9 | "production": [ 10 | "defaults", 11 | "not IE 11", 12 | "not IE_Mob 11" 13 | ] 14 | }, 15 | "dependencies": { 16 | "@redwoodjs/forms": "^0.23.0", 17 | "@redwoodjs/router": "^0.23.0", 18 | "@redwoodjs/web": "^0.23.0", 19 | "prop-types": "^15.7.2", 20 | "react": "^16.13.1", 21 | "react-dom": "^16.13.1" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /web/public/README.md: -------------------------------------------------------------------------------- 1 | # Static Assets 2 | Use this folder to add static files directly to your app. All included files and folders will be copied directly into the `/dist` folder (created when Webpack builds for production). They will also be available during development when you run `yarn rw dev`. 3 | >Note: files will *not* hot reload while the development server is running. You'll need to manually stop/start to access file changes. 4 | 5 | ### Example Use 6 | A file like `favicon.png` will be copied to `/dist/favicon.png`. A folder containing a file such as `static-files/my-logo.jpg` will be copied to `/dist/static-files/my-logo.jpg`. These can be referenced in your code directly without any special handling, e.g. 7 | ``` 8 | 9 | ``` 10 | and 11 | ``` 12 | alt="Logo" /> 13 | ``` 14 | 15 | Behind the scenes, we are using Webpack's ["copy-webpack-plugin"](https://github.com/webpack-contrib/copy-webpack-plugin). 16 | 17 | ## Best Practices 18 | Because assets in this folder are bypassing the javascript module system, **this folder should be used sparingly** for assets such as favicons, robots.txt, manifests, libraries incompatible with Webpack, etc. 19 | 20 | In general, it's best to import files directly into a template, page, or component. This allows Webpack to include that file in the bundle, which ensures Webpack will correctly process and move assets into the distribution folder, providing error checks and correct paths along the way. 21 | 22 | ### Example Asset Import with Webpack 23 | Instead of handling our logo image as a static file per the example above, we can do the following: 24 | ``` 25 | import React from "react" 26 | import logo from "./my-logo.jpg" 27 | 28 | 29 | function Header() { 30 | return Logo 31 | } 32 | 33 | export default Header 34 | ``` 35 | 36 | Behind the scenes, we are using Webpack's ["file-loader"](https://webpack.js.org/loaders/file-loader/) and ["url-loader](https://webpack.js.org/loaders/url-loader/) (for files smaller than 10kb). 37 | -------------------------------------------------------------------------------- /web/public/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redwoodjs/create-redwood-app/ae1e31e93894842916358b4242628dc52388b11e/web/public/favicon.png -------------------------------------------------------------------------------- /web/public/robots.txt: -------------------------------------------------------------------------------- 1 | User-agent: * 2 | Disallow: 3 | -------------------------------------------------------------------------------- /web/src/Routes.js: -------------------------------------------------------------------------------- 1 | // In this file, all Page components from 'src/pages` are auto-imported. Nested 2 | // directories are supported, and should be uppercase. Each subdirectory will be 3 | // prepended onto the component name. 4 | // 5 | // Examples: 6 | // 7 | // 'src/pages/HomePage/HomePage.js' -> HomePage 8 | // 'src/pages/Admin/BooksPage/BooksPage.js' -> AdminBooksPage 9 | 10 | import { Router, Route } from '@redwoodjs/router' 11 | 12 | const Routes = () => { 13 | return ( 14 | 15 | 16 | 17 | ) 18 | } 19 | 20 | export default Routes 21 | -------------------------------------------------------------------------------- /web/src/components/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redwoodjs/create-redwood-app/ae1e31e93894842916358b4242628dc52388b11e/web/src/components/.keep -------------------------------------------------------------------------------- /web/src/index.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redwoodjs/create-redwood-app/ae1e31e93894842916358b4242628dc52388b11e/web/src/index.css -------------------------------------------------------------------------------- /web/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | <%= htmlWebpackPlugin.options.title %> 8 | 9 | 10 |
11 | 12 | 13 | -------------------------------------------------------------------------------- /web/src/index.js: -------------------------------------------------------------------------------- 1 | import ReactDOM from 'react-dom' 2 | import { RedwoodProvider, FatalErrorBoundary } from '@redwoodjs/web' 3 | import FatalErrorPage from 'src/pages/FatalErrorPage' 4 | 5 | import Routes from 'src/Routes' 6 | 7 | import './index.css' 8 | 9 | ReactDOM.render( 10 | 11 | 12 | 13 | 14 | , 15 | document.getElementById('redwood-app') 16 | ) 17 | -------------------------------------------------------------------------------- /web/src/layouts/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redwoodjs/create-redwood-app/ae1e31e93894842916358b4242628dc52388b11e/web/src/layouts/.keep -------------------------------------------------------------------------------- /web/src/pages/FatalErrorPage/FatalErrorPage.js: -------------------------------------------------------------------------------- 1 | // This page will be rendered when an error makes it all the way to the top of the 2 | // application without being handled by a Javascript catch statement or React error 3 | // boundary. 4 | // 5 | // You can modify this page as you wish, but it is important to keep things simple to 6 | // avoid the possibility that it will cause its own error. If it does, Redwood will 7 | // still render a generic error page, but your users will prefer something a bit more 8 | // thoughtful. =) 9 | 10 | export default () => ( 11 |
12 |