Giter VIP home page Giter VIP logo

env-setup-instructions's Introduction

Environment Setup Instructions

Sample instructions for setting up dependencies and installs.

Software Stack

Purpose Technology
Development Language Text
Web Framework Text
Testing Framework Text
Continuous Integration (Testing) Text
Database Text
Deployment Text

Setup Instructions

Codebase

Clone the repository and navigate into the directory:

git clone https://URL.git
cd REPO/

Android

Install Android Studio and import the project.

Google Maps API Key

Generate a Google Maps SDK API key (step 1).

Duplicate the Google Maps API key template file to hold the API key:

cp Rebuild/app/src/debug/res/values/google_maps_api_template.xml Rebuild/app/src/debug/res/values/google_maps_api.xml

cp Rebuild/app/src/release/res/values/google_maps_api_template.xml Rebuild/app/src/release/res/values/google_maps_api.xml

Choose the debug/ folder for development, or the release/ folder for release.

In the new file google_maps_api.xml, uncomment the line with the key and replace the value of the placeholder with your API key. This new file will not be tracked by Git.

Build and run the Android application on a physical or virtual device.

Creating a Production Release

Step 1: Building a Release Variant

Create a new file in the root directory to hold the secure keystore details:

cp keystore.properties.template keystore.properties

This file will be ignored by Git. Set your keystore information in this file.

Under Build, click Select Build Variant.

In the Build Variants view which appears, change the Active Build Variant from debug to release.

Build the application normally to your phone. The keystore credentials will be verified and applied.

Step 2: Creating the Signed App

Under Build, click Generate Signed Bundle / APK.

Follow the instructions, inputting your keystore path and credentials, to create a signed app which can be uploaded to the app store.

Heroku

Install the Heroku command line interface by following these instructions.

Login to Heroku:

heroku login

Create a Heroku application with your preferred app name:

heroku apps:create APPNAME

Angular

Install Node.js (which comes with NPM).

Install the required NPM dependencies:

npm install

Install the Angular command-line interface:

npm install -g @angular/cli

To start up the website locally, run:

ng serve

The app will automatically reload if you change any of the source files.

Deployment

To build the website generically for deployment, run:

ng build

Golang

Install Golang.

Setup the dependencies:

go get -t ./...

Build the server:

go build

Run the executable:

,/EXEC

Node.js

Install Node.js (which comes with NPM).

Install the necessary NPM packages:

npm install

Start the server locally:

npm start

Google Sheets

Follow these instructions to create a new Google Cloud Platform project and enable the Google Sheets API.

Download the Client JSON file and rename it to credentials.json. Place it in this directory (it will be ignored by Git).

Start the server locally:

npm start

Google will guide you through a process to authenticate the server. This will only occur the first time.

Deployment (Heroku)

After creating the Google Cloud Platform project in Setup above, create a new set of credentials for the Service Account. Download the secret file and keep it safe.

Create a Heroku application with whichever method you prefer. In your deployment environment, set the following environment variables using values from the secret file:

Environment Variable Value from Service Account Credentials
GOOGLE_CLIENT_EMAIL client_email
GOOGLE_PRIVATE_KEY private_key

Ensure that the client email has access to the Sheet; share access to it manually if necessary.

pdfTeX

Required packages: texlive texlive-bibtex-extra texlive-publishers

Install the required packages:

sudo apt-get install texlive

To build the output PDF, run pdfTeX twice:

pdflatex $FILENAME
pdflatex $FILENAME

pdfTeX With a Bibliography

Install the required packages:

sudo apt-get install texlive-bibtex-extra texlive-publishers

Build the bibliography (the .bib file):

bibtex $FILENAME

Then build the output PDF again, twice:

pdflatex $FILENAME
pdflatex $FILENAME

Python

If Python 3 is not yet installed, then install the relevant packages:

sudo apt-get install python3 python3-pip

Install the PIP dependencies:

pip3 install PACKAGES
pip3 install -r requirements.txt

Virtualenv (Optional: Isolated Environment for Python packages)

Install Virtualenv and create an environment named venv (or any name you prefer) within your project directory:

pip3 install virtualenv
cd PROJECT_DIR/
virtualenv venv

Before installing any other packages from the project, activate the virtual environment to isolate your environment for all following commands:

source venv/bin/activate

If on Windows, run the script directly instead:

./venv/Scripts/activate

Run all Python and PIP commands here.

To deactivate the isolated virtual environment and return to the original environment, either close the console window or run the following command:

deactivate

Flask

Flask is installed by the PIP commands above.

For all following commands, flask can be replaced with python3 -m flask if the Flask executable is not available.

Migrate the database to the newest version:

flask db upgrade

Start the server with either one of the following commands:

python3 app.py

flask run

The server will be available on port 5000 (http://127.0.0.1:5000).

MySQL

Install MySQL.

Configure access to the root account on MySQL so that you can login with the following command:

mysql -u root -p YOUR_PASSWORD_HERE

Exit the MySQL prompt by typing:

exit

For reference, see this sample guide from DigitalOcean for Debian-based systems.

Yarn (with React)

Install Yarn.

Install the necessary packages:

yarn install

Start the server locally:

yarn start

The server will be available on port 3000 (http://127.0.0.1:3000).

Deployment

To build deployable files, edit the value homepage in package.json to be the URL where the web application will be hosted, so that the page can resolve the correct URL to its resources.

Build the files:

yarn build

The completed files will be ready for deployment at directory build/.

env-setup-instructions's People

Contributors

jleung51 avatar

Watchers

James Cloos avatar  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.