{"id":23644667,"url":"https://github.com/kartikmehta8/rust-node-auth-service","last_synced_at":"2026-05-06T19:03:37.079Z","repository":{"id":268798703,"uuid":"901780866","full_name":"kartikmehta8/rust-node-auth-service","owner":"kartikmehta8","description":"This project is a robust authentication service combining Rust and Node.js with MongoDB for secure user management, password hashing, JWT authentication, and protected routes via Neon bindings and Express.js.","archived":false,"fork":false,"pushed_at":"2024-12-11T09:55:43.000Z","size":30,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-03T16:14:30.088Z","etag":null,"topics":["authentication","expressjs","neon-bindings","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kartikmehta8.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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-12-11T09:55:01.000Z","updated_at":"2024-12-11T09:56:37.000Z","dependencies_parsed_at":"2024-12-19T02:08:43.409Z","dependency_job_id":"58faa583-b2b4-42df-866f-8617c02fdb5a","html_url":"https://github.com/kartikmehta8/rust-node-auth-service","commit_stats":null,"previous_names":["kartikmehta8/rust-node-auth-service"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/kartikmehta8/rust-node-auth-service","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kartikmehta8%2Frust-node-auth-service","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kartikmehta8%2Frust-node-auth-service/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kartikmehta8%2Frust-node-auth-service/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kartikmehta8%2Frust-node-auth-service/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kartikmehta8","download_url":"https://codeload.github.com/kartikmehta8/rust-node-auth-service/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kartikmehta8%2Frust-node-auth-service/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264343786,"owners_count":23593790,"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":["authentication","expressjs","neon-bindings","rust"],"created_at":"2024-12-28T12:33:00.337Z","updated_at":"2026-05-06T19:03:37.018Z","avatar_url":"https://github.com/kartikmehta8.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Rust-Node Authentication Service\n\n## Overview\nThis project is a robust authentication service that integrates a **Rust backend** (compiled as a Node.js native module using Neon bindings) with an **Express.js server**. It uses **MongoDB** for storing user information and **JWT tokens** for secure authentication.\n\n### Key Features\n- User Registration with password hashing (using `bcrypt`).\n- Secure Login with JWT generation.\n- Protected routes using JWT verification middleware.\n- MongoDB integration for persistent user data storage.\n\n## Endpoints\n\n### 1. **User Registration**\n- **URL**: `/signup`\n- **Method**: `POST`\n- **Request Body**:\n  ```json\n  {\n    \"name\": \"John Doe\",\n    \"email\": \"john.doe@example.com\",\n    \"username\": \"johndoe\",\n    \"password\": \"securepassword\"\n  }\n  ```\n- **Response**:\n  - **Success** (201):\n    ```json\n    {\n      \"message\": \"User registered successfully.\"\n    }\n    ```\n  - **Failure** (400 or 422):\n    ```json\n    {\n      \"error\": \"Validation failed: \u003cdetails\u003e.\"\n    }\n    ```\n\n### 2. **User Login**\n- **URL**: `/login`\n- **Method**: `POST`\n- **Request Body**:\n  ```json\n  {\n    \"username\": \"johndoe\",\n    \"password\": \"securepassword\"\n  }\n  ```\n- **Response**:\n  - **Success** (200):\n    ```json\n    {\n      \"token\": \"\u003cjwt-token\u003e\"\n    }\n    ```\n  - **Failure** (401):\n    ```json\n    {\n      \"error\": \"Invalid username or password.\"\n    }\n    ```\n\n### 3. **Protected Route**\n- **URL**: `/protected`\n- **Method**: `GET`\n- **Headers**:\n  ```json\n  {\n    \"Authorization\": \"Bearer \u003cjwt-token\u003e\"\n  }\n  ```\n- **Response**:\n  - **Success** (200):\n    ```json\n    {\n      \"message\": \"Access granted.\"\n    }\n    ```\n  - **Failure** (401):\n    ```json\n    {\n      \"error\": \"Unauthorized.\"\n    }\n    ```\n\n## Environment Variables\n| Variable       | Description                           | Default Value             |\n|----------------|---------------------------------------|---------------------------|\n| `MONGO_URI`    | MongoDB connection string            | `mongodb://localhost:27017`|\n| `DATABASE_NAME`| Database name for the project        | `auth_service`            |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkartikmehta8%2Frust-node-auth-service","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkartikmehta8%2Frust-node-auth-service","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkartikmehta8%2Frust-node-auth-service/lists"}