Skip to content

Commit b9ee6b5

Browse files
authored
Merge pull request #363 from Merit-Systems/sragss/create-echo-app
feat: create-echo-app
2 parents 725aeb1 + 77e53c3 commit b9ee6b5

File tree

19 files changed

+723
-69
lines changed

19 files changed

+723
-69
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ out/
1919
.env.development.local
2020
.env.test.local
2121
.env.production.local
22+
# Allow .env.local in examples directory
23+
!/examples/**/.env.local
2224

2325
# Testing
2426
coverage/
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
22
"title": "Getting Started",
3-
"pages": ["react", "next-js", "cli", "markup-and-referrals"]
3+
"pages": ["templates", "react", "next-js", "cli"]
44
}
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
---
2+
title: Templates
3+
description: Get started quickly with Echo using pre-built templates
4+
---
5+
6+
import { Step, Steps } from 'fumadocs-ui/components/steps';
7+
8+
The easiest way to get started with Echo is to use one of our pre-built templates.
9+
10+
## React
11+
12+
The React template is a simple application that uses Vite and `echo-react-sdk`. Uniquely Echo does not require
13+
a server to make API calls because it handles Oauth directly in the browser.
14+
15+
<Steps>
16+
<Step>
17+
### Create an Echo App
18+
Go to [echo.merit.systems/new](https://echo.merit.systems/new) to get an `app_id`.
19+
</Step>
20+
21+
<Step>
22+
### Create a React app using Vite
23+
Run the following commands to create a new React app using Vite.
24+
25+
<Tabs items={['npm', 'yarn', 'pnpm', 'bun']}>
26+
<Tab value="npm">
27+
```sh lineNumbers
28+
npx echo-start@latest --template react --app-id YOUR_ECHO_APP_ID
29+
```
30+
</Tab>
31+
<Tab value="yarn">
32+
```sh lineNumbers
33+
yarn dlx echo-start@latest --template react --app-id YOUR_ECHO_APP_ID
34+
```
35+
</Tab>
36+
<Tab value="pnpm">
37+
```sh lineNumbers
38+
pnpx echo-start@latest --template react --app-id YOUR_ECHO_APP_ID
39+
```
40+
</Tab>
41+
<Tab value="bun">
42+
```sh lineNumbers
43+
bunx echo-start@latest --template react --app-id YOUR_ECHO_APP_ID
44+
```
45+
</Tab>
46+
</Tabs>
47+
</Step>
48+
49+
50+
</Steps>
51+
52+
## Next.js
53+
54+
The Next.js template is a full-stack application that uses the Next.js framework with the `echo-next-sdk`.
55+
56+
<Steps>
57+
<Step>
58+
### Create an Echo app
59+
Go to [echo.merit.systems/new](https://echo.merit.systems/new) to get an `app_id`.
60+
</Step>
61+
62+
<Step>
63+
### Create a Next.js app
64+
Run the following commands to create a new Next.js app.
65+
66+
<Tabs items={['npm', 'yarn', 'pnpm', 'bun']}>
67+
<Tab value="npm">
68+
```sh lineNumbers
69+
npx echo-start@latest --template next --app-id YOUR_ECHO_APP_ID
70+
```
71+
</Tab>
72+
<Tab value="yarn">
73+
```sh lineNumbers
74+
yarn dlx echo-start@latest --template next --app-id YOUR_ECHO_APP_ID
75+
```
76+
</Tab>
77+
<Tab value="pnpm">
78+
```sh lineNumbers
79+
pnpx echo-start@latest --template next --app-id YOUR_ECHO_APP_ID
80+
```
81+
</Tab>
82+
<Tab value="bun">
83+
```sh lineNumbers
84+
bunx echo-start@latest --template next --app-id YOUR_ECHO_APP_ID
85+
```
86+
</Tab>
87+
</Tabs>
88+
</Step>
89+
</Steps>

echo-control/docs/meta.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"pages": [
33
"index",
44
"getting-started",
5+
"money",
56
"react-sdk",
67
"next-sdk",
78
"typescript-sdk",
File renamed without changes.

echo-control/src/components/admin/UsersCsvDownload.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export function UsersCsvDownload() {
1919
const [isPopoverOpen, setIsPopoverOpen] = useState(false);
2020

2121
const downloadCsvMutation = api.admin.downloadUsersCsv.useMutation({
22-
onSuccess: (data) => {
22+
onSuccess: data => {
2323
// Create and trigger download
2424
const blob = new Blob([data.csvString], { type: 'text/csv' });
2525
const url = window.URL.createObjectURL(blob);
@@ -35,7 +35,7 @@ export function UsersCsvDownload() {
3535
`Successfully downloaded CSV with ${data.userCount} users created after ${format(selectedDate!, 'PPP')}`
3636
);
3737
},
38-
onError: (error) => {
38+
onError: error => {
3939
toast.error(`Failed to download CSV: ${error.message}`);
4040
},
4141
});
@@ -76,7 +76,7 @@ export function UsersCsvDownload() {
7676
<CalendarComponent
7777
mode="single"
7878
selected={selectedDate}
79-
onSelect={(date) => {
79+
onSelect={date => {
8080
setSelectedDate(date);
8181
setIsPopoverOpen(false);
8282
}}

echo-control/src/services/admin/admin.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ export async function downloadUsersCsv(
129129
const csvString = csvData
130130
.map(row => row.map(field => `"${field}"`).join(','))
131131
.join('\n');
132-
132+
133133
return {
134134
csvString,
135135
filename: `users-created-after-${input.createdAfter.toISOString().split('T')[0]}.csv`,

echo-start/package.json

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
{
2+
"name": "echo-start",
3+
"version": "0.1.0",
4+
"description": "Create Echo applications from templates",
5+
"type": "module",
6+
"main": "dist/index.js",
7+
"bin": {
8+
"echo-start": "dist/index.js"
9+
},
10+
"files": [
11+
"dist"
12+
],
13+
"scripts": {
14+
"build": "tsup",
15+
"dev": "tsup --watch",
16+
"type-check": "tsc --noEmit",
17+
"lint": "eslint src --ext .ts",
18+
"lint:fix": "eslint src --ext .ts --fix"
19+
},
20+
"keywords": [
21+
"echo",
22+
"scaffolding",
23+
"cli",
24+
"template"
25+
],
26+
"author": "Merit Systems",
27+
"license": "MIT",
28+
"dependencies": {
29+
"chalk": "^5.3.0",
30+
"commander": "^12.1.0",
31+
"degit": "^2.8.4",
32+
"ora": "^8.2.0",
33+
"prompts": "^2.4.2"
34+
},
35+
"devDependencies": {
36+
"@types/degit": "^2.8.6",
37+
"@types/node": "^22.5.4",
38+
"@types/prompts": "^2.4.9",
39+
"tsup": "^8.5.0",
40+
"typescript": "^5.8.3"
41+
},
42+
"engines": {
43+
"node": ">=18.0.0"
44+
}
45+
}

0 commit comments

Comments
 (0)