-
Install node16 and npm 8
-
Clone this repo
git clone https://github.com/DenseOriginal/AG-Lan.git
-
Open terminal/cmd and cd into cloned directory
cd AG-lan
-
Install dependincies use
npm install
-
Copy the file
.envbase
and rename the copied file to.env
cp .envbase .env
-
Fill out configuration in the newly created
.env
file You have to create an application onhttps://discord.com/developers/applications
and get OAuth secret The callback url should be< protocol >://< domain >/api/callback
e.g.http://localhost:3000/api/callback
This also need to match a callback url set on the disord developer dashboard SESSION_SECRET is just a random string And MONGO_URI can be from a self hosted mongodDB or an atlas cluster -
Verify that
/src/discord/environment.ts
uses the correct channel and role ids
-
Building the app To build the application run
npm run build
, this will create a dist/ folder with the transpiled js -
To serve the app Use
npm run serve
to serve the app on port3000
or whatever port is set in the process.ENV -
To build and serve Use
npm run build:serve
to build then serve, this command simply issues the other to commands
.
├───.adminbro # Folder for adminbro stuff
├───dist # Compiled output, ignored in git
├───public # Static resources
│ ├───favicon
│ ├───images
│ │ └───logo
│ ├───scripts
│ └───styles
│ └───themes
├───src # Folder container the actual code
│ ├───config # Different files to configure libraries
│ ├───discord # Folder for the discord bot
│ │ ├───functions # Discord helper functions
│ │ └───listeners # Listeners for discord
│ ├───models # Mongoose models
│ └───routes # Folder container routing handlers
│ ├───api # /api
│ ├───lan # /lan
│ ├───profile # /profile
│ ├───staff # Config for adminbro
│ └───tournaments # /tournaments
└───views # Handlebar templates
├───admin-bro # Folder containing jsx for adminbro
├───lan # Lan templates
├───layouts # Page layouts
├───partials # Partials that can be reused
├───profile # Profile templates
└───tournament # Tournament templates
- Your firewall doesn't allow acces to mongoDB Then configure you firewall to allow you to use mongoDB