elabbit / sidekick

0 stars 0 forks source link

Sidekick

Welcome to Sidekick, your trusty Pokemon companion on your journey to becoming the best version of yourself! With Sidekick, you'll embark on an epic adventure of self-improvement, unlocking new Pokemon and achieving your goals along the way.

Sidekick is more than just a habit tracking and to-do list app - it's a Pokemon adventure! As you use the app and stay consistent with your goals, you'll earn points that you can use to unlock new Pokemon and level up your team.

But that's not all - Sidekick is also a powerful productivity tool, designed to help you stay organized, motivated, and on track. With custom habit trackers, to-do lists, and reminders, you'll never miss a beat as you work towards your goals.

Running the application locally

  1. Clone this repository (only this branch)

    git clone https://github.com/elabbit/sidekick.git
  2. Install dependencies

      pipenv install --dev -r dev-requirements.txt && pipenv install -r requirements.txt
  3. Create a .env file based on the example with proper settings for your development environment

  4. Setup your PostgreSQL user, password and database and make sure it matches your .env file

  5. Get into your pipenv, migrate your database, seed your database, and run your flask app

    pipenv shell
    flask db upgrade
    flask seed all
    flask run
  6. To run the React App in development, checkout the README inside the react-app directory.


IMPORTANT! psycopg2-binary MUST remain a dev dependency because you can't install it on alpine-linux. There is a layer in the Dockerfile that will install psycopg2 (not binary) for us.


Dev Containers (OPTIONAL for M1 Users)

The following instructions detail an optional development setup for M1 Mac users having issues with the psycopg package.

  1. Make sure you have the Microsoft Remote - Containers extension installed.

  2. Make sure you have Docker installed on your computer.

  3. Clone the repository (only this branch)

    git clone https://github.com/appacademy-starters/python-project-starter.git
  4. Open the repo in VS Code.

  5. Click "Open in Container" when VS Code prompts to open container in the bottom right hand corner.

  6. Be Patient! The initial install will take a LONG time, it's building a container that has postgres preconfigured and even installing all your project dependencies. (For both flask and react!)

    Note: This will take much less time on future starts because everything will be cached.

  7. Once everything is up, be sure to make a .env file based on .env.example in both the root directory and the react-app directory before running your app. You do not need a DATABASE_URL in the .env file if you are using this Docker setup for development - the URL is already set in the image (see .devcontainer/Dockerfile for the URL).

  8. Get into your pipenv, migrate your database, seed your database, and run your flask app

    pipenv shell
    flask db upgrade
    flask seed all
    flask run
  9. To run the React App in development, checkout the README inside the react-app directory.


Helpful commands

Command Purpose
pipenv shell Open your terminal in the virtual environment and be able to run flask commands without a prefix
pipenv run Run a command from the context of the virtual environment without actually entering into it. You can use this as a prefix for flask commands
flask db upgrade Check in with the database and run any needed migrations
flask db downgrade Check in with the database and revert any needed migrations
flask seed all Just a helpful syntax to run queries against the db to seed data. See the app/seeds folder for reference and more details