mustafaDabah / bonniedotdev

code for the https://bonnie.dev website

Home Page:https://bonnie.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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_ENV should be development

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 build
  • postbuild.sh will 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:build upon 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

  1. Build the client
  • $ cd client
  • $ npm run build
  • postbuild.sh will run automatically to move files to the correct place in app
  1. Upload the build
  • $ bash server/scripts/upload_build.sh
  1. log on to aws lightsail and run post-upload script
  • locally: bdd-ssh
  • on lightsail: ~/bonniedotdev/server/scripts/bdd-postupload.sh

Deploying server

  1. log on to lightsail
  • locally: bdd-ssh
  1. Pull from GitHub
  • on lightsail: git pull origin main
  1. Update db if applicable
  • on lightsail: ~/bonniedotdev/server/scripts/update_db.sh
  1. Restart server
  • on lightsail: ~/bonniedotdev/server/scripts/restart_server.sh

About

code for the https://bonnie.dev website

https://bonnie.dev


Languages

Language:TypeScript 61.6%Language:Python 33.9%Language:JavaScript 2.4%Language:Shell 1.2%Language:CSS 0.4%Language:HTML 0.4%