Skip to content

added the authentication#4

Open
jaydxxp wants to merge 3 commits intoGDGC-MET:mainfrom
jaydxxp:add_backend
Open

added the authentication#4
jaydxxp wants to merge 3 commits intoGDGC-MET:mainfrom
jaydxxp:add_backend

Conversation

@jaydxxp
Copy link
Copy Markdown

@jaydxxp jaydxxp commented Oct 9, 2025

Summary

Added backend authentication system with JWT and connected MongoDB database.
Created .env file support for sensitive configurations.

Changes

  • Implemented JWT authentication for secure user sessions.
  • Added authentication routes:
    • POST /api/auth/signup — Register user (name, username, email, password)
    • POST /api/auth/signin — Login user (email, password)
  • Connected backend to MongoDB.
  • Added environment variable support for DB connection and JWT secret.
  • Created a sample .env.example file for reference.
  • Added validation and error handling for auth routes.

.env.example

DB_URL_MONGO=mongodb+srv://<your-mongodb-url>
JWT_SECRET=your_jwt_secret_key
PORT=5173

@jaydxxp
Copy link
Copy Markdown
Author

jaydxxp commented Oct 9, 2025

Summary

Added backend authentication system with JWT and connected MongoDB database. Created .env file support for sensitive configurations.

Changes

  • Implemented JWT authentication for secure user sessions.

  • Added authentication routes:

    • POST /api/auth/signup — Register user (name, username, email, password)
    • POST /api/auth/signin — Login user (email, password)
  • Connected backend to MongoDB.

  • Added environment variable support for DB connection and JWT secret.

  • Created a sample .env.example file for reference.

  • Added validation and error handling for auth routes.

.env.example

DB_URL_MONGO=mongodb+srv://<your-mongodb-url>
JWT_SECRET=your_jwt_secret_key
PORT=5173

Additonally

GOOGLE_CLIENT_ID
GOOGLE_CLIENT_SECRET
FRONTEND_URL=

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant