forked from withastro/docs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Backend as a Service Stubs (withastro#3101)
Co-authored-by: Alex <[email protected]> Co-authored-by: Yan Thomas <[email protected]> Co-authored-by: Sarah Rainsberger <[email protected]> Co-authored-by: Kevin Zuniga Cuellar <[email protected]>
- Loading branch information
1 parent
74d2971
commit 56270c4
Showing
18 changed files
with
228 additions
and
3 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
--- | ||
import { englishPages } from '~/content'; | ||
import { isBackendEntry } from '~/content/config'; | ||
import { isLogoKey } from '~/data/logos'; | ||
import { getLanguageFromURL } from '../util'; | ||
import CardsNav from './NavGrid/CardsNav.astro'; | ||
const lang = getLanguageFromURL(Astro.url.pathname); | ||
const enPages = englishPages.filter(isBackendEntry); | ||
/** Array of services we have good content for and want to show first in the list. */ | ||
const showFirst = ['Firebase']; | ||
// Reverse the array to make our logic simpler later. | ||
showFirst.reverse(); | ||
const links = enPages | ||
.sort((a, b) => { | ||
// Sort services in the `showFirst` array first. | ||
const aPriority = showFirst.indexOf(a.data.service); | ||
const bPriority = showFirst.indexOf(b.data.service); | ||
if (aPriority !== -1 || bPriority !== -1) return aPriority > bPriority ? -1 : 1; | ||
// Sort full guides before stubs. | ||
if (a.data.stub && !b.data.stub) return 1; | ||
if (!a.data.stub && b.data.stub) return -1; | ||
// If they’re both stubs, or neither stubs, sort alphabetically. | ||
return a.data.service.toLowerCase() > b.data.service.toLowerCase() ? 1 : -1; | ||
}) | ||
.map((page) => { | ||
const { service } = page.data; | ||
const pageUrl = '/' + page.slug.replace('en/', `${lang}/`) + '/'; | ||
const logo = isLogoKey(page.slug.split('/').pop()); | ||
return { title: service, href: pageUrl, logo }; | ||
}); | ||
--- | ||
|
||
<section class="backend-nav"> | ||
<CardsNav minimal links={links} /> | ||
</section> | ||
|
||
<style> | ||
.backend-nav > :global(*) { | ||
margin-top: -2rem; | ||
} | ||
|
||
.backend-nav > :global(* + *) { | ||
margin-top: -3rem; | ||
} | ||
|
||
.backend-nav :global(.scope) { | ||
font-weight: normal; | ||
color: var(--theme-text-lighter); | ||
} | ||
|
||
h3 { | ||
margin-bottom: 0; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
--- | ||
title: Use a backend service with Astro | ||
description: How to use a backend service to add authentication, storage and data | ||
i18nReady: true | ||
--- | ||
import BackendGuidesNav from '~/components/BackendGuidesNav.astro'; | ||
|
||
**Ready to add features like authentication, storage or data to your Astro project?** Follow one of our guides to integrate a backend service. | ||
|
||
## Backend service guides | ||
|
||
<BackendGuidesNav /> | ||
|
||
Note that many of these pages are **stubs**: they're collections of resources waiting for your contribution! | ||
|
||
## What is a backend service? | ||
|
||
A backend service is a cloud-based system that helps you build and manage your backend infrastructure. It provides a set of tools and services for managing databases, user authentication, and other server-side functionality. This enables you to focus on building your applications without having to worry about managing the underlying infrastructure. | ||
|
||
## Why would I use a backend service? | ||
|
||
You might want to consider a backend service if your project has complex server-side needs, for example: | ||
- user signups and authentication | ||
- persistant data storage | ||
- user-uploaded asset storage | ||
- API generation | ||
- realtime communication |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
--- | ||
title: Appwrite & Astro | ||
description: Add a backend to your project with Appwrite | ||
type: backend | ||
service: Appwrite | ||
stub: true | ||
--- | ||
|
||
[Appwrite](https://appwrite.io/) is a self-hosted backend-as-a-service platform that provides authentication and account management, user preferences, database and storage persistence, cloud functions, localization, image manipulation, and other server-side utilities. | ||
|
||
## Official Resources | ||
- [AppWrite Demos for Astro](https://github.com/appwrite/demos-for-astro) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
--- | ||
title: Firebase & Astro | ||
description: Add a backend to your project with Supabase | ||
type: backend | ||
service: Firebase | ||
stub: true | ||
--- | ||
import PackageManagerTabs from '~/components/tabs/PackageManagerTabs.astro' | ||
import FileTree from '~/components/FileTree.astro' | ||
|
||
|
||
[Firebase](https://firebase.google.com/) is an app development platform that provides a NoSQL database, authentication, realtime subscriptions, functions, and storage. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
--- | ||
title: Supabase & Astro | ||
description: Add a backend to your project with Supabase | ||
type: backend | ||
service: Supabase | ||
stub: true | ||
--- | ||
|
||
[Supabase](https://supabase.com/) is an open source Firebase alternative. It provides a Postgres database, authentication, edge functions, realtime subscriptions, and storage. | ||
|
||
## Community Resources | ||
- [Getting into the holiday spirit with Astro, React, and Supabase](https://www.aleksandra.codes/astro-supabase) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
--- | ||
title: Tigris & Astro | ||
description: Add a backend to your project with Tigris | ||
type: backend | ||
service: Tigris | ||
stub: true | ||
--- | ||
|
||
Tigris is an open source alternative to MongoDB and DynamoDB. It is a serverless NoSQL database and search platform with their own official [Astro integration](https://github.com/tigrisdata/tigris-astro). | ||
|
||
## Official Resources | ||
- [Creating database-driven Astro sites with the Tigris Astro integration](https://www.tigrisdata.com/blog/astro-tigris-integration/) | ||
- [Tigris Astro Integration](https://www.tigrisdata.com/docs/sdkstools/astro/) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
--- | ||
import type { MarkdownHeading } from 'astro'; | ||
import Aside from '~/components/Aside.astro'; | ||
import BackendGuidesNav from '~/components/BackendGuidesNav.astro'; | ||
import UIString from '~/components/UIString.astro'; | ||
import type { BackendEntry } from '~/content/config'; | ||
import { getGithubEditUrl } from '~/util/getGithubEditUrl'; | ||
import MainLayout from './MainLayout.astro'; | ||
export interface Props { | ||
content: BackendEntry['data']; | ||
headings: MarkdownHeading[]; | ||
} | ||
const githubEditUrl = getGithubEditUrl(Astro); | ||
const { | ||
content: { stub }, | ||
} = Astro.props; | ||
--- | ||
|
||
<MainLayout {...Astro.props}> | ||
<slot /> | ||
{ | ||
stub && ( | ||
<Aside title="Expand this stub!"> | ||
This guide is a stub. <br /> | ||
Know more about how to use this backend service with Astro?{' '} | ||
<a href={githubEditUrl} target="_blank"> | ||
<UIString key="rightSidebar.editPage" /> | ||
</a> | ||
</Aside> | ||
) | ||
} | ||
<h2><UIString key="backend.navTitle" /></h2> | ||
<BackendGuidesNav minimal /> | ||
</MainLayout> | ||
|
||
<style> | ||
a { | ||
font-weight: bold; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters