CresceBR is a comprehensive B2B (Business-to-Business) marketplace platform developed for UTFPR's E-commerce course (7th semester). This platform connects buyers and suppliers in an industrial marketplace environment with advanced features for quotations, order management, and company verification.
This MVP implements a complete B2B marketplace following SOLID principles and modern web development practices. The platform facilitates business relationships between companies through a secure, scalable, and user-friendly interface.
Course: E-commerce
Institution: UTFPR (Federal University of Technology - ParanĆ”)
Semester: 7th
Professor: Maria Adelina Silva Brito
- CNPJ Validation: Real-time validation using Brasil API (https://brasilapi.com.br)
- Company Registration: Separate registration flows for buyers and suppliers
- JWT Authentication: Secure token-based authentication with role-based access
- Company Verification: Admin workflow for company approval
- Request Quotations: Buyers can request quotes for multiple products
- Tier-based Pricing: Volume discounts based on quantity ranges
- Quote Processing: Suppliers can review and process quotation requests
- Automatic Calculations: Tax, shipping, and total cost calculations
- Product Management: CRUD operations with technical specifications
- Bulk Import: CSV import functionality for large product catalogs
- Advanced Search: Filter by category, specifications, and price range
- Image Management: Support for product images and technical documents
- Order Creation: Convert approved quotations into orders
- Status Tracking: Complete order lifecycle management
- Delivery Estimates: Automatic calculation based on shipping method
- Bulk Operations: Process multiple orders simultaneously
- Company Verification: Approve/reject company registrations
- Analytics Dashboard: Comprehensive business metrics and insights
- User Management: Role-based access control and user administration
- System Monitoring: Track platform performance and usage
- Revenue Analytics: Track sales performance and growth trends
- Order Statistics: Monitor order status distribution and processing times
- Company Insights: Analyze buyer/supplier activity and engagement
- Export Capabilities: Generate reports in multiple formats
- Frontend: React + TypeScript + Chakra UI
- Backend: Node.js + Express + TypeScript
- Database: PostgreSQL with Sequelize ORM
- Authentication: JWT with role-based access control
- File Processing: Multer for CSV imports and file uploads
- API Integration: Brasil API for CNPJ validation
- Containerization: Docker & Docker Compose
āāāāāāāāāāāāāāāāāāā āāāāāāāāāāāāāāāāāāā āāāāāāāāāāāāāāāāāāā
ā React Frontendā ā Express Backendā ā PostgreSQL ā
ā (Port 3000) āāāāāŗā (Port 3001) āāāāāŗā (Port 5432) ā
āāāāāāāāāāāāāāāāāāā āāāāāāāāāāāāāāāāāāā āāāāāāāāāāāāāāāāāāā
ā
ā¼
āāāāāāāāāāāāāāāāāāā
ā Brasil API ā
ā (CNPJ Validation)ā
āāāāāāāāāāāāāāāāāāā
- Users: Company information, authentication, and role management
- Products: Industrial catalog with specifications and pricing
- Quotations: Quote requests, items, and processing status
- Orders: Order management with status tracking and delivery
- Admin: System configuration and analytics data
- Docker (v20.10+)
- Docker Compose (v2.0+)
- Git
-
Clone the repository:
git clone <repository-url> cd MarketPlace_B2B/B2B
-
Environment setup:
# Backend environment cp backend/.env.example backend/.env # Frontend environment cp frontend/.env.example frontend/.env
-
Start the application:
docker-compose up --build
-
Access the platform:
- Frontend: http://localhost:3000
- Backend API: http://localhost:3001
- Database: localhost:5432
After initial setup, you can use these test accounts:
Admin Account:
- Email: admin@crescebr.com
- Password: admin123
- CNPJ: 11.222.333/0001-81
Supplier Account:
- Email: supplier@example.com
- Password: supplier123
- CNPJ: 12.345.678/0001-90
Buyer Account:
- Email: buyer@example.com
- Password: buyer123
- CNPJ: 98.765.432/0001-10
POST /api/auth/register # Register new buyer company
POST /api/auth/register-supplier # Register new supplier company
POST /api/auth/login # Company login
GET /api/auth/profile # Get current user profile
GET /api/companies # List all companies (admin)
PUT /api/companies/:id/verify # Verify company (admin)
GET /api/companies/stats # Company statistics (admin)
GET /api/products # List products with filters
POST /api/products # Create product (supplier)
PUT /api/products/:id # Update product (supplier)
DELETE /api/products/:id # Delete product (supplier)
POST /api/products/import-csv # Bulk import products (supplier)
GET /api/products/sample-csv # Download sample CSV template
POST /api/quotations # Create quotation request (buyer)
GET /api/quotations # List user quotations
GET /api/quotations/:id # Get quotation details
PUT /api/quotations/:id # Update quotation status (supplier)
POST /api/quotations/:id/process # Process quotation (supplier)
POST /api/orders # Create order from quotation
GET /api/orders # List user orders
GET /api/orders/:id/history # Get order status history
PUT /api/orders/:id/status # Update order status (supplier/admin)
GET /api/orders/stats # Order statistics (admin)
GET /api/admin/analytics # Dashboard analytics
GET /api/admin/companies # Company management
PUT /api/admin/companies/:id # Update company status
# Backend tests
cd backend && npm test
# Frontend tests
cd frontend && npm test
# Run tests in Docker
docker-compose exec backend npm test
docker-compose exec frontend npm test- Unit Tests: Controllers, services, and utilities
- Integration Tests: API endpoints and database operations
- Authentication Tests: JWT and role-based access control
- Business Logic Tests: Quotation calculations and order workflows
cd backend
npm install
npm run dev # Start with hot reload
npm run build # Build for production
npm run lint # Code lintingcd frontend
npm install
npm start # Start development server
npm run build # Build for production
npm run lint # Code linting# Run migrations
npm run db:migrate
# Seed database
npm run db:seed
# Reset database
npm run db:migrate:undo:all && npm run db:migrate && npm run db:seed- Buyer: Can request quotations and place orders
- Supplier: Can manage products and process quotations
- Admin: Full system access and company verification
- Buyer creates quotation request with product items
- System calculates pricing based on quantity tiers
- Supplier reviews and can accept/modify the quotation
- Approved quotations can be converted to orders
- Orders follow a defined status workflow (pending ā processing ā shipped ā delivered)
- Base Price: Product unit price
- Quantity Discounts: Tier-based volume pricing
- Tax Calculation: Configurable tax rates
- Shipping Costs: Calculated based on weight and distance
- CNPJ Validation: Real-time validation with Brasil API
- Input Sanitization: Protection against XSS and injection attacks
- Rate Limiting: API request throttling
- JWT Security: Secure token management with expiration
- Role-based Access: Granular permission control
- Password Hashing: bcrypt for secure password storage
# Build production images
docker-compose -f docker-compose.prod.yml build
# Deploy to production
docker-compose -f docker-compose.prod.yml up -dRequired environment variables for production:
DATABASE_URL=postgresql://user:password@host:port/database
JWT_SECRET=your-secret-key
JWT_EXPIRES_IN=24h
NODE_ENV=production
CNPJ_API_URL=https://brasilapi.com.br/api/cnpj/v1/
The platform includes comprehensive analytics:
- User Engagement: Track company registration and activity
- Sales Performance: Monitor quotation conversion rates
- System Health: API response times and error rates
- Business Metrics: Revenue tracking and growth analysis
This is an academic project, but contributions are welcome:
- Fork the repository
- Create a 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 Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License (CC BY-NC-SA 4.0).
You are free to:
- Share - copy and redistribute the material in any medium or format
- Adapt - remix, transform, and build upon the material
Under the following terms:
- Attribution - You must give appropriate credit and indicate if changes were made
- NonCommercial - You may not use the material for commercial purposes
- ShareAlike - If you remix or build upon the material, you must distribute under the same license
See the LICENSE file for details or visit CC BY-NC-SA 4.0.
This project was developed as part of the E-commerce course curriculum at UTFPR, focusing on:
- Modern web development practices
- B2B marketplace architecture
- Database design and optimization
- API development and documentation
- User experience design for business applications
- Security best practices
- Testing methodologies
For questions about this project:
- Academic: Contact Professor Maria Adelina Silva Brito
- Technical: Open an issue on the repository
- Documentation: Refer to the inline code comments and API documentation
CresceBR - Empowering Brazilian businesses through technology š§š·