VICSR's backend was built using Django for the server, PostgresSQL V13 for the database. VICSR backend also requires accounts with Amazon S3 Bucket for persistant file storage, Google Translate API, and Wikipedia API. All database tables are built from Django's models. The VICSR Server has the follow apps:
- AccountManagement
- DocumentManagement
- DocumentProcessing
- VocabularyManagement
Each VICSR server app has associated API calls for the frontend to utilize.
- Clone or unzip VICSR Backend repository
- Install all libraries in requirements.txt
The VICSR Database is implemented with PostgreSQL V13. For local development, follow instructions for your OS here. Once PostGresSQL is installed create a local database, and complete the following steps:
- Update settings.py with database user and password
- Run command
python manage.pyfrom project directory - Run command
makemigrationsto initialize all Django models - Run command
migrateto build tables in local database
The VICSR Server is implemented with Django. To run VICSR's Django Server locally, run the following command:
python manage.py runserver
Sign up for an S3 account and follow Amazon's directions for getting and AWS Access Key ID and Key. Also follow directions give from Google and Wikipedia to access their APIs. Include all related details in a conig file(s).
- Add a Postgres database to the Heroku project
- Add the following buildpacks:
- Add the following Config Vars:
- ALLOWED_HOSTS | vicsr-api.herokuapp.com
- AWS_ACCESS_KEY_ID | Your AWS Access Key ID
- AWS_SECRET_ACCESS_KEY | Your AWS Secret Access Key
- GOOGLE_APPLICATION_CREDENTIALS | google-credentials.json
- GOOGLE_CLIENT_ID | Your Google client ID
- GOOGLE_CREDENTIALS | Your Google credentials
- GOOGLE_KEY | Your Google Key
- GOOGLE_KEY_ID | Your Google Key ID
- GOOGLE_PROJECT_ID | Your Google project ID
- S3_BUCKET_NAME | Your S3 bucket name
- WEB_CONCURRENCY | 2+ (depending on Heroku tier)
- Make sure you have Heroku CLI installed
heroku login- Make sure to add heroku remote origin with this command:
heroku git:remote -a vicsr-api git add .git commit -am "message"git push heroku main
- User authentication/management
- Document Upload:
- Split PDF into multiple images
- Each image cleaned up and straightened for OCR
- Each image resized to frontend canvas size
- OCR implemented and any already highlighted words extracted
- Associated study set auto-generated
- Document Management(rename, delete)
- Live highlight to translation/definition
- Custom study set creation
- Study set words ordered by user feedback
- OCR misses some words, therefore cannot be found in query from frontend highlight.
- OCR processing upon upload is slow. To fix this OCR should be implemented as a background process.
- Some definitions returned from the Wikipedia API are not ideal/the best choice for the word.
- Sapced repition algorithm not implememnted, only take user's feedback.