LogoGalsenext
Guide et Tutoriel

Configuration

---

Configuration

After installing Galsenext, follow these steps to properly configure your development environment.

Configuration of the .env File

To ensure your application runs correctly, you need to create a .env file at the root of your project and define several environment variables. Here is an example of a basic configuration:

GOOGLE_CLIENT_ID=your-google-client-id
GOOGLE_CLIENT_SECRET=your-google-client-secret
NEXTAUTH_URL=http://localhost:3000
NEXTAUTH_SECRET=your-nextauth-secret
DATABASE_URL=your-database-url

GOOGLE_CLIENT_ID and GOOGLE_CLIENT_SECRET:

  • What it is: OAuth 2.0 credentials used for authentication via Google.
  • Purpose: Allows users to log in to your application using their Google account.
  • How to obtain: Create a project in Google Cloud Console, enable the "OAuth 2.0" API, and generate OAuth credentials.

NEXTAUTH_URL:

  • What it is: The URL of your application.
  • Purpose: Used by NextAuth to define the primary domain of the application. This URL is crucial for handling redirects after authentication.
  • How to set it: For local development, use http://localhost:3000. In production, use your site's URL, e.g., https://yoursite.com.

NEXTAUTH_SECRET:

  • What it is: A secret key used to sign and encrypt NextAuth session tokens.
  • Purpose: Ensures the security of sessions and authentication data for your application.
  • How to generate: Use the following command in your terminal to generate a secure key:
openssl rand -base64 32

DATABASE_URL:

  • What it is: The connection URL to your PostgreSQL database.
  • Purpose: Allows Prisma and your application to interact with the database.
  • How to configure:
    • Create a database on Neon.
    • Retrieve the connection URL (format postgres://user:password@hostname:port/database) and set it in your .env file.

On this page