Code Monkey home page Code Monkey logo

8by8-challenge's Introduction

8by8 Challenge

Welcome to the repository for the 8by8 Challenge! The 8by8 Challenge is a web application intended to foster civic engagement by allowing users to perform various actions such as registering to vote or signing up for election reminders in exchange for badges. Users can also share their challenge with friends via social media. When an invited user registers to vote, or takes another similar action, the inviter also receives a badge. When a user receives 8 badges within 8 days, they have completed their challenge and will earn a reward.

Currently, we are working on migrating the existing application to Next.js and TypeScript, as well as fixing bugs, improving accessibility, etc. For the existing application's source code, please visit https://github.com/8by8-org/web-app.

Requirements

You must have Node.js version 18.17+. Docker is strongly recommended for local development with Supabase, but you may also create your own Supabase project if you cannot install Docker.

Getting Started

To run the application locally, fork the repository and clone the fork to your machine. In the terminal, navigate into the project directory and run npm install. This will install the project's dependencies.

Copy the contents of .env.example into a file named .env.

Replace the values of the variables inside .env with appropriate entries. Values for turnstile keys can be found here: https://developers.cloudflare.com/turnstile/troubleshooting/testing/

Values for Supabase variables will be displayed in the terminal after running either npm run supabase-dev:start or npm run supabase-test:start. These values will be the same for both commands, and will be the same each time you run these commands.

Run the script 'npm run create-symlink-supabase-to-src'. This will create a symlink between supabase/migrations and src/__tests__/supabase/migrations. Note, if you are a windows user, you may have to run the command prompt as an administrator to run the script.

Selenium Tests

Prerequisites

  • Python: Ensure Python is installed on your system. Documentation.
  • Selenium: Python package for browser automation. Documentation.
  • Pytest: Python package for unit testing. Documentation.
  • Drivers: Included with Selenium version 4.6.0 and higher. Documentation.

Setup Instructions

Python Version

While our project can run on different versions of Python, it is best practice to use Python 3 for better performance, security, and compatibility with modern libraries and frameworks.

Installing Python 3

If you do not have Python 3 installed, you can download it from the official Python website.

python --version

Note

The command to run Python might be python3 on some systems (like Ubuntu and WSL), while in other environments it might just be python. Please adjust the commands accordingly based on your environment.

Systems using Python 3

  • Ubuntu (including WSL)
  • CentOS/RHEL (recent versions)
  • Fedora
  • macOS (often default)

Systems using Python (depends on configuration)

  • Older Linux distributions (e.g., Ubuntu 12.04, CentOS 6)
  • Conda Environments
  • Docker Containers

1. Create Virtual Enviornment

python3 -m venv venv

2. Activate Virtual Enviornment

macOS source venv/bin/activate

Windows venv\Scripts\activate

Linux source venv/bin/activate

3. Installing Selenium

Selenium does not need to be installed on a per-project basis. To see if you already have it installed, you can run the following command:

pip show selenium

If installed, it will print information about the package. If the version is less than 4.6.0, you should update it by running:

pip install -U selenium

Otherwise, you can install it by running the following command:

pip install selenium

For more information on installing Selenium, see this.

For information on upgrading Selenium, see this.

4. Installing pytest

Be sure to install pytest:

pip install pytest

5. Before Running Selenium Tests

To ensure that Selenium tests run efficiently, it is recommended to first compile your project using npm run build. This step improves performance by compiling and optimizing the code, which can make the tests smoother.

I. Build the Project:

npm run build

II. Start Development Server:

npm run start

7. Run the tests

To run the Selenium tests, navigate into src/__tests__/e2e and run python3 -m pytest.

Contributing

New engineers should review CONTRIBUTING.md for details about the recommended workflow and tools.

Resources

8by8-challenge's People

Contributors

ris345 avatar dvorakjt avatar jyyhuang avatar ishanbhatbhardwaj avatar captainextremis avatar xiaoshaotongzhi avatar mazharulislam-naim avatar noreen1423 avatar

Stargazers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.