Skip to content

Commit 5a1feaa

Browse files
committed
add demo site
1 parent 505afe8 commit 5a1feaa

File tree

164 files changed

+7943
-6789
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

164 files changed

+7943
-6789
lines changed

apps/demo/.eslintrc.json

Lines changed: 0 additions & 33 deletions
This file was deleted.

apps/demo/.prettierignore

Lines changed: 0 additions & 6 deletions
This file was deleted.

apps/demo/README.md

Lines changed: 50 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
## Project Structure
1212

13-
This project is using Qwik with [QwikCity](https://qwik.builder.io/qwikcity/overview/). QwikCity is just a extra set of tools on top of Qwik to make it easier to build a full site, including directory-based routing, layouts, and more.
13+
This project is using Qwik with [QwikCity](https://qwik.builder.io/qwikcity/overview/). QwikCity is just an extra set of tools on top of Qwik to make it easier to build a full site, including directory-based routing, layouts, and more.
1414

1515
Inside your project, you'll see the following directory structure:
1616

@@ -24,23 +24,23 @@ Inside your project, you'll see the following directory structure:
2424
└── ...
2525
```
2626

27-
- `src/routes`: Provides the directory based routing, which can include a hierarchy of `layout.tsx` layout files, and an `index.tsx` file as the page. Additionally, `index.ts` files are endpoints. Please see the [routing docs](https://qwik.builder.io/qwikcity/routing/overview/) for more info.
27+
- `src/routes`: Provides the directory-based routing, which can include a hierarchy of `layout.tsx` layout files, and an `index.tsx` file as the page. Additionally, `index.ts` files are endpoints. Please see the [routing docs](https://qwik.builder.io/qwikcity/routing/overview/) for more info.
2828

2929
- `src/components`: Recommended directory for components.
3030

3131
- `public`: Any static assets, like images, can be placed in the public directory. Please see the [Vite public directory](https://vitejs.dev/guide/assets.html#the-public-directory) for more info.
3232

3333
## Add Integrations and deployment
3434

35-
Use the `pnpm qwik add` command to add additional integrations. Some examples of integrations include: Cloudflare, Netlify or Express server, and the [Static Site Generator (SSG)](https://qwik.builder.io/qwikcity/static-site-generation/static-site-config/).
35+
Use the `pnpm qwik add` command to add additional integrations. Some examples of integrations includes: Cloudflare, Netlify or Express Server, and the [Static Site Generator (SSG)](https://qwik.builder.io/qwikcity/guides/static-site-generation/).
3636

3737
```shell
3838
pnpm qwik add # or `yarn qwik add`
3939
```
4040

4141
## Development
4242

43-
Development mode uses [Vite's development server](https://vitejs.dev/). During development, the `dev` command will server-side render (SSR) the output.
43+
Development mode uses [Vite's development server](https://vitejs.dev/). The `dev` command will server-side render (SSR) the output during development.
4444

4545
```shell
4646
npm start # or `yarn start`
@@ -50,16 +50,60 @@ npm start # or `yarn start`
5050
5151
## Preview
5252

53-
The preview command will create a production build of the client modules, a production build of `src/entry.preview.tsx`, and run a local server. The preview server is only for convenience to locally preview a production build, and it should not be used as a production server.
53+
The preview command will create a production build of the client modules, a production build of `src/entry.preview.tsx`, and run a local server. The preview server is only for convenience to preview a production build locally and should not be used as a production server.
5454

5555
```shell
5656
pnpm preview # or `yarn preview`
5757
```
5858

5959
## Production
6060

61-
The production build will generate client and server modules by running both client and server build commands. Additionally, the build command will use Typescript to run a type check on the source code.
61+
The production build will generate client and server modules by running both client and server build commands. The build command will use Typescript to run a type check on the source code.
6262

6363
```shell
6464
pnpm build # or `yarn build`
6565
```
66+
67+
## Vercel Edge
68+
69+
This starter site is configured to deploy to [Vercel Edge Functions](https://vercel.com/docs/concepts/functions/edge-functions), which means it will be rendered at an edge location near to your users.
70+
71+
## Installation
72+
73+
The adaptor will add a new `vite.config.ts` within the `adapters/` directory, and a new entry file will be created, such as:
74+
75+
```
76+
└── adapters/
77+
└── vercel-edge/
78+
└── vite.config.ts
79+
└── src/
80+
└── entry.vercel-edge.tsx
81+
```
82+
83+
Additionally, within the `package.json`, the `build.server` script will be updated with the Vercel Edge build.
84+
85+
## Production build
86+
87+
To build the application for production, use the `build` command, this command will automatically run `npm run build.server` and `npm run build.client`:
88+
89+
```shell
90+
npm run build
91+
```
92+
93+
[Read the full guide here](https://github.com/BuilderIO/qwik/blob/main/starters/adapters/vercel-edge/README.md)
94+
95+
## Dev deploy
96+
97+
To deploy the application for development:
98+
99+
```shell
100+
npm run deploy
101+
```
102+
103+
Notice that you might need a [Vercel account](https://docs.Vercel.com/get-started/) in order to complete this step!
104+
105+
## Production deploy
106+
107+
The project is ready to be deployed to Vercel. However, you will need to create a git repository and push the code to it.
108+
109+
You can [deploy your site to Vercel](https://vercel.com/docs/concepts/deployments/overview) either via a Git provider integration or through the Vercel CLI.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { vercelEdgeAdapter } from "@builder.io/qwik-city/adapters/vercel-edge/vite";
2+
import { extendConfig } from "@builder.io/qwik-city/vite";
3+
import baseConfig from "../../vite.config";
4+
5+
export default extendConfig(baseConfig, () => {
6+
return {
7+
build: {
8+
ssr: true,
9+
rollupOptions: {
10+
input: ["src/entry.vercel-edge.tsx", "@qwik-city-plan"],
11+
},
12+
outDir: ".vercel/output/functions/_qwik-city.func",
13+
},
14+
plugins: [vercelEdgeAdapter()],
15+
};
16+
});

apps/demo/postcss.config.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
const { join } = require('path');
2+
3+
module.exports = {
4+
plugins: {
5+
tailwindcss: {
6+
config: join(__dirname, 'tailwind.config.js'),
7+
},
8+
autoprefixer: {},
9+
},
10+
};

apps/demo/public/images/card-1.png

176 KB
Loading

apps/demo/public/images/card-2.png

218 KB
Loading

apps/demo/public/images/card-3.png

232 KB
Loading
188 KB
Loading
176 KB
Loading

0 commit comments

Comments
 (0)