Setup
Dependencies
Before you start you will need the following:
Setting up the database for local development is currently a work in progress given that the Drizzle connector only supports connections to Vercel / Neon. The documentation will be updated with new instructions for using the Postgres Docker container.
You do not need Docker as of now.
Setup Instructions
- Clone the repo
git clone git@github.com:sandboxnu/cooper.git
cd cooper
- Install the necessary dependencies.
pnpm install
- Configure the
.env
file by following the template in.env.example
. See Environment File.
Environment File
- Create a new file called
.env
or copy the.env.example
and rename it to.env
.
cp .env.example .env
- Complete the file to add your environment variables. These are the defaults for local development. Make sure that the
docker
container is running.
POSTGRES_URL='<url>'
AUTH_SECRET='supersecret'
AUTH_GOOGLE_ID=''
AUTH_GOOGLE_SECRET=''
Database
While the Node Postgres work is in progress, the best way to get a Postgres database up and running that supports the existing database connection code would be through Neon.
- Sign in using your GitHub account
- Create a new Project
- Copy the Connection String. Make sure that Pooled connection is checked.
Authentication
To generate AUTH_GOOGLE_ID
and AUTH_GOOGLE_SECRET
, see Setting up OAuth 2.0. Ensure that you set the value of Authorized JavaScript origins and Authorized redirect URIs to the appropriate URLs. To generate a new AUTH_SECRET
, run the following command in your terminal and add it to the .env
file.
openssl rand -base64 32