63 lines
1.4 KiB
Markdown
63 lines
1.4 KiB
Markdown
# Document Scanner Application
|
|
|
|
A simple document scanning application with Go backend and HTML/JavaScript frontend.
|
|
|
|
## Project Structure
|
|
|
|
```
|
|
scanner/
|
|
├── backend/ # Go backend
|
|
│ └── main.go # Main Go server file
|
|
└── frontend/ # Frontend
|
|
└── index.html # Main HTML file
|
|
```
|
|
|
|
## Getting Started
|
|
|
|
### Prerequisites
|
|
|
|
- Go 1.16+ installed
|
|
|
|
### Backend Setup
|
|
|
|
1. Navigate to the backend directory:
|
|
```
|
|
cd backend
|
|
```
|
|
|
|
2. Run the Go server:
|
|
```
|
|
go run main.go
|
|
```
|
|
|
|
The server will start on port 8080.
|
|
|
|
### Frontend Setup
|
|
|
|
1. Simply open the `frontend/index.html` file in a web browser.
|
|
|
|
## API Endpoints
|
|
|
|
The backend provides the following endpoints:
|
|
|
|
- `POST /scan/start`: Starts a new scanning session
|
|
- `POST /scan/abort`: Aborts the current scanning session
|
|
- `GET /documents`: Returns documents from the current session
|
|
|
|
## Usage
|
|
|
|
1. Open the frontend in your browser
|
|
2. Click "Start Scanning" to begin scanning documents
|
|
3. The documents will appear in the grid below as they are scanned
|
|
4. Click "Abort Scanning" to stop the process at any time
|
|
5. Click "Refresh Documents" to manually refresh the document list
|
|
|
|
## Notes
|
|
|
|
This is a simplified simulation of document scanning. In a real-world application, you would need to:
|
|
|
|
1. Integrate with actual scanning hardware
|
|
2. Implement proper error handling
|
|
3. Add authentication and security
|
|
4. Add persistent storage for documents
|