Postaci - Swiss Postal Delivery Application
Postaci is a web application for managing postal deliveries in Switzerland, featuring OCR address scanning, address validation, and route optimization.
Features
- OCR-based address scanning using Tesseract.js
- Swiss address validation with canton detection
- Route optimization for multiple delivery addresses
- Interactive map interface using Leaflet
- User authentication with NextAuth.js
- Prisma ORM for database operations
Technology Stack
- Frontend: React, Next.js 15, TailwindCSS
- Backend: Next.js API routes, Express.js (validation service)
- Database: PostgreSQL with Prisma ORM
- Authentication: NextAuth.js
- Maps: Leaflet, React-Leaflet
- OCR: Tesseract.js
Project Structure
app/
- Next.js application routes and componentscomponents/
- Reusable React componentslib/
- Utility functions and API helpersprisma/
- Database schema and migrationsproviders/
- React context providerspublic/
- Static assetsvalidation-service/
- Address validation microservice
Setup & Development
Prerequisites
- Node.js 18+ and npm
- PostgreSQL (for production)
Installation
-
Clone the repository:
git clone https://gitea.oezdag.io/m3mo/POSTERAPP_V1.git cd POSTERAPP_V1
-
Install dependencies:
npm install cd validation-service && npm install
-
Configure environment variables:
cp .env.example .env.local
-
Start the development environment:
./start-dev.sh
This will start both the Next.js application and the address validation service.
Database Setup
- Initialize Prisma:
npx prisma generate npx prisma db push
Testing
The address validation service can be tested independently:
cd validation-service
npm run dev
Then use curl to test the endpoints:
# Validate an address
curl -X POST http://localhost:8000/api/validate-address \
-H "Content-Type: application/json" \
-d '{"address": "Luzernstrasse 27, 4552 Derendingen"}'
License
This project is proprietary and confidential.
Description
Languages
TypeScript
91.4%
JavaScript
5.6%
Shell
2.8%
CSS
0.2%