Skip to content

Commit

Permalink
Merge branch 'main' into my-submissions
Browse files Browse the repository at this point in the history
  • Loading branch information
Pabl0cks committed Sep 16, 2024
2 parents 9f2015c + f7eb7dc commit 05934da
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 2 deletions.
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,26 @@ yarn start

Visit your app on: `http://localhost:3000`.

## Enabling Submissions and Voting

Submission and Voting processes are disabled by default.

To enable the features, you need to set the following environment variables:

- `NEXT_PUBLIC_SUBMISSIONS_ENABLED`: Set to `true` to enable submissions
- `NEXT_PUBLIC_VOTING_ENABLED`: Set to `true` to enable voting

You can set these variables in your `.env.local` file for local development:

```
NEXT_PUBLIC_SUBMISSIONS_ENABLED=true
NEXT_PUBLIC_VOTING_ENABLED=true
```

For production, set these variables in your hosting provider's environment configuration.

If you want to change this default behavior, you can modify the logic in your scaffold config file located at `packages/nextjs/scaffold.config.ts`. Look for the `submissionsEnabled` and `votingEnabled` properties in the `scaffoldConfig` object.

## Database (dev info)

We are using Drizzle with Postgres. You can run `drizzle-kit` from the root with `yarn drizzle-kit`
Expand Down
2 changes: 2 additions & 0 deletions packages/nextjs/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,5 @@
# More info: https://nextjs.org/docs/pages/building-your-application/configuring/environment-variables
NEXT_PUBLIC_ALCHEMY_API_KEY=
NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID=
NEXT_PUBLIC_SUBMISSIONS_ENABLED=
NEXT_PUBLIC_VOTING_ENABLED=
4 changes: 2 additions & 2 deletions packages/nextjs/scaffold.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ const scaffoldConfig = {
onlyLocalBurnerWallet: true,

// Enable submissions
submissionsEnabled: false,
submissionsEnabled: process.env.NEXT_PUBLIC_SUBMISSIONS_ENABLED === "true" || false,

// Enable voting on submissions
votingEnabled: false,
votingEnabled: process.env.NEXT_PUBLIC_VOTING_ENABLED === "true" || false,

// Score threshold for winners and runners up
winnersThreshold: 7,
Expand Down

0 comments on commit 05934da

Please sign in to comment.