Auth In is a production-ready authentication boilerplate designed to simplify secure user management.
It features JWT-based authentication system + Google OAuth authentication, protected routes, welcome + reset password emails, and a responsive, clean UI.
- Frontend: React, Vite, Tailwind CSS, Context API, React Router Dom, Axios
- Backend: Node.js, Express.js, MongoDB, Mongoose, Cors, Nodemailer & Brevo
- Authentication: JWT, bcrypt, cookie-parser
- Development Tools: Nodemon, Dotenv, express-async-handler
- Clone the repository
git clone https://github.com/baraa-elhajj/auth-in.git- Open two different terminals for each of the
backendandfrontendprojects and install dependencies:
npm installor install both projects' dependencies in a single root terminal:
npm run install:all- Set up environment variables
Create a.envfile for:
# Backend
PORT = 4000
FRONTEND_URL = "http://localhost:5173"
MONGODB_CONNECTION_STRING = your_mongodb_connection_string
JWT_SECRET = your_jwt_secret
NODE_ENV = "development"
SMTP_BREVO_USER = your_brevo_user
SMTP_BREVO_SECRET = your_brevo_secret
SMTP_BREVO_EMAIL = your_brevo_email
GOOGLE_CLIENT_ID = your_google_client_id
GOOGLE_CLIENT_SECRET = your_google_client_secret# Frontend
VITE_API_URL = "http://localhost:4000/api"
VITE_GOOGLE_CLIENT_ID = your_google_client_id- Run
# Backend
npm run server# Frontend
npm run devor run both concurrently in the root terminal:
# root
npm run devLove this project? Drop a star ⭐ and feel free to fork it or suggest improvements if you find something cool!
