A production-ready React web application that fetches and displays South African tenders from the National Treasury eTenders OCDS Releases API.
- π Search & Filter: Real-time search functionality to find relevant tenders
- π± Responsive Design: Mobile-first responsive card gallery layout
- π Fast Performance: Built with Vite for optimal build times and hot module replacement
- π¨ Modern UX: Clean, intuitive interface with smooth interactions
- π Direct Application: One-click access to official tender documents
- π Pagination: Efficient browsing through large datasets
- β‘ Error Handling: Robust error handling with retry functionality
- π API Proxy: Express backend to handle API requests efficiently
- π Private Tenders: Add and manage private sector tender opportunities
- βοΈ Cloud Storage: Supabase integration for persistent data storage
- π Auto-Sync: Automatic sync between localStorage and cloud database
- React 19 - UI framework
- Vite 7 - Build tool and dev server
- Axios - HTTP client
- Supabase - Backend-as-a-Service for data storage
- CSS3 - Styling with modern features
- Node.js - Runtime environment
- Express 5 - Web server framework
- CORS - Cross-origin resource sharing
- Supabase - PostgreSQL database and API
marketaccess/
βββ src/
β βββ components/ # React components
β β βββ TenderCard.jsx
β β βββ FilterBar.jsx
β β βββ LoadingSpinner.jsx
β β βββ ErrorMessage.jsx
β β βββ Pagination.jsx
β βββ lib/ # Utility functions and API services
β β βββ api.js
β βββ App.jsx # Main application component
β βββ App.css
β βββ index.css
β βββ main.jsx
βββ server/
β βββ index.js # Express backend server
βββ public/
βββ package.json
βββ vite.config.js
- Node.js 18+ and npm installed
- Internet connection to access the National Treasury eTenders API
- Supabase account (free tier) for private tenders feature
- Clone the repository:
git clone https://github.com/kumii-dev/marketaccess.git
cd marketaccess- Install dependencies:
npm install- Set up environment variables:
cp .env.example .envEdit .env and add your Supabase credentials (see SUPABASE-SETUP.md for details):
VITE_SUPABASE_URL=https://your-project-id.supabase.co
VITE_SUPABASE_ANON_KEY=your-anon-key-here- Set up Supabase database (first time only):
- Follow the guide in SUPABASE-SETUP.md
- Run the SQL schema in your Supabase project
The application requires both the backend server and frontend to be running.
- Start the Express backend server (in one terminal):
npm run serverThe server will run on http://localhost:3001
- Start the Vite dev server (in another terminal):
npm run devThe frontend will run on http://localhost:5174
- Open your browser and navigate to
http://localhost:5174
- Build the frontend:
npm run build- Preview the production build:
npm run previewThe application integrates with the National Treasury eTenders OCDS Releases API:
- Base URL:
https://ocds-api.etenders.gov.za/api/OCDSReleases - API Standard: Open Contracting Data Standard (OCDS)
-
GET /api/tenders- Fetch tenders with pagination and search- Query Parameters:
page- Page number (default: 1)limit- Items per page (default: 20)search- Search query string
- Query Parameters:
-
GET /api/health- Health check endpoint
Each tender card displays:
- Tender title and OCID (Open Contracting ID)
- Buyer organization name
- Tender value (if available)
- Start and end dates
- Description
- "Apply Now" button to access tender documents
- Real-time search across tender data
- Responsive search input with clear button
- Search results update pagination automatically
- Smart pagination with ellipsis for large datasets
- Previous/Next navigation
- Direct page number access
- Smooth scroll to top on page change
- Mobile-first approach
- Flexible grid layout
- Touch-friendly interface
- Optimized for various screen sizes
Create a .env file in the root directory:
# Backend server port
PORT=3001
# Frontend API URL (for production)
VITE_API_BASE_URL=http://localhost:3001
# Use mock data for demonstration (set to 'true' to use mock data)
# Useful for development/testing when the external API is not accessible
VITE_USE_MOCK_DATA=falseNote: The application includes mock tender data for demonstration purposes. Set VITE_USE_MOCK_DATA=true in your .env file to use mock data instead of the live API. This is useful for development, testing, or when the National Treasury API is unavailable.
- Chrome (latest)
- Firefox (latest)
- Safari (latest)
- Edge (latest)
- 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.
- Data provided by National Treasury eTenders
- Built with Vite and React
- API follows Open Contracting Data Standard (OCDS)
For issues, questions, or contributions, please open an issue in the GitHub repository.