GithubHelp home page GithubHelp logo

sentences-express-app's Introduction

Sample express.js app

Getting started

Web server

This is a single express app serving both the frontend and backend components, for simplicity. This could be easily separated.

  1. This app uses Firestore as backend with the firebase-admin npm for node.js, so it requires the google serviceAccountKey.json file to be downloaded from the Firebase console. Please place in a safe location and set the GOOGLE_APPLICATION_CREDENTIALS environment variable pointing to its location. See instructions to generate the file and set the environment variable here. This project uses dotenv, so see .env.sampe file for reference.
  2. Run locally as: npm start or in debug mode: DEBUG=app:* npm start
  3. Browse to http://localhost:3000

Data import script

From the project root folder (so it can read google credentials file):

  1. node scripts/import_sentences.js scripts/sentences.jsonl.600.txt

(*) Please note that importing the 20,000 sentences file will exceed the free Firebase quota allocation.

Word ranking script

From the project root folder (so it can read google credentials file):

  1. node scripts/word_ranking.js

TODO

  • Import script: Implemented but for some reason the data is not getting stored in Firestore.
  • English translation with Yandex: There is no free tier for individual developers.
  • Tests
  • Host the app on Railway or a similar platform

Other:

  • Proper error handling and error pages
  • There is basic API authentication based on headers, but the api key is passed through the meta tag. Proper api key management is missing.

sentences-express-app's People

Contributors

ivanonchi avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.