Skip to content

kristencheung/photo-library

Repository files navigation

This is a Next.js side project inspired by the app Cosmos. Using the app, one can sign in with Twitter, create a photo, or otherwise, an Element, and delete the Element if they'd like.

Pre-requisites

This app was built on Supabase and requires a free-tier version. After creating a Supabase project, fill in the env template credentials to run the app smoothly.

Auth

Within the Supabase dashboard, head to Authentication -> Providers and ensure Twitter is enabled. You will also need to set up a Twitter OAuth app in which you can follow the Supabase documention to set that up: docs

Via Authentication -> URL configuration, make sure that the site URL is configured.

Migrations

In the CLI, install Supabase's CLI

brew install supabase/tap/supabase

Run supabase link to link this project to your Supabase project. Enter in the database password.

Run pnpm run generate && pnpm run migrate to apply migrations. To push the migrations up to the Supabase database, run supabase db push.

Getting started

First, run the development server:

npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun dev

Open http://localhost:3000 with your browser to see the result. To develop locally, check out Supabase docs to develop locally or point your app with the database url to the Supabase database URL. Ensure the Twitter OAuth App and Supabase URL configuration site URLs are set to the development URL if you are using the Supabase project database URL.

Learn More

To learn more about Next.js, take a look at the following resources:

You can check out the Next.js GitHub repository.

Deploy on Vercel

The easiest way to deploy your Next.js app is to use the Vercel Platform from the creators of Next.js.

Check out the Next.js deployment documentation for more details.