Skip to content
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ This repository has various example projects created by the Appwrite community u

## Small Examples

- [**Blog**](/example-blog/) Example of how to build blog pages using Astro.
- [**example-blog**](https://demos-for-astro-example-blog.vercel.app/) - a basic blog with authentication, posts and comments.
Comment thread
loks0n marked this conversation as resolved.
Outdated

## Large Projects

Expand Down
5 changes: 3 additions & 2 deletions example-blog/.env.template
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@ PUBLIC_APPWRITE_ENDPOINT=YOUR_ENDPOINT
PUBLIC_APPWRITE_PROJECT_ID=YOUR_PROJECT_ID

PUBLIC_APPWRITE_DB_ID=YOUR_DATABASE_ID
PUBLIC_APPWRITE_BLOG_ID=YOUR_BLOG_COLLECTION_ID
PUBLIC_APPWRITE_COMMENTS_ID=YOUR_BLOG_COMMENTS_COLLECTION_ID
PUBLIC_APPWRITE_POSTS_ID=YOUR_POSTS_COLLECTION_ID
PUBLIC_APPWRITE_COMMENTS_ID=YOUR_COMMENTS_COLLECTION_ID
PUBLIC_APPWRITE_BUCKET_ID=YOUR_BUCKET_ID
1 change: 1 addition & 0 deletions example-blog/.gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# build output
dist/
.vercel
# generated types
.astro/

Expand Down
1 change: 1 addition & 0 deletions example-blog/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
appwrite.json
3 changes: 0 additions & 3 deletions example-blog/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,6 @@ npm create astro@latest -- --template blog

> 🧑‍🚀 **Seasoned astronaut?** Delete this file. Have fun!


![blog](https://user-images.githubusercontent.com/4677417/186189140-4ef17aac-c3c9-4918-a8c2-ce86ba1bb394.png)

Features:

- ✅ Minimal styling (make it your own!)
Expand Down
88 changes: 59 additions & 29 deletions example-blog/appwrite.json
Original file line number Diff line number Diff line change
@@ -1,32 +1,28 @@
{
"projectId": "6062f9c2c09ce",
"projectName": "Appwrite Demos",
"projectId": "demos_for_astro",
"projectName": "Demos For Astro",
"databases": [
{
"$id": "blog",
"name": "Blog",
"$createdAt": "2023-05-24T10:32:35.676+00:00",
"$updatedAt": "2023-05-24T10:32:35.676+00:00"
}
],
"collections": [
{
"$id": "63ecf94aad01784f9c65",
"$createdAt": "2023-02-15T15:24:58.708+00:00",
"$updatedAt": "2023-02-19T22:17:01.591+00:00",
"$id": "posts",
"$permissions": [
"read(\"any\")",
"create(\"team:63f29f648b9a34a914d1\")",
"read(\"team:63f29f648b9a34a914d1\")",
"update(\"team:63f29f648b9a34a914d1\")",
"delete(\"team:63f29f648b9a34a914d1\")"
"create(\"team:authors\")",
"update(\"team:authors\")",
"delete(\"team:authors\")"
],
"databaseId": "default",
"name": "Astro Example Blog",
"databaseId": "blog",
"name": "Posts",
"enabled": true,
"documentSecurity": false,
"documentSecurity": true,
"attributes": [
{
"key": "date",
"type": "datetime",
"status": "available",
"required": true,
"array": false,
"format": "",
"default": null
},
{
"key": "slug",
"type": "string",
Expand Down Expand Up @@ -62,6 +58,15 @@
"array": false,
"size": 255,
"default": null
},
{
"key": "imageUrl",
"type": "string",
"status": "available",
"required": false,
"array": false,
"format": "url",
"default": null
}
],
"indexes": [
Expand All @@ -79,15 +84,13 @@
]
},
{
"$id": "63f6538dbe55918d0685",
"$createdAt": "2023-02-22T17:40:29.779+00:00",
"$updatedAt": "2023-02-22T18:46:38.358+00:00",
"$id": "comments",
"$permissions": [
"create(\"users\")",
"read(\"users\")"
"read(\"any\")",
"create(\"users\")"
],
"databaseId": "default",
"name": "Astro Example Comments",
"databaseId": "blog",
"name": "Comments",
"enabled": true,
"documentSecurity": true,
"attributes": [
Expand All @@ -101,7 +104,7 @@
"default": null
},
{
"key": "comment",
"key": "content",
"type": "string",
"status": "available",
"required": true,
Expand All @@ -124,5 +127,32 @@
}
]
}
],
"teams": [
{
"$id": "authors",
"name": "authors"
}
],
"buckets": [
{
"$id": "post_images",
"$createdAt": "2023-05-24T14:03:26.874+00:00",
"$updatedAt": "2023-05-24T14:04:32.937+00:00",
"$permissions": [
"read(\"any\")",
"create(\"team:authors\")",
"update(\"team:authors\")",
"delete(\"team:authors\")"
],
"fileSecurity": false,
"name": "post_images",
"enabled": true,
"maximumFileSize": 3000000000,
"allowedFileExtensions": [],
"compression": "none",
"encryption": true,
"antivirus": true
}
]
}
14 changes: 7 additions & 7 deletions example-blog/astro.config.mjs
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { defineConfig } from 'astro/config';
import mdx from '@astrojs/mdx';
import sitemap from '@astrojs/sitemap';
import { defineConfig } from "astro/config";
import mdx from "@astrojs/mdx";
import sitemap from "@astrojs/sitemap";

// https://astro.build/config
import vercel from "@astrojs/vercel/serverless";

// https://astro.build/config
export default defineConfig({
output: 'server',
site: 'https://example.com',
output: "server",
site: "https://appwrite-demos-for-astro-blog.vercel.app",
integrations: [mdx(), sitemap()],
adapter: vercel()
});
adapter: vercel(),
});
Loading