The Ultimate Subjective Answers Checker - INT 404 Project
Project Available @https://xenon.satyajiit.xyz
- Flask
- Responsive Material Design
- Add new questions on the go.
- Analysis of newly added questions
- Rake_nltk
- Flask
Get the following dependencies:
pip install rake-nltk
pip install PyDictionary
pip install flask
pip install nltk
Download nltk Data if not done:
python -m nltk.downloader all
Thats it 😉
python app.py
Want to deploy on firebase hosting? CloudRun will make it possible by providing a CDN.
Create a direcory structure of the following (Create files manually like firebase.json etc which do not exist on this repo):
XenonChecker (root dir)
├── server
| ├── src
| └── app.py
| └── templates
| └── all files like index.html
| └── static
| └── all files like js
| ├── Dockerfile
├── static
| └── leave empty
├── firebase.json
├── .firebaserc
Dockerfile
FROM python:3.7
RUN pip install Flask gunicorn
RUN pip install rake-nltk
RUN pip install nltk
RUN pip install PyDictionary
COPY src/ app/
WORKDIR /app
RUN python -m nltk.downloader all -d /usr/local/nltk_data
ENV PORT 8080
CMD exec gunicorn --bind :$PORT --workers 8 app:app
From Server dir execute the following (Make sure you have performed gcloud init and set the project id):
gcloud builds submit --tag gcr.io/[PROJECT-ID]/[ANY_NAME_OF_SERVICE]
//Hit yes if asked to enable APIs
gcloud run deploy --image gcr.io/[PROJECT-ID]/[ANY_NAME_OF_SERVICE] --memory 1G
//Select fullyManaged Cloud run and region to us-central1
Setup Firebase files:
.firebaserc
{
"projects" :{
"default" : "xenonchecker"
}
}
firebase.json
{
"hosting" : {
"public" : "static",
"ignore" : [
"firebase.json"
],
"rewrites" : [{
"source" : "**",
"run" : {
"serviceId" : "[ANY_NAME_OF_SERVICE]"
}
}]
}
}
Deploy on firebase hosting:
firebase deploy --only hosting
- Feel free to reach me , if you are stuck!