Skip to content

Commit 2254661

Browse files
committed
adding demo app
1 parent 342ecf3 commit 2254661

23 files changed

+959
-0
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"extends": "next"
3+
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules/
2+
.next/
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"$schema": "https://ui.shadcn.com/schema.json",
3+
"style": "new-york",
4+
"rsc": true,
5+
"tsx": true,
6+
"tailwind": {
7+
"config": "tailwind.config.ts",
8+
"css": "src/app/globals.css",
9+
"baseColor": "neutral",
10+
"cssVariables": true,
11+
"prefix": ""
12+
},
13+
"iconLibrary": "lucide",
14+
"aliases": {
15+
"components": "@/styles/components",
16+
"utils": "@/styles/lib/utils",
17+
"ui": "@/styles/components/ui",
18+
"lib": "@/styles/lib",
19+
"hooks": "@/styles/hooks"
20+
}
21+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/* eslint-disable */
2+
/**
3+
* Generated `api` utility.
4+
*
5+
* THIS CODE IS AUTOMATICALLY GENERATED.
6+
*
7+
* To regenerate, run `npx convex dev`.
8+
* @module
9+
*/
10+
11+
import type {
12+
ApiFromModules,
13+
FilterApi,
14+
FunctionReference,
15+
} from "convex/server";
16+
import type * as queries from "../queries.js";
17+
18+
/**
19+
* A utility for referencing Convex functions in your app's API.
20+
*
21+
* Usage:
22+
* ```js
23+
* const myFunctionReference = api.myModule.myFunction;
24+
* ```
25+
*/
26+
declare const fullApi: ApiFromModules<{
27+
queries: typeof queries;
28+
}>;
29+
export declare const api: FilterApi<
30+
typeof fullApi,
31+
FunctionReference<any, "public">
32+
>;
33+
export declare const internal: FilterApi<
34+
typeof fullApi,
35+
FunctionReference<any, "internal">
36+
>;
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/* eslint-disable */
2+
/**
3+
* Generated `api` utility.
4+
*
5+
* THIS CODE IS AUTOMATICALLY GENERATED.
6+
*
7+
* To regenerate, run `npx convex dev`.
8+
* @module
9+
*/
10+
11+
import { anyApi } from "convex/server";
12+
13+
/**
14+
* A utility for referencing Convex functions in your app's API.
15+
*
16+
* Usage:
17+
* ```js
18+
* const myFunctionReference = api.myModule.myFunction;
19+
* ```
20+
*/
21+
export const api = anyApi;
22+
export const internal = anyApi;
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
/* eslint-disable */
2+
/**
3+
* Generated data model types.
4+
*
5+
* THIS CODE IS AUTOMATICALLY GENERATED.
6+
*
7+
* To regenerate, run `npx convex dev`.
8+
* @module
9+
*/
10+
11+
import { AnyDataModel } from "convex/server";
12+
import type { GenericId } from "convex/values";
13+
14+
/**
15+
* No `schema.ts` file found!
16+
*
17+
* This generated code has permissive types like `Doc = any` because
18+
* Convex doesn't know your schema. If you'd like more type safety, see
19+
* https://docs.convex.dev/using/schemas for instructions on how to add a
20+
* schema file.
21+
*
22+
* After you change a schema, rerun codegen with `npx convex dev`.
23+
*/
24+
25+
/**
26+
* The names of all of your Convex tables.
27+
*/
28+
export type TableNames = string;
29+
30+
/**
31+
* The type of a document stored in Convex.
32+
*/
33+
export type Doc = any;
34+
35+
/**
36+
* An identifier for a document in Convex.
37+
*
38+
* Convex documents are uniquely identified by their `Id`, which is accessible
39+
* on the `_id` field. To learn more, see [Document IDs](https://docs.convex.dev/using/document-ids).
40+
*
41+
* Documents can be loaded using `db.get(id)` in query and mutation functions.
42+
*
43+
* IDs are just strings at runtime, but this type can be used to distinguish them from other
44+
* strings when type checking.
45+
*/
46+
export type Id<TableName extends TableNames = TableNames> =
47+
GenericId<TableName>;
48+
49+
/**
50+
* A type describing your Convex data model.
51+
*
52+
* This type includes information about what tables you have, the type of
53+
* documents stored in those tables, and the indexes defined on them.
54+
*
55+
* This type is used to parameterize methods like `queryGeneric` and
56+
* `mutationGeneric` to make them type-safe.
57+
*/
58+
export type DataModel = AnyDataModel;
Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
/* eslint-disable */
2+
/**
3+
* Generated utilities for implementing server-side Convex query and mutation functions.
4+
*
5+
* THIS CODE IS AUTOMATICALLY GENERATED.
6+
*
7+
* To regenerate, run `npx convex dev`.
8+
* @module
9+
*/
10+
11+
import {
12+
ActionBuilder,
13+
HttpActionBuilder,
14+
MutationBuilder,
15+
QueryBuilder,
16+
GenericActionCtx,
17+
GenericMutationCtx,
18+
GenericQueryCtx,
19+
GenericDatabaseReader,
20+
GenericDatabaseWriter,
21+
} from "convex/server";
22+
import type { DataModel } from "./dataModel.js";
23+
24+
/**
25+
* Define a query in this Convex app's public API.
26+
*
27+
* This function will be allowed to read your Convex database and will be accessible from the client.
28+
*
29+
* @param func - The query function. It receives a {@link QueryCtx} as its first argument.
30+
* @returns The wrapped query. Include this as an `export` to name it and make it accessible.
31+
*/
32+
export declare const query: QueryBuilder<DataModel, "public">;
33+
34+
/**
35+
* Define a query that is only accessible from other Convex functions (but not from the client).
36+
*
37+
* This function will be allowed to read from your Convex database. It will not be accessible from the client.
38+
*
39+
* @param func - The query function. It receives a {@link QueryCtx} as its first argument.
40+
* @returns The wrapped query. Include this as an `export` to name it and make it accessible.
41+
*/
42+
export declare const internalQuery: QueryBuilder<DataModel, "internal">;
43+
44+
/**
45+
* Define a mutation in this Convex app's public API.
46+
*
47+
* This function will be allowed to modify your Convex database and will be accessible from the client.
48+
*
49+
* @param func - The mutation function. It receives a {@link MutationCtx} as its first argument.
50+
* @returns The wrapped mutation. Include this as an `export` to name it and make it accessible.
51+
*/
52+
export declare const mutation: MutationBuilder<DataModel, "public">;
53+
54+
/**
55+
* Define a mutation that is only accessible from other Convex functions (but not from the client).
56+
*
57+
* This function will be allowed to modify your Convex database. It will not be accessible from the client.
58+
*
59+
* @param func - The mutation function. It receives a {@link MutationCtx} as its first argument.
60+
* @returns The wrapped mutation. Include this as an `export` to name it and make it accessible.
61+
*/
62+
export declare const internalMutation: MutationBuilder<DataModel, "internal">;
63+
64+
/**
65+
* Define an action in this Convex app's public API.
66+
*
67+
* An action is a function which can execute any JavaScript code, including non-deterministic
68+
* code and code with side-effects, like calling third-party services.
69+
* They can be run in Convex's JavaScript environment or in Node.js using the "use node" directive.
70+
* They can interact with the database indirectly by calling queries and mutations using the {@link ActionCtx}.
71+
*
72+
* @param func - The action. It receives an {@link ActionCtx} as its first argument.
73+
* @returns The wrapped action. Include this as an `export` to name it and make it accessible.
74+
*/
75+
export declare const action: ActionBuilder<DataModel, "public">;
76+
77+
/**
78+
* Define an action that is only accessible from other Convex functions (but not from the client).
79+
*
80+
* @param func - The function. It receives an {@link ActionCtx} as its first argument.
81+
* @returns The wrapped function. Include this as an `export` to name it and make it accessible.
82+
*/
83+
export declare const internalAction: ActionBuilder<DataModel, "internal">;
84+
85+
/**
86+
* Define an HTTP action.
87+
*
88+
* This function will be used to respond to HTTP requests received by a Convex
89+
* deployment if the requests matches the path and method where this action
90+
* is routed. Be sure to route your action in `convex/http.js`.
91+
*
92+
* @param func - The function. It receives an {@link ActionCtx} as its first argument.
93+
* @returns The wrapped function. Import this function from `convex/http.js` and route it to hook it up.
94+
*/
95+
export declare const httpAction: HttpActionBuilder;
96+
97+
/**
98+
* A set of services for use within Convex query functions.
99+
*
100+
* The query context is passed as the first argument to any Convex query
101+
* function run on the server.
102+
*
103+
* This differs from the {@link MutationCtx} because all of the services are
104+
* read-only.
105+
*/
106+
export type QueryCtx = GenericQueryCtx<DataModel>;
107+
108+
/**
109+
* A set of services for use within Convex mutation functions.
110+
*
111+
* The mutation context is passed as the first argument to any Convex mutation
112+
* function run on the server.
113+
*/
114+
export type MutationCtx = GenericMutationCtx<DataModel>;
115+
116+
/**
117+
* A set of services for use within Convex action functions.
118+
*
119+
* The action context is passed as the first argument to any Convex action
120+
* function run on the server.
121+
*/
122+
export type ActionCtx = GenericActionCtx<DataModel>;
123+
124+
/**
125+
* An interface to read from the database within Convex query functions.
126+
*
127+
* The two entry points are {@link DatabaseReader.get}, which fetches a single
128+
* document by its {@link Id}, or {@link DatabaseReader.query}, which starts
129+
* building a query.
130+
*/
131+
export type DatabaseReader = GenericDatabaseReader<DataModel>;
132+
133+
/**
134+
* An interface to read from and write to the database within Convex mutation
135+
* functions.
136+
*
137+
* Convex guarantees that all writes within a single mutation are
138+
* executed atomically, so you never have to worry about partial writes leaving
139+
* your data in an inconsistent state. See [the Convex Guide](https://docs.convex.dev/understanding/convex-fundamentals/functions#atomicity-and-optimistic-concurrency-control)
140+
* for the guarantees Convex provides your functions.
141+
*/
142+
export type DatabaseWriter = GenericDatabaseWriter<DataModel>;
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
/* eslint-disable */
2+
/**
3+
* Generated utilities for implementing server-side Convex query and mutation functions.
4+
*
5+
* THIS CODE IS AUTOMATICALLY GENERATED.
6+
*
7+
* To regenerate, run `npx convex dev`.
8+
* @module
9+
*/
10+
11+
import {
12+
actionGeneric,
13+
httpActionGeneric,
14+
queryGeneric,
15+
mutationGeneric,
16+
internalActionGeneric,
17+
internalMutationGeneric,
18+
internalQueryGeneric,
19+
} from "convex/server";
20+
21+
/**
22+
* Define a query in this Convex app's public API.
23+
*
24+
* This function will be allowed to read your Convex database and will be accessible from the client.
25+
*
26+
* @param func - The query function. It receives a {@link QueryCtx} as its first argument.
27+
* @returns The wrapped query. Include this as an `export` to name it and make it accessible.
28+
*/
29+
export const query = queryGeneric;
30+
31+
/**
32+
* Define a query that is only accessible from other Convex functions (but not from the client).
33+
*
34+
* This function will be allowed to read from your Convex database. It will not be accessible from the client.
35+
*
36+
* @param func - The query function. It receives a {@link QueryCtx} as its first argument.
37+
* @returns The wrapped query. Include this as an `export` to name it and make it accessible.
38+
*/
39+
export const internalQuery = internalQueryGeneric;
40+
41+
/**
42+
* Define a mutation in this Convex app's public API.
43+
*
44+
* This function will be allowed to modify your Convex database and will be accessible from the client.
45+
*
46+
* @param func - The mutation function. It receives a {@link MutationCtx} as its first argument.
47+
* @returns The wrapped mutation. Include this as an `export` to name it and make it accessible.
48+
*/
49+
export const mutation = mutationGeneric;
50+
51+
/**
52+
* Define a mutation that is only accessible from other Convex functions (but not from the client).
53+
*
54+
* This function will be allowed to modify your Convex database. It will not be accessible from the client.
55+
*
56+
* @param func - The mutation function. It receives a {@link MutationCtx} as its first argument.
57+
* @returns The wrapped mutation. Include this as an `export` to name it and make it accessible.
58+
*/
59+
export const internalMutation = internalMutationGeneric;
60+
61+
/**
62+
* Define an action in this Convex app's public API.
63+
*
64+
* An action is a function which can execute any JavaScript code, including non-deterministic
65+
* code and code with side-effects, like calling third-party services.
66+
* They can be run in Convex's JavaScript environment or in Node.js using the "use node" directive.
67+
* They can interact with the database indirectly by calling queries and mutations using the {@link ActionCtx}.
68+
*
69+
* @param func - The action. It receives an {@link ActionCtx} as its first argument.
70+
* @returns The wrapped action. Include this as an `export` to name it and make it accessible.
71+
*/
72+
export const action = actionGeneric;
73+
74+
/**
75+
* Define an action that is only accessible from other Convex functions (but not from the client).
76+
*
77+
* @param func - The function. It receives an {@link ActionCtx} as its first argument.
78+
* @returns The wrapped function. Include this as an `export` to name it and make it accessible.
79+
*/
80+
export const internalAction = internalActionGeneric;
81+
82+
/**
83+
* Define a Convex HTTP action.
84+
*
85+
* @param func - The function. It receives an {@link ActionCtx} as its first argument, and a `Request` object
86+
* as its second.
87+
* @returns The wrapped endpoint function. Route a URL path to this function in `convex/http.js`.
88+
*/
89+
export const httpAction = httpActionGeneric;

0 commit comments

Comments
 (0)