A Flask web application designed to host the e-novel "Cosmeta: Incarnate" with features like Discord authentication, role-based access, and chapter management.
This application requires several environment variables to function properly. A .env.example file has been included in the repository to show what variables are needed.
SESSION_SECRET: A secret key for the Flask applicationDATABASE_URL: Full connection stringPGHOST: Database hostnamePGDATABASE: Database namePGUSER: Database usernamePGPASSWORD: Database passwordPGPORT: Database porthttps://your-app-url.replit.app/callbackidentify and guildsThen set these variables:
DISCORD_CLIENT_ID: Your Discord application's client IDDISCORD_CLIENT_SECRET: Your Discord application's client secretDISCORD_BOT_TOKEN: Your Discord bot token (for role synchronization)DISCORD_REDIRECT_URI: Callback URL (usually https://your-app-url.replit.app/callback)DISCORD_GUILD_ID: ID of your Discord server for role synchronizationDISQUS_SHORTNAME: If you want to enable Disqus commentsUPLOAD_FOLDER: Path for file uploads (default: static/uploads)MAX_CONTENT_LENGTH: Maximum upload size in bytes (default: 16MB).env.example to a new file called .secrets.toml in Replit or set environment variables in your hosting environmentThe application uses Gunicorn as the WSGI server and can be started with:
gunicorn --bind 0.0.0.0:5000 --reuse-port --reload main:app
The application has four roles with different permissions:
Roles can be synchronized from Discord server roles or manually assigned in the application.