Skip to content

What do pigeons secretly say about us? it's all here

Notifications You must be signed in to change notification settings

Muurilo/Pruwitter

Repository files navigation

Pruwitter - Twitter for pigeons

Simple project in NextJs with FaunaDB and GraphQL

Deploy your own

Deploy the project using Vercel:

Deploy with Vercel

How to use

To use a live FaunaDB database, create a database at dashboard.fauna.com and generate an admin token by going to the Security tab on the left and then click New Key. Give the new key a name and select the 'Admin' Role. Copy the token since the setup script will ask for it. Do not use it in the frontend, it has superpowers which you don't want to give to your users.

The database can then be set up with the delivered setup by running:

npm run setup
# or
yarn setup

This script will ask for the admin token. Once you provide it with a valid token, this is what the script automatically does for you:

  • Import the GraphQL schema, by importing a GraphQL schema in FaunaDB, FaunaDB automatically sets up collections and indexes to support your queries. This is now done for you with this script but can also be done from the dashboard.fauna.com UI by going to the GraphQL tab
  • Create a role suitable for the Client, FaunaDB has a security system that allows you to define which resources can be accessed for a specific token. That's how we limit our clients powers, feel free to look at the scripts/setup.js script to see how we make roles and tokens.
  • Create a token for that role which is printed, this is the token to be used in the frontend.

At the end, a .env.local file will be created for you with the newly generated client token assigned to an environment variable.

Run locally

Install packages, then run the development server:

npm install
npm run dev
# or
yarn
yarn dev

Your app should be up and running on http://localhost:3000!

Deploy

Deploy with Vercel

About

What do pigeons secretly say about us? it's all here

Resources

Stars

Watchers

Forks