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.
To get a local copy of the project up and running, follow these steps:
-
Clone the repository:
git clone https://github.com/discordplace/discord.place.git
-
Navigate to the project directory:
cd discord.place
To get a local copy of the project up and running, follow these steps:
-
Clone the repository:
git clone https://github.com/discordplace/discord.place.git
-
Navigate to the project directory:
cd discord.place
-
Install dependencies for the client and server:
cd client npm install cd ../server npm install
-
Configure Environment Variables:
-
Client:
- Create a
.env
file in theclient
directory and populate it with the following variables:
ANALYZE= NEXT_PUBLIC_CF_SITE_KEY=
- Create a
-
Server:
- Create a
.env
file in theserver
directory and populate it with the following variables:
# Secrets COOKIE_SECRET= SESSION_SECRET= SESSION_STORE_SECRET= GITHUB_AUTO_DEPLOY_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
- Create a
-
-
Start the development servers:
# In one terminal tab cd client npm run dev # In another terminal tab cd ../server npm run dev
-
Open your browser and visit http://localhost:3000 to view the website.
We welcome contributions from the community! If you'd like to contribute to the project, please follow these guidelines:
- Fork the repository and clone it locally.
- Create a new branch for your feature or bug fix.
- Make your changes and ensure the code passes any existing tests.
- Commit your changes with descriptive commit messages.
- 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.
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 |
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 |
ANALYZE | Whether to enable bundle analysis during client build | No | true/false |
NEXT_PUBLIC_CF_SITE_KEY | Public key for Cloudflare integration | No | SiteKey |
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!
This project is licensed under the ISC License.