-
Notifications
You must be signed in to change notification settings - Fork 11
SpellIt's Setup Guide
This Wiki article will walk developers through everything they need to install/setup to get a local copy of SpellIt. For everything GitHub related, please see SpellIt's Github Strategy. Once you have a local copy of the repo, it's time to install the necessary dependencies.
If you are just looking for the most basic setup to get up and running, you only need to follow the Angular Setup section. However, if you wish to work at all with the database/affix generation, take a look at the Python Setup and Haskell Setup guides as well.
Expand
This section of this wiki is the only absolutely necessary piece to get a local copy that works up and running. The angular code by default connects to the main server and allows all of the code to run correctly. To make changes to the heart of the code (The Python and Haskell code), the additional setup sections are necessary.
This project was generated with Angular CLI version 6.2.2.
You need the node package manager (NPM)
To check whether you have it in your terminal, command line, type: npm -v
If it shows a version of npm, you're good.
Otherwise, just go to https://nodejs.org/en/download/ and install NPM.
The following command will look at package.json file under the project directory and install all stuff under "dependencies" and "devDependencies" which includes Angular CLI (commands starts with 'ng')
> npm install
To serve the project to the browser, run:
> ng serve -o
The -o flag tells the CLI to launch your browser with the project. Now, you're able to watch your Angular 6 project as you code and it will automatically reload the page on browser for you.
Run ng generate component component-name
to generate a new component. You can also use ng generate directive|pipe|service|class|guard|interface|enum|module
.
Run ng build
to build the project. The build artifacts will be stored in the dist/
directory. Use the --prod
flag for a production build.
Run ng test
to execute the unit tests via Karma.
Run ng e2e
to execute the end-to-end tests via Protractor.
To get more help on the Angular CLI use ng help
or go check out the Angular CLI README.
Expand
The back end of the project is build on python 2.7. If you are a linux user, Python typically comes pre-installed, but if it is not, follow the commands below to install it.
> sudo apt-get update
> sudo apt-get upgrade
> sudo apt-get install python2.7 python-pip
Note: If possible, avoid upgrading python-pip to a newer version, otherwise you will need to use python-pip command to install dependencies.
To connect Backend API to Frontend we are using Flask, to install full stack of flask dependencies run following commands.
> sudo pip install flask
> sudo pip install -U flask-cors
> sudo pip install flask-restful
The second and third commands install Flask-Cors and Flask-Restful, respectively.
You should then be all set to go! Try running
> python flasktet.py
You should see something like this.
- Serving Flask app "flasktet" (lazy loading)
- Environment: production WARNING: Do not use the development server in a production environment. Use a production WSGI server instead.
- Debug mode: on
- Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
- Restarting with stat
- Debugger is active!
- Debugger PIN: 176-475-588 `
Expand
We could write out a guide about how to do this, but fortunately, someone already did! Check it out here and follow instructions to get version 8.2.2 or newer: Haskell's Website
All libraries that are imported in WebtoHunspell.hs must be installed locally. You can use the following command to install the requisite libraries:
> cabal install --only-dependencies
Expand
This project uses Couchdb, which requires Docker.
Docker should be installed via the following commands:
> sudo apt-get update
> sudo apt-get install docker-ce
If you are experiencing issues with the above commands, try the process below:
> sudo apt-get install apt-transport-https ca-certificates curl software-properties-common
> curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
> sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable"
> sudo apt-get update
> apt-cache search docker-ce
This should produce the following output:
> docker-ce - Docker: the open-source application container engine
Then run
> sudo apt-get install docker-ce
After docker is installed, run:
> docker run -t --name db -p 8091-8094:8091-8094 -p 11210:11210 couchbase/server-sandbox:5.5.0
This will download and run docker image in data persistence mode.
After the command completes, you can access couchdb from localhost:8091
The initial username is Administrator
and password is password
Navigate to the Buckets
section from the side menu, and look for two buckets that should exist:
- auth (100mb)
- data (412mb)
If they do not exist, create them.
Next we will need couchbase python dependency. Install it using these commands:
> wget http://packages.couchbase.com/releases/couchbase-release/couchbase-release-1.0-4-amd64.deb
> sudo dpkg -i couchbase-release-1.0-4-amd64.deb
> sudo apt-get update
> sudo apt-get install libcouchbase-dev build-essential python-dev python-pip
> sudo pip install couchbase
For more info on couchbase, check out its documentation
If you are creating the Buckets
yourself, run the following code on the python interactive shell to add username and password:
> python
> from couchbase.cluster import Cluster, PasswordAuthenticator
> cluster = Cluster('couchbase://localhost')
> cluster.authenticate(PasswordAuthenticator('Administrator', 'password'))
> bucket = cluster.open_bucket('auth')
> bucket.upsert('admin', 'admin')