π LockedIn Backend LockedIn Logo
LockedIn Backend powers the core services of the LockedIn cross-platform application. Built using Node.js, it handles authentication, user data, job listings, media uploads, and payment processing, enabling a seamless and secure professional networking experience.
-
JWT-based Authentication: Secure, stateless user sessions
-
Firebase OAuth: Google sign-in via Firebase
-
Password Management: Encrypted reset and update
-
Role-based Access Control
-
Input Validation: Ensures secure and clean data
-
User CRUD: Create, retrieve, update, delete users
-
Experience & Education: Add professional milestones
-
Skills Management: Showcase technical abilities
-
Media Upload: Upload avatars, resumes via Cloudinary
-
Connection Requests: Request/accept/reject connections
-
Followers: Follow professionals without direct connections
-
Activity Feed: Track updates and posts
-
Job Management: Post, edit, and delete job listings
-
Application Submission: Apply to jobs directly
-
Application Tracking: View job status and history
-
Company Profiles: View details of employers
-
Real-time Notifications via Firebase Cloud Messaging
-
Custom Notification Channels
-
Activity-based Alerts
-
Stripe Integration: Payments and subscriptions
-
Checkout Sessions: Secure checkout for premium features
-
Webhook Events: Handle updates from Stripe in real-time
-
Node.js β JavaScript runtime
-
Express.js β Web framework
-
MongoDB + Mongoose β NoSQL database and schema modeling
-
Firebase Admin SDK β OAuth and messaging
-
Cloudinary β Media storage and transformations
-
Stripe API β Payment processing
-
JWT β Token-based authentication
-
dotenv β Environment configuration
-
Multer β File upload middleware
-
CORS β Cross-Origin Resource Sharing
-
Node.js (v18+ recommended)
-
MongoDB Atlas or local instance
-
Firebase Project
-
Stripe Account
-
Cloudinary Account
# Clone the repository git clone https://github.com/tahaaa22/ClinkedIn/Backend.git cd Backend
npm install π Environment Setup Create a .env file in the root directory:
# π§ reCAPTCHA
RECAPTCHA_SECRET_KEY=your-recaptcha-secret-key
# π MongoDB
MONGO_URI=mongodb+srv://<username>:<password>@cluster.mongodb.net/LockedIn
MONGODB_CONNECTION=mongodb+srv://<username>:<password>@cluster.mongodb.net/LockedIn
# π₯ Firebase Admin SDK
FIREBASE_TYPE=service_account
FIREBASE_PROJECT_ID=your-project-id
FIREBASE_PRIVATE_KEY_ID=your-private-key-id
FIREBASE_PRIVATE_KEY="-----BEGIN PRIVATE KEY-----\nYOUR-PRIVATE-KEY\n-----END PRIVATE KEY-----\n"
FIREBASE_CLIENT_EMAIL=your-client-email
FIREBASE_CLIENT_ID=your-client-id
FIREBASE_AUTH_URI=https://accounts.google.com/o/oauth2/auth
FIREBASE_TOKEN_URI=https://oauth2.googleapis.com/token
FIREBASE_AUTH_PROVIDER_CERT_URL=https://www.googleapis.com/oauth2/v1/certs
FIREBASE_CLIENT_CERT_URL=https://www.googleapis.com/robot/v1/metadata/x509/firebase-adminsdk@your-project-id.iam.gserviceaccount.com
FIREBASE_UNIVERSE_DOMAIN=googleapis.com
# π JWT Tokens
ACCESS_TOKEN_SECRET=your-access-token-secret
REFRESH_TOKEN_SECRET=your-refresh-token-secret
REFRESH_TOKEN_PATH=/refresh_token
# βοΈ Cloudinary
CLOUDINARY_CLOUD_NAME=your-cloud-name
CLOUDINARY_API_KEY=your-cloudinary-api-key
CLOUDINARY_API_SECRET=your-cloudinary-api-secret
# π App Base URL BASE_URL=http://localhost:3000
# π§ Email Service LOCKEDIN_EMAIL=your-email@example.com
EMAIL_PASSWORD=your-email-app-password
npm run devStart
The server will start on http://localhost:3000 (or your configured port).
LockedIn-Backend/ βββ controllers/ # Request handlers βββ models/ # Mongoose schemas βββ routes/ # API endpoints βββ middlewares/ # Auth, validation, error handling βββ utils/ # Helper functions βββ server.js # App entry point
-
Authentication β Register/login (email or Google OAuth)
-
Profile Setup β Users complete professional details
-
Networking β Follow or connect with other users
-
Job Exploration β Discover and apply to jobs
-
Payment & Upgrade β Purchase premium plans
-
Notifications β Get real-time updates via FCM
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/user/register |
Email/password registration |
| GET | /api/user/:id |
Get user profile |
| POST | /api/jobs/ |
Create a new job post |
| POST | /api/stripe/create-checkout-session |
Create Stripe checkout session |
π Full API documentation via Swagger on /api/docs.
npm run test
Use Jest for unit/integration testing.
Contributions are welcome! Feel free to fork the repo, create a new branch, and submit a Pull Request.
LockedIn Backend β Powering meaningful professional connections.
Built with β€οΈ using Node.js and open-source technologies.