Skip to content

chris-hendrix/fantasy-draft-site

Repository files navigation

Fantasy Draft Site ⚾🏈

Description

A Typescript fantasy baseball/football drafting site web project using Next.js (App Router) and Tailwind, and Postgres. User authentication (username/password) has been set up using NextAuth.js.

This boilerplate contains:

Installation

  1. Install Node LTS
  2. Install Docker
  3. Clone this repo
  4. Create the following .env file
# next-auth
SECRET=TODO

# supabase
NEXT_PUBLIC_SUPABASE_URL=TODO
NEXT_PUBLIC_SUPABASE_ANON_KEY=TODO

# database
POSTGRES_HOSTNAME=localhost
POSTGRES_PORT=5432
POSTGRES_USER=postgres
POSTGRES_PASSWORD=postgres
POSTGRES_DB=postgres
DATABASE_URI=postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOSTNAME}:${POSTGRES_PORT}/${POSTGRES_DB}?schema=public
DIRECT_URI=${DATABASE_URI}
  1. Run the following in the root directory
npm run install
npm migrate
  1. For automatic tagging, allow read and write permissions for workflows in your github repo's Settings > Actions > General > Workflow permissions section.

Start locally

The following command will containerize, build, and start the database, backend, and frontend

npm run up
npm run dev

Setup user profile image upload Supabase (optional)

  1. Sign up and create a project on supabase.
  2. Create a public storage bucket and add SUPABASE_BUCKET to the .env above
  3. Add a policy to your bucket that allows SELECT, INSERT, UPDATE, and DELETE.
  4. From Settings > API, add your URL and anon/public API keys to the .env as SUPABASE_URL and SUPABASE_ANON_KEY.

About

A Next.js site for custom fantasy sports drafts

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages