{"id":22771414,"url":"https://github.com/ramxcodes/authx","last_synced_at":"2025-03-30T12:14:16.223Z","repository":{"id":258756801,"uuid":"873963012","full_name":"ramxcodes/AuthX","owner":"ramxcodes","description":"AuthX is a simple authentication boilerplate Created in MERN Stack, featuring JWT-based auth, email verification, and password reset. Perfect for quick setups.","archived":false,"fork":false,"pushed_at":"2024-10-20T15:14:30.000Z","size":806,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-05T13:51:17.327Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://auth-x.vercel.app","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ramxcodes.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-10-17T02:45:46.000Z","updated_at":"2024-10-20T15:20:45.000Z","dependencies_parsed_at":"2024-10-21T23:28:19.863Z","dependency_job_id":null,"html_url":"https://github.com/ramxcodes/AuthX","commit_stats":null,"previous_names":["ramxcodes/authx"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ramxcodes%2FAuthX","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ramxcodes%2FAuthX/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ramxcodes%2FAuthX/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ramxcodes%2FAuthX/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ramxcodes","download_url":"https://codeload.github.com/ramxcodes/AuthX/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246314149,"owners_count":20757463,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-11T16:13:35.673Z","updated_at":"2025-03-30T12:14:16.218Z","avatar_url":"https://github.com/ramxcodes.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AuthX: Ultimate Authentication System\n\nAuthX is a simple and flexible system for handling user logins and signups. It comes with the basic features you need, like creating accounts, logging in, verifying emails, resetting passwords, and giving users access to certain areas using JWT. \n\nIt’s a great starting point if you need to set up full authentication for your app. The frontend is made with **React**, the backend runs on **Express**, and **MongoDB** is used as the database. You can easily change or add features to fit your project.\n\n## Tech Stack\n\n[![AuthX](https://skillicons.dev/icons?i=react,express,nodejs,mongodb,js,vercel,postman,md,npm,git,github,vscode\u0026perline=6)](https://github.com/ramxcodes)\n\n**Frontend**: \n- React for the user interface and state management.\n\n**Backend**: \n- Express for handling server-side logic and API routes.\n- MongoDB for database storage and Mongoose for data modeling.\n- Mailtrap for email services (email verification, password reset).\n\n**Security**:\n- JWT for authentication and secure token management.\n- Bcrypt for password hashing.\n\n**Other Tools**:\n- Dotenv for managing environment variables.\n- Cookie-parser for handling cookies in requests.\n\n## Features\n\n- **User Registration**: Users can sign up with email and password.\n- **User Login**: Secure login functionality with hashed passwords and JWT.\n- **Email Verification**: Users receive a verification email to verify their account.\n- **Password Reset**: Allows users to reset their password via email link.\n- **Token-based Authentication**: Protects routes with JWT token verification.\n- **User Logout**: Handles secure token invalidation.\n- **Authentication Middleware**: Ensures protected routes are only accessible to authenticated users.\n\n## Getting Started\n\n### Prerequisites\n\n- Node.js installed on your system.\n- MongoDB instance (local or cloud, such as MongoDB Atlas).\n- Mailtrap account for email services.\n\n### Installation\n\n1. Clone the repository:\n   ```bash\n   git clone https://github.com/ramxcodes/AuthX.git\n   ```\n   \n2. Navigate into the project directory:\n   ```bash\n   cd AuthX\n   ```\n\n3. Install server dependencies:\n   ```bash\n   npm install\n   ```\n\n4. Install front end dependencies:\n   ```bash\n   cd frontend\n   npm install\n   cd ..\n   ```\n\n5. Create a `.env` file in the root directory and add the following environment variables:\n   ```bash\n    MONGO_URI = MONGO_URL\n    PORT = 5000/3000\n    JWT_SECRET= YOUR_SECRET\n    NODE_ENV= DEVELOPMENT/PRODUCTION\n    MAILTRAP_TOKEN= YOUR_MAILTRAP_TOKEN\n    CLIENT_URL= YOUR_LOCAL/ONLINE_URL (http://localhost:5173)\n   ```\n\n### Running the Application\n\n1. Start the backend server:\n   ```bash\n   npm start\n   ```\n\n2. Start the React frontend:\n   ```bash\n   cd client\n   npm start\n   ```\n\n3. Visit your app at `http://localhost:5173` (for frontend) and the API is accessible at `http://localhost:5000/api`.\n\n## API Endpoints\n\n- **POST /api/auth/signup**: Register a new user.\n- **POST /api/auth/login**: Login an existing user.\n- **POST /api/auth/logout**: Logout the current user.\n- **POST /api/auth/verify-email**: Verify user's email using a token.\n- **POST /api/auth/forgot-password**: Request a password reset email.\n- **POST /api/auth/reset-password/:token**: Reset password using the reset token.\n- **GET /api/auth/check-auth**: Check user authentication status (requires token).\n\n## License\n\nThis project is licensed under the MIT License.\n\n---\n\n## Creator\n\n- **Name**: Ramkrishna Swarnkar\n- **GitHub**: [@ramxcodes](https://github.com/ramxcodes)\n- **LinkedIn**: [@ramxcodes](https://www.linkedin.com/in/ramxcodes)\n- **Twitter**: [@ramxcodes](https://twitter.com/ramxcodes)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Framxcodes%2Fauthx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Framxcodes%2Fauthx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Framxcodes%2Fauthx/lists"}