This project is currently in development. Front end is in React and Backend is Python Flask.
For the Frontend development environment follow the below instructions:
This project uses NodeJS and NPM. To confirm if locally installed, enter into the terminal
node --version
npm --version
If not locally installed, you will need to install these via Homebrew (recommended) or check the links below for alternative download and install methods.
- Install Homebrew via the link above (if you do not have it already)
- Run
brew install node
to install both NodeJS and NPM
- Open the terminal and in the desired directory, and clone this repo to your local machine using the Git CLI.
git clone https://github.com/wwcodecolorado/returnship-project-voting.git
- Once cloned, navigate to the directory
cd returnship-project-voting/client
and pull down the node modules including the dependencies inside the client subdirectory
npm install react-bootstrap
npm install
- Once all developer dependencies are downloaded, you are ready to get started. To start the ReactJS development server,
npm run start
- Visit locally running copy of the ReactJS project at
http://localhost:3000
(or as indicated in the terminal)
Install a recent Python 3 interpreter to run the Flask Backend on. To install Python, go to install Python. To confirm if locally installed, enter into the terminal
python3 --version
Since we want to have both the frontend and backend combined into a single project, Backend is in the top-level subdirectory "api".
- If you haven't cloned the project, open the terminal and in the desired directory, run
git clone https://github.com/wwcodecolorado/returnship-project-voting.git
to clone this project repository to the local machine.
- Once cloned, in the terminal run
cd returnship-project-voting/api
and activate the virtual environment called venv
, by entering (for Unix-based operating systems)
$ source venv/bin/activate
and you will get the terminal as (venv) $
If you are using Windows, then you will do this instead:
$ venv\Scripts\activate
- Now inside the virtual environment
venv
install Flask and other dependencies by following commands
(venv) $ pip install Flask
(venv) $ pip install flask_sqlalchemy
(venv) $ pip install flask_migrate
- To get started,
- in
returnship-project-voting/api
runto start the Flask development server. OR./venv/bin/python3.7 ./app.py
- in
returnship-project-voting/client
runTo stop the Flask server press Ctrl-C.npm run start-api
- Visit api of the project locally at
http://localhost:5000/api/
-
Find a non assigned issue which you want to work and self assign your name.
-
Follow the steps Prerequisites and Project Setup.
-
Before making any changes, create a branch in your name with issue number.
git branch [your-feature-branch-name]
-
Open the source code and start editing/coding!
-
Updating your feature branch to latest master changes: If you have your branch created for a while now, you may need to update it to what master has currently to avoid conflicts as you push/ commit your changes. You can skip this if you are just starting out.
Follow these git commands or this summary:
git checkout master
git fetch -p origin
git merge origin/master
git checkout [your-feature-branch-name]
git merge master
git push origin [your-feature-branch-name]
- Once you finish making changes, push your commit to your branch and do a pull request on master. (starting on your-feature-branch-name)
# get a list of all the updated, added and deleted files.
git status
# add changes to stage for commit ,or use git add file_path
git add .
# commit your code to your branch
git commit -m “commit message”
# Upload all local branch commits to GitHub and create upstream branch
git push -u origin [your-feature-branch-name]
# or if your upstream branch already exists you can just do
git push
Then go to Github and click the 'Create Pull Request' button and assign a reviewer.
- After reviewing, your changes will be merged to the master branch.🎉 🎉 🎉
To install Flask, enter into the terminal
pip install flask python-dotenv