Skip to content

A Chrome/Firefox extension that encourages studying and productivity through combining Tamagotchi-style pet mechanics and gachapon/gambling!

License

Notifications You must be signed in to change notification settings

ufosc/Studygatchi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Table of Contents

Coming soon!

Contributing

Setup

To setup the project, first fork the OSC repo. Then clone: sh # To clone git clone https://github.com/[INSERT YOUR GITHUB USERNAME HERE]/Studygatchi.git

Frontend

Prerequisites

Make sure you have Node.js (version 18+ or 20+) installed on your machine.

Setup

  1. Install the dependencies:

    cd Studygatchi/frontend
    npm install

Development

Start the development server:

npm run dev

Inside your terminal, enter 'o' to open the project in your browser.

Build

To create a production build for later importation as a Chrome extension:

npm run build

This will generate the build files in the build directory.

Load Studygatchi in Chrome

  1. Open Chrome and navigate to chrome://extensions/.
  2. Enable "Developer mode" using the toggle switch in the top right corner.
  3. Click "Load unpacked" and select the build directory.

Project Structure

  • public/: Contains static files and the manifest.json.
  • src/: Contains the React app source code.
  • vite.config.ts: Vite configuration file.
  • tsconfig.json: TypeScript configuration file.
  • package.json: Contains the project dependencies and scripts.

Backend (Windows/Linux)

Prerequisites

This guide expects that you have Python (At least 3.12.0) installed.

Setup

  1. Create the venv

    cd Studygatchi
    python -m venv env

    To activate the venv:

    • On Windows PowerShell:
    ./env/Scripts/Activate.ps1
    • On Windows Command Prompt:
    ./env/Scripts/activate.bat
    • On Linux:
    source ./env/bin/activate
  2. Run the following commands to install Django and the Django Rest Framework:

    pip install django
    pip install djangorestframework
  3. Install PostgreSQL (version 17) (THIS WILL TAKE A LONG TIME)

  4. Activate the venv (if it's not already active) using the corresponding command and install psycopg2

    pip install psycopg2-binary

    We will use this to be able to connect Django with Postgres!

  5. Access the PostgreSQL shell, logged in as the superuser:

    cd <directory you installed it to>/17/bin
    psql -U postgres

    When prompted for a password, use the password you put in the install wizard.

  6. Run the following SQL commands:

    CREATE USER <myprojectuser> WITH PASSWORD '<your_secure_password>';
    CREATE DATABASE studygatchi_db OWNER <myprojectuser>;
    GRANT ALL PRIVILEGES ON DATABASE studygatchi_db TO <myprojectuser>;
    \q

    Replace <myprojectuser> with whatever username you want, same for the password;

  7. Create a file called settings.py in the backend directory and copy and paste the contents of settings_template.txt into settings.py.

  8. In settings.py, go to where it says DATABASES, and insert your info from step 6 into the corresponding places.

  9. Run the following commands with the venv active to apply migrations:

    python manage.py makemigrations
    python manage.py migrate
  10. Test the connection by running this command:

    python manage.py runserver

    If it all goes well, cool stuff, it's working!

Backend (Mac)

Prerequisites

This guide expects that you have Python (At least 3.12.0) installed.

If Python was installed via either Homebrew or the official Python installer, you may need to use python3 and pip3 instead for the terminal to work.

Setup

  1. Create the venv

    cd Studygatchi
    python3 -m venv env

    To activate the venv:

    source /env/bin/activate
  2. Run the following commands to install Django and the Django Rest Framework:

    pip3 install django
    pip3 install djangorestframework
  3. Install PostgreSQL (version 17) (THIS WILL TAKE A LONG TIME)

  4. Activate the venv (if it's not already active) using the corresponding command and install psycopg2

    pip3 install psycopg2-binary

    We will use this to be able to connect Django with Postgres!

  5. Create a database for Studygatchi

    createdb studygatchi_db
  6. Access the PostgreSQL shell, logged in as the superuser:

    cd <directory you installed it to>/env/bin
    psql

    6a. If psql is not found, try this solution

    brew install pgcli
    brew link --force libpq
  7. Run the following SQL commands:

    CREATE USER <myprojectuser> WITH PASSWORD '<your_secure_password>';
    CREATE DATABASE studygatchi_db OWNER <myprojectuser>;
    GRANT ALL PRIVILEGES ON DATABASE studygatchi_db TO <myprojectuser>;
    \q

    Replace <myprojectuser> with whatever username you want, same for the password;

    Use quit to exit the PostgreSQL shell;

  8. Create a file called settings.py in the backend directory and copy and paste the contents of settings_template.txt into settings.py.

  9. In settings.py, go to where it says DATABASES, and insert your info from step 7 into the corresponding places.

  10. Run the following commands with the venv active to apply migrations:

    python3 manage.py makemigrations
    python3 manage.py migrate
  11. Test the connection by running this command:

    python3 manage.py runserver

    If it all goes well, cool stuff, it's working!

About

A Chrome/Firefox extension that encourages studying and productivity through combining Tamagotchi-style pet mechanics and gachapon/gambling!

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 8