This guide will show you how to setup 2PG, and the Dashboard for local development.
The Bot project is used for managing data for the bot, and contains the API, which by default serves the built dashboard files on
http://localhost:3000. It is used as a foundation for the Website project.
The Dashboard project is used for customizing the actual website and dashboard. It uses Angular, which is a front-end framework that makes navigation seem fast and responsive.
The Bot project requires cloning, which basically downloads the project from GitHub. This can be done with the Git CLI.
git clone https://github.com/twopg/bot.gitcd bot
Node modules need to be installed, specified in package.json, and package-lock.json. Make sure the terminal is at the root director of the project. All you need to do is type a simple command and it will all be done for you.
.envfile in the root project directory. This file is used to securely store private data. See the link below for the up to date template for the
.env file. **
See the link below for a
.env file template. It contains an explanation to what each environment file does, and why they are used.
If everything is setup correctly, you can start the project with this command.
By default the API runs on port 3000. You can confirm it is online by connecting to
http://localhost:3000, in your browser URL bar.
After the Bot is setup, the website follows a very similar setup, but with a different project URL.
git clone https://github.com/twopg/dashboard.gitcd dashboardnpm inpm start
The Server Members Intent needs to be enabled for 2PG to perform many functions including: reaction roles, guild member events, and more.
One last thing... Redirect URIs are used for allowing Discord OAuth2 to function correctly. These can also be found in the Discord Developer Portal.