โ— PHANTOM
๐Ÿ‡ฎ๐Ÿ‡ณ IN
โœ•
Skip to content

alexndrho/stickythoughts

Repository files navigation

StickyThoughts

A collaborative wall where people can share their thoughts, opinions, and experiences anonymously or with attribution. Whether you're venting about your day, sharing political views, or connecting with others, StickyThoughts provides a space for expression.

Features

  • ๐Ÿ“ Post thoughts anonymously or with your profile
  • ๐Ÿ” Secure authentication with Google OAuth
  • ๐Ÿ’พ Media storage with Cloudflare R2
  • ๐Ÿ“ง Email notifications via Resend
  • ๐ŸŽจ Modern, responsive interface

Prerequisites

Before you begin, ensure you have:

  • Node.js (v20.9.0 or higher)
  • npm or yarn
  • A PostgreSQL database
  • Accounts for: Google Cloud Console, Cloudflare, and Resend

Setup

1. Clone and Install

git clone <repository-url>
cd sticky-thoughts
npm install

2. Environment Configuration

Create a .env file in the project root:

# Application
NEXT_PUBLIC_BASE_URL=http://localhost:3000

# Database
DATABASE_URL=postgresql://USER:PASSWORD@HOST:PORT/DATABASE?schema=public

# Authentication
BETTER_AUTH_SECRET=your-secret-key-here
GOOGLE_CLIENT_ID=your-google-client-id
GOOGLE_CLIENT_SECRET=your-google-client-secret

# Cloudflare R2 Storage
CLOUDFLARE_R2_BUCKET_NAME=your-bucket-name
CLOUDFLARE_R2_BUCKET_REGION=auto
CLOUDFLARE_R2_ACCOUNT_ID=your-account-id
CLOUDFLARE_R2_ACCESS_ID=your-access-id
CLOUDFLARE_R2_ACCESS_KEY=your-access-key
CLOUDFLARE_R2_ENDPOINT_ACCESS=your-endpoint-url

# Email
RESEND_API_KEY=your-resend-api-key

3. Obtain Environment Variables

DATABASE_URL - PostgreSQL Connection String
  1. Create a database using Prisma or any PostgreSQL compatible provider
  2. Copy your connection string in the format:
  postgresql://postgres:password@localhost:5432/stickythoughts
  1. Paste it as the DATABASE_URL value
BETTER_AUTH_SECRET - Authentication Secret

Generate a secure random string:

openssl rand -base64 32

Or use an online generator like 1Password's generator

GOOGLE_CLIENT_ID & GOOGLE_CLIENT_SECRET - OAuth Credentials
  1. Go to Google Cloud Console
  2. Create a new project (or select existing)
  3. Enable Google+ API
  4. Create OAuth 2.0 Client ID credentials
  5. Add authorized redirect URI: http://localhost:3000/api/auth/callback/google
  6. Copy the Client ID and Client Secret
Cloudflare R2 Variables - Object Storage
  1. Sign up at Cloudflare
  2. Navigate to R2 Object Storage
  3. Create a new bucket and note the bucket name
  4. Go to Manage R2 API Tokens โ†’ Create API token
  5. Copy the following values:
    • Account ID
    • Access Key ID
    • Secret Access Key
    • Bucket endpoint URL
  6. Region is typically auto
RESEND_API_KEY - Email Service
  1. Sign up at Resend
  2. Navigate to API Keys
  3. Create a new API key
  4. Copy the key value

4. Database Setup

Run Prisma migrations to set up your database:

npx prisma generate

5. Run the Application

npm run dev

Visit http://localhost:3000 and start sharing thoughts! ๐ŸŽ‰

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the GNU Affero General Public License v3.0 (AGPL-3.0). See the LICENSE file for details.

Support

If you encounter any issues or have questions, please open an issue on GitHub.

About

A freedom wall where you can post your thoughts, ideas, and experience.

Topics

Resources

License

Stars

Watchers

Forks

Contributors 2

  •  
  •  

Languages