Update README.md to provide a comprehensive overview of The Order monorepo, including repository structure, quickstart guide, development workflow, and contribution guidelines.
This commit is contained in:
40
services/intake/README.md
Normal file
40
services/intake/README.md
Normal file
@@ -0,0 +1,40 @@
|
||||
# Intake Service
|
||||
|
||||
Service for document ingestion, OCR, classification, and routing.
|
||||
|
||||
## Features
|
||||
|
||||
- Document upload and ingestion
|
||||
- OCR processing
|
||||
- Content classification (legal/treaty/finance/history)
|
||||
- Entity extraction
|
||||
- Routing to appropriate workflows
|
||||
|
||||
## Development
|
||||
|
||||
```bash
|
||||
# Install dependencies
|
||||
pnpm install
|
||||
|
||||
# Run development server
|
||||
pnpm dev
|
||||
|
||||
# Build
|
||||
pnpm build
|
||||
|
||||
# Start production server
|
||||
pnpm start
|
||||
```
|
||||
|
||||
## API Endpoints
|
||||
|
||||
- `GET /health` - Health check
|
||||
- `POST /ingest` - Ingest document
|
||||
|
||||
## Environment Variables
|
||||
|
||||
- `PORT` - Server port (default: 4001)
|
||||
- `DATABASE_URL` - PostgreSQL connection string
|
||||
- `STORAGE_PROVIDER` - Storage provider (s3/gcs)
|
||||
- `STORAGE_BUCKET` - Storage bucket name
|
||||
|
||||
27
services/intake/package.json
Normal file
27
services/intake/package.json
Normal file
@@ -0,0 +1,27 @@
|
||||
{
|
||||
"name": "@the-order/intake",
|
||||
"version": "0.1.0",
|
||||
"private": true,
|
||||
"description": "Intake service: ingestion → OCR → classify → route",
|
||||
"main": "./src/index.ts",
|
||||
"scripts": {
|
||||
"dev": "tsx watch src/index.ts",
|
||||
"build": "tsc",
|
||||
"start": "node dist/index.js",
|
||||
"lint": "eslint src --ext .ts",
|
||||
"type-check": "tsc --noEmit"
|
||||
},
|
||||
"dependencies": {
|
||||
"fastify": "^4.25.2",
|
||||
"@the-order/schemas": "workspace:*",
|
||||
"@the-order/storage": "workspace:*",
|
||||
"@the-order/workflows": "workspace:*"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^20.10.6",
|
||||
"typescript": "^5.3.3",
|
||||
"tsx": "^4.7.0",
|
||||
"eslint": "^8.56.0"
|
||||
}
|
||||
}
|
||||
|
||||
36
services/intake/src/index.ts
Normal file
36
services/intake/src/index.ts
Normal file
@@ -0,0 +1,36 @@
|
||||
/**
|
||||
* Intake Service
|
||||
* Handles document ingestion, OCR, classification, and routing
|
||||
*/
|
||||
|
||||
import Fastify from 'fastify';
|
||||
|
||||
const server = Fastify({
|
||||
logger: true,
|
||||
});
|
||||
|
||||
// Health check
|
||||
server.get('/health', async () => {
|
||||
return { status: 'ok' };
|
||||
});
|
||||
|
||||
// Ingest endpoint
|
||||
server.post('/ingest', async (request, reply) => {
|
||||
// TODO: Implement document ingestion
|
||||
return { message: 'Ingestion endpoint - not implemented yet' };
|
||||
});
|
||||
|
||||
// Start server
|
||||
const start = async () => {
|
||||
try {
|
||||
const port = Number(process.env.PORT) || 4001;
|
||||
await server.listen({ port, host: '0.0.0.0' });
|
||||
console.log(`Intake service listening on port ${port}`);
|
||||
} catch (err) {
|
||||
server.log.error(err);
|
||||
process.exit(1);
|
||||
}
|
||||
};
|
||||
|
||||
start();
|
||||
|
||||
10
services/intake/tsconfig.json
Normal file
10
services/intake/tsconfig.json
Normal file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "./dist",
|
||||
"rootDir": "./src"
|
||||
},
|
||||
"include": ["src/**/*"],
|
||||
"exclude": ["node_modules", "dist", "**/*.test.ts", "**/*.spec.ts"]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user