{"id":29556802,"url":"https://github.com/kybaloo/va-hire-backend","last_synced_at":"2026-05-04T15:34:52.966Z","repository":{"id":302416221,"uuid":"923850929","full_name":"kybaloo/va-hire-backend","owner":"kybaloo","description":"Powering the Va-Hire platform — a robust Node.js \u0026 Express API for managing user authentication, project listings, professional profiles, job matching, and secure transactions.","archived":false,"fork":false,"pushed_at":"2025-07-07T14:36:06.000Z","size":6502,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-28T22:46:24.405Z","etag":null,"topics":["auth0","cloudinary","morgan","multer","nodejs","socket-io","stripe"],"latest_commit_sha":null,"homepage":"https://va-hire-backend.onrender.com/docs/","language":"JavaScript","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/kybaloo.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-01-28T23:41:56.000Z","updated_at":"2025-07-02T17:12:39.000Z","dependencies_parsed_at":"2025-10-17T21:35:39.933Z","dependency_job_id":null,"html_url":"https://github.com/kybaloo/va-hire-backend","commit_stats":null,"previous_names":["kybaloo/va-hire-backend"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/kybaloo/va-hire-backend","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kybaloo%2Fva-hire-backend","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kybaloo%2Fva-hire-backend/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kybaloo%2Fva-hire-backend/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kybaloo%2Fva-hire-backend/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kybaloo","download_url":"https://codeload.github.com/kybaloo/va-hire-backend/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kybaloo%2Fva-hire-backend/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32613545,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-04T10:08:07.713Z","status":"ssl_error","status_checked_at":"2026-05-04T10:08:02.005Z","response_time":58,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["auth0","cloudinary","morgan","multer","nodejs","socket-io","stripe"],"created_at":"2025-07-18T11:00:37.577Z","updated_at":"2026-05-04T15:34:52.935Z","avatar_url":"https://github.com/kybaloo.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# VaHire - Backend API\n\nWelcome to the **VaHire** backend, the engine behind our platform that connects IT professionals with businesses. This backend manages user authentication, profiles, project management, secure payments, and more.\n\n## 🔧 Tech Stack\n\n- **Node.js** / **Express.js**: Backend framework\n- **MongoDB** + **Mongoose**: NoSQL database\n- **Auth0**: Authentication and user management\n- **JWT**: Secures protected routes\n- **Stripe**: Secure payments\n- **Cloudinary**: File storage (resumes, images, etc.)\n- **Socket.IO**: Real-time messaging\n- **Express Rate Limit**: API rate limiting\n- **Morgan**: Request logging\n- **Multer**: File upload handling\n- **Swagger/OpenAPI**: API documentation\n- **ReDoc**: Interactive API documentation UI\n\n---\n\n## ⚙️ Installation and Setup\n\n### 1. Clone the repository\n\n```bash\ngit clone https://github.com/your-user/vahire-backend.git\ncd vahire-backend\n```\n\n### 2. Install dependencies\n\n```bash\nnpm install\n```\n\n### 3. Configure environment variables\n\nCreate a `.env` file based on `.env.example`:\n\n```bash\ncp .env.example .env\n```\n\n### 4. Start the server\n\n```bash\nnpm run dev\n```\n\nBackend runs on: `http://localhost:5000`\n\n---\n\n## 📖 API Documentation\n\nThe VaHire API is fully documented using OpenAPI/Swagger. Two interactive documentation UIs are available:\n\n### Swagger UI\n- **URL**: `/api-docs`\n- **Features**:\n  - Interactive API explorer\n  - Try out endpoints directly from the browser\n  - Complete schema reference\n\n### ReDoc\n- **URL**: `/docs`\n- **Features**: \n  - Clean, user-friendly interface\n  - Version history and release notes\n  - Downloadable OpenAPI specification\n  - Improved navigation\n\n### OpenAPI Specification\n- **URL**: `/swagger.json`\n- Raw OpenAPI/Swagger JSON specification\n- Can be imported into tools like Postman\n\n## 🔢 Versioning System\n\nVaHire uses semantic versioning (X.Y.Z) for the API:\n\n- **X**: Major version (breaking changes)\n- **Y**: Minor version (backward-compatible features)\n- **Z**: Patch version (bug fixes)\n\n### Version Management\n\nAll version information is centralized in `config/version.js`. To update the version:\n\n#### Option 1: Using the script\n\n```bash\nnpm run update-version 1.0.3 \"Fixed a bug in authentication\" \"Improved validation\"\n```\n\n#### Option 2: Manually edit\n\nModify the `config/version.js` file directly.\n\n## 🔐 Authentication\n\nThe API uses **Auth0** for authentication. JWT tokens must be sent in the header:\n\n```\nAuthorization: Bearer \u003ctoken\u003e\n```\n\n### User Roles\n\n- **user**: Regular user\n- **professional**: IT professional/freelancer\n- **recruiter**: Project owner/recruiter\n- **admin**: System administrator\n\n## 🔑 Social Login with Auth0\n\nVaHire supports social login via Auth0, allowing users to sign in with their:\n- Google accounts\n- LinkedIn profiles\n- GitHub accounts\n- And other identity providers supported by Auth0\n\n### Setting Up Social Login\n\n1. **Auth0 Configuration:**\n   - Create an [Auth0 account](https://auth0.com/) if you don't have one\n   - Create a new application in the Auth0 dashboard\n   - Configure the following settings:\n     - Allowed Callback URLs: `http://localhost:3000/callback` (development) and your production URL\n     - Allowed Web Origins: `http://localhost:3000` (development) and your production URL\n     - Allowed Logout URLs: `http://localhost:3000` (development) and your production URL\n\n2. **Enable Social Connections in Auth0:**\n   - Go to \"Authentication\" \u003e \"Social\" in your Auth0 dashboard\n   - Enable Google, LinkedIn, or other providers\n   - Configure each provider with the required credentials (Client ID, Client Secret)\n\n3. **Environment Configuration:**\n   - Update your `.env` file with the following Auth0 variables:\n   ```\n   AUTH0_DOMAIN=your-domain.auth0.com\n   AUTH0_CLIENT_ID=your-client-id\n   AUTH0_CLIENT_SECRET=your-client-secret\n   AUTH0_AUDIENCE=your-audience-uri\n   AUTH0_CALLBACK_URL=http://localhost:3000/callback\n   ```\n\n4. **Frontend Implementation:**\n   - Use the Auth0 SDK in your frontend application\n   - Implement the login button for each social provider\n   - After successful authentication, the user will be redirected to your callback URL\n   - The backend will handle creating/updating user accounts via the `/api/auth/auth0-callback` endpoint\n\n### Social Login Flow\n\n1. User clicks on \"Sign in with Google/LinkedIn\" on the frontend\n2. Auth0 handles the OAuth flow with the social provider\n3. Upon successful authentication, Auth0 redirects to your callback URL with an access token\n4. Your frontend exchanges this token for an Auth0 JWT token\n5. The backend endpoint `/api/auth/auth0-callback` processes the user data from Auth0\n6. A user account is created or updated in the database\n7. User is authenticated and can use the application\n\n---\n\n## 🧠 API Endpoints\n\n### Authentication\n| Method | URL                    | Description                    | Auth Required |\n|--------|------------------------|--------------------------------|---------------|\n| POST   | `/api/auth/login`      | Login with Auth0              | ❌            |\n| POST   | `/api/auth/register`   | Register new user             | ❌            |\n| GET    | `/api/auth/profile`    | Get user profile              | ✅            |\n| Method | URL                                | Description                              | Auth Required |\n|--------|-------------------------------------|------------------------------------------|---------------|\n| GET    | `/api/users`                       | List all users                           | ✅            |\n| POST   | `/api/users`                       | Create a user profile                    | ✅            |\n| GET    | `/api/projects`                    | List available projects                  | ❌            |\n| POST   | `/api/projects`                    | Create a project                         | ✅ (recruiter)|\n| POST   | `/api/payments/checkout`           | Create a payment session                 | ✅            |\n| POST   | `/api/upload`                      | Upload files (resume, profile image)     | ✅            |\n| POST   | `/api/reviews`                     | Submit a review                          | ✅            |\n| GET    | `/api/notifications`               | Get user notifications                   | ✅            |\n| GET    | `/api/conversations`               | Get user conversations                   | ✅            |\n| POST   | `/api/conversations/start`         | Start a new conversation                 | ✅            |\n| GET    | `/api/courses`                     | Get available courses                    | ❌            |\n| POST   | `/api/courses/:id/enroll`          | Enroll in a course                       | ✅            |\n\nFor a complete list of endpoints, refer to the API documentation at `/api-docs` or `/docs`.\n\n## 🚀 Deployment\n\nFor detailed deployment instructions, refer to the [DEPLOYMENT.md](DEPLOYMENT.md) guide. Some key options include:\n\n### Production-ready Hosting Options:\n\n- **Render**: Easy setup with auto-deploy from GitHub\n- **Railway**: Zero-config deployment with scaling options\n- **Heroku**: Classic PaaS with add-ons ecosystem\n- **AWS/DigitalOcean**: Full control via VPS\n- **Docker**: Containerized deployment anywhere\n\n### Quick Deployment Checklist:\n\n1. Configure environment variables\n2. Set up MongoDB production database\n3. Run tests and security audit\n4. Deploy to your preferred platform\n5. Set up monitoring and backups\n\n## 🧪 Testing\n\nTo run tests:\n\n```bash\nnpm test\n```\n\n## 🤝 Contributing\n\nContributions are welcome! Fork, branch, make changes and submit a **pull request**.\n\n## 📬 Contact\n\n- **Lead Developer**: TCHANGAI Kybaloo Florentin  \n- **Email**: tchangaiflorentin6@gmail.com\n\n---\n\n## 📄 License\n\nMIT © 2025 VaHire\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkybaloo%2Fva-hire-backend","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkybaloo%2Fva-hire-backend","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkybaloo%2Fva-hire-backend/lists"}