A static web application for accessing and managing LDC Via API instances. This client provides a user-friendly interface to browse databases, collections, and perform CRUD operations on documents.
- API Configuration: Easy setup with API base URL and key
- Database Browsing: Navigate through databases and collections
- Document Management: Create, read, update, and delete documents
- User Details: View current user information and permissions
- Responsive Design: Works on desktop and mobile devices
- Local Storage: Saves API configuration for future sessions
- A running LDC Via API instance
- Valid API key for authentication
- Modern web browser with JavaScript enabled
-
Clone or download this repository:
git clone <repository-url> cd ldc-via-client
-
Serve the files using a local web server:
Using Python:
python -m http.server 8000
Using Node.js:
npx serve .Using PHP:
php -S localhost:8000
-
Open your browser and navigate to
http://localhost:8000
- Click "Setup Connection" or the Settings button
- Enter your API base URL (e.g.,
https://api.example.com/2.0) - Enter your API key
- Click "Test Connection" to verify the connection
- Click "Save" to store the configuration
- Databases: Click on a database card to view its collections
- Collections: Click on a collection card to view its documents
- Documents: Click the edit button to modify a document, or delete button to remove it
- Navigate to a collection
- Click "Add Document"
- Fill in the document ID and form type
- Add field values using the form
- Click "Add Field" to add custom fields
- Click "Save" to create the document
- Click the edit button (pencil icon) on any document
- Modify the field values as needed
- Click "Save" to update the document
This client is designed to work with LDC Via API v2.0 and supports the following endpoints:
GET /databases- List databasesGET /collections/{database}- List collectionsGET /collections/{database}/{collection}- List documentsGET /document/{database}/{collection}/{id}- Get documentPUT /document/{database}/{collection}/{id}- Create documentPOST /document/{database}/{collection}/{id}- Update documentDELETE /document/{database}/{collection}/{id}- Delete documentGET /userdetails- Get user detailsGET /metadata/{database}/{collection}- Get collection metadata
ldc-via-client/
├── index.html # Main HTML file
├── css/
│ └── styles.css # Application styles
├── js/
│ ├── api-client.js # API communication layer
│ ├── ui-components.js # UI components and utilities
│ └── app.js # Main application controller
├── assets/ # Static assets (images, etc.)
└── README.md # This file
This application requires a modern browser that supports:
- ES6+ JavaScript features (async/await, classes, arrow functions)
- Fetch API
- CSS Grid and Flexbox
- Local Storage
Supported browsers:
- Chrome 60+
- Firefox 55+
- Safari 11+
- Edge 79+
- API keys are stored in browser local storage
- All API communication should use HTTPS
- The API server must have appropriate CORS headers configured
- Consider implementing additional authentication layers for production use
- Edit the HTML, CSS, or JavaScript files
- Refresh the browser to see changes
- Use browser developer tools for debugging
- API Client: Add new methods to
js/api-client.js - UI Components: Add new UI functions to
js/ui-components.js - App Logic: Add new application logic to
js/app.js - Styling: Add new styles to
css/styles.css
- Verify the API base URL is correct and accessible
- Check that the API key is valid and has appropriate permissions
- Ensure the API server has CORS headers configured
- Check browser console for error messages
If you encounter CORS errors, the API server needs to be configured with appropriate headers:
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS
Access-Control-Allow-Headers: Content-Type, apikey
- Clear browser data if configuration seems corrupted
- Check browser privacy settings that might block local storage
- Use private/incognito mode to test with clean storage
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.