Giter Site home page Giter Site logo

glee2429 / cs561_f20_swe Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 5.87 MB

CS 561 Software Engineering Methods - Stock Portfolio Management App Codebase

Python 99.42% CSS 0.12% HTML 0.15% PowerShell 0.10% Shell 0.04% C 0.11% JavaScript 0.07% Mako 0.01%
python virtual-environments flask stock-portfolio-management venv

cs561_f20_swe's Introduction

CS561 Software Engineering - Fall 2020

Project: Stock Portfolio Management App

Team: Rohan Borkar, Adam Sunderman, Saurabh Satish Desai, Ga Young Lee

How to Restart & Debug (For returning developers)

Given that you already downloaded the file, go to the directory and activate the virtual environment designed for development.

  1. Activate the virtual development
$ source venv/bin/activate
  1. Install the Python packages specified in requirements.txt (Please make sure to double-check the version and dependencies)
(venv)$ pip install -r requirements.txt
  1. Designate the script to run and specifications to run the program
(venv)$ export FLASK_APP=app.py
(venv)$ export FLASK_ENV=development
  1. Create the tables (e.g., stocks, users) in the SQLite database in your virtual environment.
(venv)$ flask shell
Start by importing the database object and then create the database table using create_all:
>>> from project import database
>>> database.create_all()
>>> quit()
  1. Once the above steps are done, run the flask app in the development server
(venv)$ flask run

How to Get Started (For new developers)

  1. Download the file and unzip it.
  2. Create a directory.
$ mkdir stock-portfolio-management
$ cd stock-portfolio-management
  1. Check out the Python version installed. Ideally, Python 3.8.x is recommended in this project.
$ python3 --version
Python 3.8.5

Virtual Environment for Development

  1. Virtual environments create an isolated configured setting for each project. In Python 3, a built-in module venv can be used for creating a virtual environments by running the command below.
$ python3 -m venv venv

This command creates a folder "venv" that includes a Python interpreter and scripts for activating/deactivating the virtual environment.

(You can also learn more about the importance of virtual environments in Python here: https://realpython.com/python-virtual-environments-a-primer/)
  1. Start your virtual environment by following the command.
$ source venv/bin/activate
(venv) $

Then, you can find (venv) to the left of the prompt which indicates your virtual environment is successfully activated.

Package Installation Using pip

Now that your virtual environment is created and activated, let's install the necessary packages for the project using pip.

  1. First, let's start with Flask.
(venv) $ pip install flask

This command installs the package and dependencies, such as other packages required for Flask.

  1. Save the requirements for future use by using the commands below.
(venv)$ pip freeze

click==7.1.2
Flask==1.1.2
itsdangerous==1.1.0
Jinja2==2.11.2
MarkupSafe==1.1.1
Werkzeug==1.0.1

Once the requirements for the project are returned in terminal, you can save them in txt file.

(venv)$ pip freeze > requirements.txt

Development Server Setup Using Flask

Flask offers development servers that comes with the package. In order to use this mode, we need to specify that the target we're interested in is app.py and specify that the server is in development mode by using the commands below.

(venv) $ export FLASK_APP=app.py
(venv) $ export FLASK_ENV=development

Finally, let's run your Flask app on your local server!

Use the command below and go to http://127.0.0.1:5000/ to check out your Flask app on your local server.

(venv) $ flask run

 * Serving Flask app "app.py" (lazy loading)
 * Environment: development
 * Debug mode: on
 * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
 * Restarting with stat
 * Debugger is active!
 * Debugger PIN: ***-***-***

cs561_f20_swe's People

Contributors

adamsunderman avatar brohan203 avatar glee2429 avatar

Stargazers

 avatar

Watchers

 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.