A modern web application for barter trading built with Node.js, Express, and MongoDB.
- Docker installed on your system
- Git (to clone the repository)
- Clone the repository:
git clone git@github.com:tran-haison/Trade-System.git
cd TradeSystem- Build the Docker image:
docker build -t haison/barter-trading .Run the container with the following command:
docker run -d \
--name barter-trading \
-p 3000:3000 \
-p 27017:27017 \
-v "$(pwd)/public/uploads:/usr/src/app/public/uploads" \
-v mongodb_data:/data/db \
-e MONGODB_URI=mongodb://localhost:27017/barter-trading \
-e SESSION_SECRET=barter-trading-secret-key-2025 \
-e NODE_ENV=development \
haison/barter-trading- Web Application: http://localhost:3000
- MongoDB: localhost:27017
Access the student identity endpoint at:
http://localhost:3000/api/student
Expected output:
{
"name": "Hai Son Tran",
"studentId": "224252426"
}# View container logs
docker logs -f barter-trading
# Stop the container
docker stop barter-trading
# Start the container
docker start barter-trading
# Remove the container
docker rm -f barter-trading
# Access MongoDB shell
docker exec -it barter-trading mongoshThe application uses the following environment variables:
MONGODB_URI: MongoDB connection stringSESSION_SECRET: Secret key for session managementNODE_ENV: Application environment (development/production)
The container uses two volumes:
public/uploads: For storing uploaded filesmongodb_data: For persisting MongoDB data
3000: Web application27017: MongoDB
Trade System is a modern barter trading platform that enables users to exchange items with each other in a secure and user-friendly environment. The system facilitates item listings, trade proposals, negotiations, and trade completion with a focus on user experience and security.
-
Authentication & Security
- User registration and login
- Secure password management
- Session handling
- Protected routes
-
Profile Management
- Customizable user profiles
- User ratings and feedback system
- Activity tracking
- Profile picture upload
-
Listing Features
- Create, edit, and delete item listings
- Multiple image uploads (up to 5 images)
- Item categorization
- Search and filter functionality
-
Item Status
- Available
- Pending
- Traded
- Location tracking
- Condition and description management
-
Trade Features
- Create trade proposals
- Multiple items in single trade
- Trade status management
- Trade history tracking
-
Trade Statuses
- Pending
- Accepted
- Rejected
- Completed
- Cancelled
-
Messaging System
- In-trade messaging
- User-to-user messaging
- Real-time notifications
-
Activity Notifications
- Trade proposals
- Trade acceptances
- Trade rejections
- Trade completions
- Trade cancellations
- User Dashboard
- Personalized activity feed
- Quick action buttons
- Trade status overview
- Item management shortcuts
- Security Features
- Secure authentication
- Protected routes
- Input validation
- File upload security
- Session management
- Node.js
- Express.js
- MongoDB
- Mongoose ODM
- EJS Templates
- Material Design
- Responsive Design
- JavaScript/jQuery
- MongoDB integration
- Efficient data modeling
- Indexed queries
- Data validation
- Secure file uploads
- Image processing
- File type validation
- Storage optimization
- RESTful endpoints
- JSON responses
- Error handling
- Rate limiting
- Node.js v14 or higher
- MongoDB v4.4 or higher
- Modern web browser
- Internet connection
- Git
- npm or yarn
- Code editor
- MongoDB Compass (optional)
-
Clone the repository
git clone https://github.com/yourusername/trade-system.git cd trade-system -
Install dependencies
npm install
-
Environment Setup Create a
.envfile in the root directory:PORT=3000 MONGODB_URI=mongodb://localhost:27017/trade_system SESSION_SECRET=your_session_secret
-
Start the server
npm start
- MongoDB connection settings in
config/db.js - Session store configuration in
app.js
- Image upload settings in
routes/itemRoutes.js - File size limits and allowed types
- Real-time notifications
- Mobile application
- Advanced search filters
- Trade analytics
- User verification system
- Payment integration
- Automated trade matching
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Your Name - Initial work
- Material Design for UI components
- MongoDB for database
- Express.js for backend framework
For support and bug reports, please contact the development team or create an issue in the repository.
Last Updated: May 28, 2025