Skip to content

React Web Application to convert Printed Text or Other Text to convert into local data using OCR, and storing the extracted data into a Database for SIH Hackathon.

Notifications You must be signed in to change notification settings

amogh-w/Hackathon-OCR-Magic

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OCR Magic

1

Presenting a React Web Application to convert Printed Text or Other Text to convert into local data using OCR, and storing the extracted data into a Database. It uses React.js for frontend, while MongoDB + GraphQL as its backend. OCR Technology is added using the Pure Javascript Multilingual OCR Library Tesseract.js

Features of Tesseract.js

  • Supports more than 100 languages
  • Automatic text orientation and script detection
  • Simple interface for reading paragraph, word, and character bounding boxes
  • It can run either in a browser and on a server with NodeJS.

Screenshots

Dashboard

1

Image Convert Screen

1

Schemas:

Document Schema:

const documentSchema = new Schema({
  content: String,
  title: String,
  date: Date,
  userId: String
});

Code Snippets

GraphQL Root Query and Mutation:

const RootQuery = new GraphQLObjectType({
  name: "RootQueryType",
  fields: {
    documents: {
      type: GraphQLList(DocumentType),
      resolve(parent, args) {
        return Document.find({});
      }
    }
  }
});

const Mutations = new GraphQLObjectType({
  name: "Mutations",
  fields: {
    addDocument: {
      type: DocumentType,
      args: {
        content: { type: new GraphQLNonNull(GraphQLString) },
        title: { type: new GraphQLNonNull(GraphQLString) },
        date: { type: new GraphQLNonNull(GraphQLDateTime) }
      },
      resolve(parent, args) {
        let document = new Document({
          content: args.content,
          title: args.title,
          date: args.date
        });
        return document.save();
      }
    }
  }
});

Resources:

  • Create a New React App - Get started with React here
  • Material-UI - React components for faster and easier web development
  • Express.js - A web application framework for Node.js
  • GraphQL - An open-source data query and manipulation language for APIs
  • Mongoose - An Object Data Modeling (ODM) library for MongoDB and Node
  • Firebase - Build apps fast, without managing infrastructure
  • Tesseract.js - The pure Javascript port of the popular Tesseract OCR engine
  • Multer - Multer is a node.js middleware for handling multipart/form-data

Available Scripts:

In the root directory, you can run: nodemon server

Server will be running at http://localhost:5001. It is required for endpoint where Tesseract.js is running.

In the server directory, you can run: nodemon server

Server will be running at http://localhost:5000. It is required for MongoDB cluster connectivity and GraphQL endpoints.

In the src directory, you can run: yarn start

The website will be live at http://localhost:3000.


This project was bootstrapped with Create React App.

Team Members:

| Amogh Warkhandkar | Omkar Bhambure |

About

React Web Application to convert Printed Text or Other Text to convert into local data using OCR, and storing the extracted data into a Database for SIH Hackathon.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages