/discord.place

Repository containing client and server files of discord.place website.

Primary LanguageJavaScriptISC LicenseISC

discord.place

This repository contains the source code for the discord.place website. The project is divided into two main components: the Next.js client application located in the /client folder and the Express server located in the /server folder.

Getting Started

To get a local copy of the project up and running, follow these steps:

  1. Clone the repository:

    git clone https://github.com/discordplace/discord.place.git
  2. Navigate to the project directory:

    cd discord.place
  3. Install dependencies for the client and server:

    cd client
    npm install
    cd ../server
    npm install
  4. Configure Environment Variables:

    • Client:

      • Create a .env file in the client directory and populate it with the following variables:
      ANALYZE=
      NEXT_PUBLIC_CF_SITE_KEY=
      
    • Server:

      • Create a .env file in the server directory and populate it with the following variables:
      # Secrets
      COOKIE_SECRET=
      SESSION_SECRET=
      SESSION_STORE_SECRET=
      GITHUB_AUTO_DEPLOY_SECRET=
      BOT_API_KEY_SECRET=
      
      # Discord Bot
      DISCORD_CLIENT_TOKEN=
      DISCORD_CLIENT_SECRET=
      DISCORD_CLIENT_ID=
      
      # Database
      MONGO_URL=
      
      # Cloudflare R2
      S3_BUCKET_NAME=
      S3_ACCESS_KEY_ID=
      S3_SECRET_ACCESS_KEY=
      S3_REGION=
      S3_ENDPOINT=
      
      # Cloudflare Turnstile
      CLOUDFLARE_TURNSTILE_SECRET_KEY=
      

      Ensure you fill in the values for each environment variable according to your setup. Take a look to Secrets Configuration for more information about .env

  5. Start the development servers:

    # In one terminal tab
    cd client
    npm run dev
    
    # In another terminal tab
    cd server
    npm run dev
  6. Open your browser and visit http://localhost:3000 to view the website.

Contributing

We welcome contributions from the community! If you'd like to contribute to the project, please follow these guidelines:

  1. Fork the repository and clone it locally.
  2. Create a new branch for your feature or bug fix.
  3. Make your changes and ensure the code passes any existing tests.
  4. Commit your changes with descriptive commit messages.
  5. Push your changes to your fork and submit a pull request to the main branch of the original repository.

Please make sure to follow the Code of Conduct and Contributing Guidelines when contributing to this project.

Secrets Configuration

Before running the project, you need to set up the following environment variables in the .env files for both the client and server. Here's a breakdown of each secret:

Secret Description Required Example Value
COOKIE_SECRET Secret used for cookie encryption Yes RandomString
SESSION_SECRET Secret used for session encryption Yes RandomString
SESSION_STORE_SECRET Secret used for session store encryption Yes RandomString
GITHUB_AUTO_DEPLOY_SECRET Secret for GitHub auto-deployment webhook verification No RandomString
BOT_API_KEY_ENCRYPT_SECRET Secret for discord.place API key encryption Yes RandomString
DISCORD_CLIENT_TOKEN Token for Discord bot integration Yes DiscordToken
DISCORD_CLIENT_SECRET Secret for Discord bot integration Yes DiscordSecret
DISCORD_CLIENT_ID Client ID for Discord bot integration Yes DiscordClientID
MONGO_URL URL for MongoDB database connection Yes mongodb://localhost:27017/mydatabase
S3_BUCKET_NAME Name of the AWS S3 bucket for Cloudflare R2 Yes BucketName
S3_ACCESS_KEY_ID AWS access key ID for Cloudflare R2 Yes AccessKeyID
S3_SECRET_ACCESS_KEY AWS secret access key for Cloudflare R2 Yes SecretAccessKey
S3_REGION AWS region for Cloudflare R2 Yes Region
S3_ENDPOINT AWS S3 endpoint for Cloudflare R2 Yes Endpoint
CLOUDFLARE_TURNSTILE_SECRET_KEY Secret key for Cloudflare Turnstile integration Yes RandomString
DISCORD_PLACE_API_KEY API key for Discord Place API Yes RandomString
ANALYZE Whether to enable bundle analysis during client build No true/false
NEXT_PUBLIC_CF_SITE_KEY Public key for Cloudflare integration No SiteKey

Help

If you encounter any issues with the discord.place website or have any questions, feel free to open an issue on this repository. We'll do our best to assist you!

License

This project is licensed under the ISC License.