- 1. Overview
- 2. Features
- 3. Prerequisites
- 4. Getting Started
- 5. Deployment
- 6. Deployment
- 7. Troubleshooting
- 8. Contributing
- 9. License
Monad Discord Auth is a Next.js application that integrates Discord authentication using NextAuth.js, allowing users to log in with their Discord credentials. This application also fetches guild membership and roles from the Monad Discord server, enabling more personalized user experiences.
- Discord OAuth2 Integration: Provides a seamless login experience using Discord credentials.
- User Data Retrieval: Fetches user guild membership and roles from the Monad Discord server.
- Environment-Based Configuration: Allows secure and flexible deployment across various environments.
Ensure that your system meets the following requirements:
-
Node.js: Ensure you have Node.js installed (version 14 or later is recommended). You can download and install Node.js from the official website here.
-
pnpm is a package manager that can be installed in various ways. To explore the different installation methods and choose the one that best suits your system and needs, visit the official pnpm installation page: pnpm Installation.
-
PostgreSQL: Version 13 or later, for database management. You can follow the instructions to set up a local PostgreSQL.
Clone the repository to your local machine:
git clone https://github.com/monad-devrel/monad-discord-auth.git
cd monad-discord-auth
Install the project dependencies using pnpm
:
pnpm install
Create a .env
file based on the .env.example
provided in the repository. Replace the placeholders with your actual credentials:
AUTH_SECRET=your_auth_secret_here
NEXTAUTH_URL=http://localhost:3000
DISCORD_ID=your_discord_id_here
DISCORD_SECRET=your_discord_secret_here
MONAD_GUILD_ID=your_monad_guild_id_here
DATABASE_URL=postgresql://<username>:<password>@<host>:<port>/<database>
Start the development server:
pnpm dev
Open your browser and navigate to http://localhost:3000 to view the application.
Here is a list of available scripts in the project along with their purposes:
pnpm dev # Starts the development server for local development and testing.
pnpm build # Compiles the application into an optimized production build.
pnpm start # Runs the application in production mode using the compiled files.
pnpm prisma migrate dev # Applies database migrations to keep the schema in sync with your Prisma schema.
pnpm prisma generate # Regenerates the Prisma Client based on the updated schema.
pnpm lint # Checks for code style and syntax issues.
Deploy your Next.js application using Vercel, which provides a seamless deployment experience for Next.js projects.
- Push your code to a GitHub repository.
- Sign in to Vercel and import your project.
- Vercel will automatically detect the Next.js framework and deploy your application.
- After deployment, make sure to configure your environment variables in the Vercel dashboard.
For more information, refer to the Vercel documentation.
If you encounter a "command not found" error for pnpm
, make sure that you have installed it globally using npm:
npm install -g pnpm
To explore other installation methods and choose the one that best suits your system and needs, visit the official pnpm installation page: pnpm Installation.
Ensure that your .env
file is correctly set up and placed in the root directory of the project.
If you encounter errors during the installation of dependencies, try deleting node_modules
and the lock file, then reinstall:
rm -rf node_modules pnpm-lock.yaml
pnpm install
Contributions are welcome! Please follow these steps to contribute:
- Fork the repository on GitHub.
- Create a new branch from
main
for your feature or bugfix. - Make your changes and commit them with a clear and descriptive commit message.
- Push your changes to your fork and create a pull request to the main repository.
For detailed guidelines, refer to the CONTRIBUTING.md file.
This project is licensed under the MIT License. See the LICENSE file for details.