diff --git a/README.md b/README.md index 489e9a4..4b2dcaf 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,18 @@ If you don't already have it, you can install Wasp by going [here](https://wasp. > **Note** After you create a new project, make sure to check the README.md to see any additional info +### Minimal + +A minimal Wasp App with a single hello page. + +Perfect for minimalists. + +Use this tempalte: + +```bash +wasp new -t minimal +``` + ### SaaS Template A SaaS Template to get your profitable side-project started quickly and easily! diff --git a/minimal/.gitignore b/minimal/.gitignore new file mode 100644 index 0000000..fd45342 --- /dev/null +++ b/minimal/.gitignore @@ -0,0 +1,11 @@ +.wasp/ +node_modules/ + +# Ignore all dotenv files by default to prevent accidentally committing any secrets. +# To include specific dotenv files, use the `!` operator or adjust these rules. +.env +.env.* + +# Don't ignore example dotenv files. +!.env.example +!.env.*.example diff --git a/minimal/.waspignore b/minimal/.waspignore new file mode 100644 index 0000000..2ed76fd --- /dev/null +++ b/minimal/.waspignore @@ -0,0 +1,4 @@ +# Ignore editor tmp files +**/*~ +**/#*# +.DS_Store diff --git a/minimal/.wasproot b/minimal/.wasproot new file mode 100644 index 0000000..ca2cfdb --- /dev/null +++ b/minimal/.wasproot @@ -0,0 +1 @@ +File marking the root of Wasp project. diff --git a/minimal/main.wasp b/minimal/main.wasp new file mode 100644 index 0000000..6911a58 --- /dev/null +++ b/minimal/main.wasp @@ -0,0 +1,14 @@ +app __waspAppName__ { + wasp: { + version: "__waspVersion__" + }, + title: "__waspProjectName__", + head: [ + "", + ] +} + +route RootRoute { path: "/", to: MainPage } +page MainPage { + component: import { MainPage } from "@src/MainPage" +} diff --git a/minimal/package.json b/minimal/package.json new file mode 100644 index 0000000..11a5b74 --- /dev/null +++ b/minimal/package.json @@ -0,0 +1,16 @@ +{ + "name": "__waspAppName__", + "type": "module", + "dependencies": { + "wasp": "file:.wasp/out/sdk/wasp", + "react": "^18.2.0", + "react-dom": "^18.2.0", + "react-router-dom": "^6.26.2" + }, + "devDependencies": { + "typescript": "^5.1.0", + "vite": "^4.3.9", + "@types/react": "^18.0.37", + "prisma": "5.19.1" + } +} diff --git a/minimal/public/favicon.ico b/minimal/public/favicon.ico new file mode 100644 index 0000000..dad3f80 Binary files /dev/null and b/minimal/public/favicon.ico differ diff --git a/minimal/schema.prisma b/minimal/schema.prisma new file mode 100644 index 0000000..190e2a8 --- /dev/null +++ b/minimal/schema.prisma @@ -0,0 +1,10 @@ +datasource db { + provider = "sqlite" + // Wasp requires that the url is set to the DATABASE_URL environment variable. + url = env("DATABASE_URL") +} + +// Wasp requires the `prisma-client-js` generator to be present. +generator client { + provider = "prisma-client-js" +} diff --git a/minimal/src/Main.css b/minimal/src/Main.css new file mode 100644 index 0000000..51070ef --- /dev/null +++ b/minimal/src/Main.css @@ -0,0 +1,96 @@ +* { + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + box-sizing: border-box; + margin: 0; + padding: 0; +} + +body { + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", + "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", + sans-serif; +} + +#root { + min-height: 100vh; + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; +} + +.container { + margin: 3rem 3rem 10rem 3rem; + max-width: 726px; + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + text-align: center; +} + +.logo { + max-height: 200px; + margin-bottom: 1rem; +} + +.title { + font-size: 4rem; + font-weight: 700; + margin-bottom: 1rem; +} + +.content { + font-size: 1.2rem; + font-weight: 400; + line-height: 2; + margin-bottom: 3rem; +} + +.buttons { + display: flex; + flex-direction: row; + gap: 1rem; +} + +.button { + font-size: 1.2rem; + font-weight: 700; + text-decoration: none; + padding: 1.2rem 1.5rem; + border-radius: 10px; +} + +.button-filled { + color: black; + background-color: #ffcc00; + border: 2px solid #ffcc00; + + transition: all 0.2s ease-in-out; +} + +.button-filled:hover { + filter: brightness(0.95); +} + +.button-outlined { + color: black; + background-color: transparent; + border: 2px solid #ffcc00; + + transition: all 0.2s ease-in-out; +} + +.button-outlined:hover { + filter: brightness(0.95); +} + +code { + border-radius: 5px; + border: 1px solid #ffcc00; + padding: 0.2rem; + background: #ffcc0044; + font-family: Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono, + Bitstream Vera Sans Mono, Courier New, monospace; +} diff --git a/minimal/src/MainPage.tsx b/minimal/src/MainPage.tsx new file mode 100644 index 0000000..bdb62b3 --- /dev/null +++ b/minimal/src/MainPage.tsx @@ -0,0 +1,37 @@ +import Logo from "./assets/logo.svg"; +import "./Main.css"; + +export function MainPage() { + return ( +
+ wasp + +

