=======================
cd ~
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
brew install python
curl https://bootstrap.pypa.io/get-pip.py
(For instructions installing it locally, see: https://github.com/ekalinin/nodeenv):
sudo -H pip3 install nodeenv
If you are already using Node and npm, confirm that your installation is at least at these minimum versions:
node -v
(Should show this or higher: v22.11.0)
npm -v
(Should show this or higher: 10.9.0)
(If you want to have a fresh install of Node you can brew unlink node
first.)
A fresh or initial install of Node, will automatically install the latest version of npm.
brew install node
node -v
npm -v
We recommend installing it away from the WebApp source code:
mkdir ~/NodeEnvironments/
cd ~/NodeEnvironments/
nodeenv WeConnectEnv
cd ~/NodeEnvironments/WeConnectEnv/
. bin/activate
Save to a notepad you can use every day you start programming, and capture these commands, customized for your machine:
cd ~/NodeEnvironments/WeConnectEnv/
. bin/activate
cd ~/WebstormProjects/weconnect-server
cd ~/WebstormProjects/
git clone https://github.com/wevote/weconnect-server.git weconnect-server
cd weconnect-server
npm install
For me, the command to start postgres is...
pg_ctl -D /opt/homebrew/var/postgres -l /opt/homebrew/var/postgres/server.log start
Use pgAdmin4 to create the WeConnectDB database on the existing server (Not sure if this is necessary Prisma might do this for you)
Nov 22, 2024: I'm unsure of these steps -- need to test them on a new Mac. See InitialSetupSteps.md
npx prisma init
npx prisma db push
cd ~/WebstormProjects/weconnect-server
cp .env.config-template .env.config
Then open .env.config in WebStorm (or any editor)
Configure your DATABASE_URL in '.env.config' by making the appropriate substitutions to ...
DATABASE_URL=postgresql://{youruserloginname}:{yourloginpassword}@localhost:5432/WeConnectDB?schema=public
Here is a filled in example:
DATABASE_URL=postgresql://jerrygarcia:jerryspassword@localhost:5432/WeConnectDB?schema=public
node app.js
You can use the excellent debugger within the WebStorm IDE if you make a run configuration.
All you need to fill in is the name field, and the JavaScript field, as shown in the screen shot above.
Mad respect to Hackathon Starter
The MIT License (MIT)
Copyright (c) 2024 We Vote USA Forked from Hackathon Starter Copyright (c) 2024 Sahat Yalkabov
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.