bonniedotdev
bonniedotdev copied to clipboard
code for the https://bonnie.dev website
bonniedotdev
Code for https://bonnie.dev
License
GNU AFFERO GENERAL PUBLIC LICENSE
Installation for Development
Environment variables
$ cp dotenv_template .env- Fill out your environment variables
- for development, the value of
FLASK_ENVshould bedevelopment
- for development, the value of
Client
$ cd client$ npm install$ npm run dev:build
Server
$ pip install pre-commit# if you don't have it installed globally$ cd server- Create and activate a virtual env
$ pip install -r requirements.txt$ pre-commit install
Building the Client for Production
After changes, you can re-build the client with:
$ cd client$ npm run buildpostbuild.shwill run automatically to move files to the correct place in app
Start up
-
$ cd server -
$ source .env && python server.py -
Note: You will need to re-run
npm run dev:buildupon changes to client
Testing
Client
$ cd client$ npm test
Server
$ cd server$ source .env$ chmod +x ./run_tests.sh(make the file executable)$ ./run_tests.sh
Deploying
Deploying client
- Build the client
$ cd client$ npm run buildpostbuild.shwill run automatically to move files to the correct place in app
- Upload the build
$ bash server/scripts/upload_build.sh
- log on to aws lightsail and run post-upload script
- locally:
bdd-ssh - on lightsail:
~/bonniedotdev/server/scripts/bdd-postupload.sh
Deploying server
- log on to lightsail
- locally:
bdd-ssh
- Pull from GitHub
- on lightsail:
git pull origin main
- Update db if applicable
- on lightsail:
~/bonniedotdev/server/scripts/update_db.sh
- Restart server
- on lightsail:
~/bonniedotdev/server/scripts/restart_server.sh