Welcome to Wasp!

+ +

+ This is page MainPage located at route /. +
+ Open src/MainPage.tsx to edit it. +

+ +
+ + Take the Tutorial + + + Chat on Discord + +
+
+ ); +} diff --git a/minimal/src/assets/logo.svg b/minimal/src/assets/logo.svg new file mode 100644 index 0000000..faa99ae --- /dev/null +++ b/minimal/src/assets/logo.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/minimal/src/vite-env.d.ts b/minimal/src/vite-env.d.ts new file mode 100644 index 0000000..29a4875 --- /dev/null +++ b/minimal/src/vite-env.d.ts @@ -0,0 +1,7 @@ +/// + +// This is needed to properly support Vitest testing with jest-dom matchers. +// Types for jest-dom are not recognized automatically and Typescript complains +// about missing types e.g. when using `toBeInTheDocument` and other matchers. +// Reference: https://github.com/testing-library/jest-dom/issues/546#issuecomment-1889884843 +import "@testing-library/jest-dom"; diff --git a/minimal/tsconfig.json b/minimal/tsconfig.json new file mode 100644 index 0000000..1d0d13c --- /dev/null +++ b/minimal/tsconfig.json @@ -0,0 +1,28 @@ +// =============================== IMPORTANT ================================= +// This file is mainly used for Wasp IDE support. +// +// Wasp will compile your code with slightly different (less strict) compilerOptions. +// You can increase the configuration's strictness (e.g., by adding +// "noUncheckedIndexedAccess": true), but you shouldn't reduce it (e.g., by +// adding "strict": false). Just keep in mind that this will only affect your +// IDE support, not the actual compilation. +// +// Full TypeScript configurability is coming very soon :) +{ + "compilerOptions": { + "module": "esnext", + "composite": true, + "target": "esnext", + "moduleResolution": "bundler", + "jsx": "preserve", + "strict": true, + "esModuleInterop": true, + "isolatedModules": true, + "moduleDetection": "force", + "lib": ["dom", "dom.iterable", "esnext"], + "skipLibCheck": true, + "allowJs": true, + "outDir": ".wasp/out/user" + }, + "include": ["src"] +} diff --git a/minimal/vite.config.ts b/minimal/vite.config.ts new file mode 100644 index 0000000..a55924e --- /dev/null +++ b/minimal/vite.config.ts @@ -0,0 +1,7 @@ +import { defineConfig } from 'vite' + +export default defineConfig({ + server: { + open: true, + }, +})