This project is a Linktree/Bento.me-like platform built using Node.js, Express.js, and PostgreSQL, featuring a referral system.
- User Authentication (Register, Login, Forgot Password, Reset Password)
- Token-based Authentication (JWT)
- Referral System (Track referred users and rewards)
- Secure Password Reset via Email (Nodemailer + SMTP)
- Middleware for Authentication and Error Handling
- Backend: Node.js, Express.js
- Database: PostgreSQL + Prisma ORM
- Authentication: JWT + Bcrypt.js
- Email Service: Nodemailer + SMTP
- API Testing: Postman or Thunder Client Extension
linktree-backend/
│-- src/
│ ├── controllers/ # Business logic
│ ├── models/ # Database interactions
│ ├── routes/ # API routes
│ ├── middleware/ # Auth & error handlers
│ ├── utils/ # Helper functions
│ ├── server.js # Entry point
│-- prisma/ # Prisma schema & migrations
│-- .env # Environment variables
│-- package.json # Dependencies
- Clone the Repository
git clone https://github.com/vedu111/vomychat.git cd linktree-backend - Install Dependencies
npm install
- Setup Environment Variables (
.envfile)DATABASE_URL=postgresql://user:password@localhost:5432/linktree_db JWT_SECRET=your_secret_key SMTP_HOST=smtp.gmail.com SMTP_PORT=587 SMTP_USER=your_email@gmail.com SMTP_PASS=your_email_password
- Run Database Migrations
npx prisma migrate dev --name init
- Start the Server
npm start
| Method | Endpoint | Description | Auth Required |
|---|---|---|---|
| POST | /api/register |
Register new user | ❌ No |
| POST | /api/login |
User login (JWT) | ❌ No |
| POST | /api/forgot-password |
Send reset password email | ❌ No |
| POST | /api/reset-password |
Reset password with token | ❌ No |
| Method | Endpoint | Description | Auth Required |
|---|---|---|---|
| GET | /api/referrals |
Get user referral list | ✅ Yes |
| GET | /api/referral-stats |
Retrieve referral statistics | ✅ Yes |
- Open Postman and import API collection.
- Register/Login to get JWT token.
- Add
Authorization: Bearer <token>in headers. - Test endpoints with required parameters.
📧 Vedant Dagadkhair
📍 GitHub: vedu111
📍 Email: dagadkhairvedant@gmail.com
