Thriftify is an online marketplace platform for buying and selling second-hand items, promoting sustainability through reuse and reducing waste.
- User Authentication: Secure registration and login system with JWT
- Product Listings: Create, view, update, and delete listings with image uploads
- Categories: Browse items by categories (electronics, furniture, clothing, books, others)
- Search & Filters: Find items by location, category, price, etc.
- Bookmarks: Save favorite items for later
- Messaging: Real-time chat between buyers and sellers
- Payment Integration: Secure checkout with PayPal
- Order Management: Track purchases and sales
- User Profiles: Customizable user profiles with profile pictures
- Node.js
- Express.js
- MongoDB (Mongoose)
- JWT for authentication
- Cloudinary for image storage
- PayPal API for payment integration
- Swagger for API documentation
- EJS templates
- JavaScript
- CSS
- Responsive design components
- Node.js (v14+)
- MongoDB
- npm or yarn
- Clone the repository
git clone https://github.com/yourusername/thriftify.git
cd thriftify
- Install dependencies
npm install
- Create a
.env
file in the root directory with the following variables:
PORT=3000
MONGODB_URI=mongodb://localhost:27017/thriftify
ACCESS_TOKEN_SECRETE=your_jwt_secret_key
CLOUDINARY_CLOUD_NAME=your_cloudinary_name
CLOUDINARY_API_KEY=your_cloudinary_key
CLOUDINARY_API_SECRET=your_cloudinary_secret
PAYPAL_CLIENT_ID=your_paypal_client_id
PAYPAL_CLIENT_SECRET=your_paypal_client_secret
- Start the server
npm start
- For development with auto-reload:
npm run dev
- Visit
http://localhost:3000
in your browser
Thriftify provides comprehensive API documentation using Swagger UI.
When running the application locally, you can access the Swagger documentation at:
http://localhost:3000/api-docs
You can also access the Swagger documentation on the deployed version:
https://thriftify.onrender.com/api-docs
- POST /api/v1/user/register - Register a new user
- POST /api/v1/user/login - Login and receive authentication token
- GET /api/v1/user/profile - Get current user profile
- PUT /api/v1/user/profile - Update user profile
- GET /api/v1/listings - Get all listings with optional filters
- POST /api/v1/listings - Create a new listing
- GET /api/v1/listings/:id - Get specific listing details
- PUT /api/v1/listings/:id - Update a listing
- DELETE /api/v1/listings/:id - Delete a listing
- GET /api/v1/bookmarks - Get all bookmarks for current user
- POST /api/v1/bookmarks/:listingId - Add a listing to bookmarks
- DELETE /api/v1/bookmarks/:listingId - Remove a listing from bookmarks
- POST /api/v1/orders/create - Create a new order
- GET /api/v1/orders - Get all orders for current user
- GET /api/v1/orders/:id - Get specific order details
- GET /api/v1/category/:category - Get listings by category
- POST /api/v1/support/submit - Submit a support request
username
: String (unique)email
: String (unique)fullname
: Stringpassword
: String (hashed)profilepic
: StringcreatedAt
: DateupdatedAt
: Date
title
: Stringdescription
: Stringprice
: Numbercategory
: String (enum: electronics, furniture, clothing, books, others)location
: Stringimages
: [String]postedBy
: ObjectId (reference to User)status
: String (available, sold)createdAt
: DateupdatedAt
: Date
user
: ObjectId (reference to User)listing
: ObjectId (reference to Listing)createdAt
: Date
buyer
: ObjectId (reference to User)listing
: ObjectId (reference to Listing)seller
: ObjectId (reference to User)paymentId
: StringshippingInfo
: ObjectpaymentMethod
: Stringstatus
: String (pending, completed, cancelled)createdAt
: DateupdatedAt
: Date
thriftify/
βββ DataBase/
β βββ connect.js
βββ Routes/
β βββ bookmark.router.js
β βββ category.router.js
β βββ listing.router.js
β βββ orders.router.js
β βββ user.router.js
βββ Schemas/
β βββ bookmark.schemas.js
β βββ category.schemas.js
β βββ listings.schemas.js
β βββ order.schemas.js
β βββ user.schemas.js
βββ utils/
β βββ asynchandler.js
βββ views/
β βββ chat.ejs
β βββ home.ejs
β βββ index.ejs
β βββ payment-cancel.ejs
β βββ payment-success.ejs
βββ public/
β βββ css/
β βββ js/
β βββ images/
βββ app.js
βββ swagger.js
βββ .env.example
βββ package.json
βββ README.md
Thriftify is deployed on Render:
- Production URL: https://thriftify.onrender.com
- Create a new Web Service on Render
- Connect your GitHub repository
- Add environment variables in the Render dashboard
- Set the build command to
npm install
- Set the start command to
npm start
Thriftify uses JSON Web Tokens (JWT) for authentication:
- Tokens are stored in HTTP-only cookies for security
- Protected routes require valid authentication
- User sessions expire after a configured period
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
Project Link: https://github.com/viraj-gavade/thriftify
- πΈ Instagram: @_viraj.js
- π¦ Twitter: @viraj_gavade
- πΌ LinkedIn: Viraj Gavade
Here are some screenshots of the Thriftify application: