2FA Directory is an open-source project that aims to improve online security by providing a directory of websites and services that support two-factor authentication (2FA). Our community-driven platform allows anyone to contribute to the list, making it the most comprehensive directory of its kind.
This repository contains the HTML, JavaScript and CSS for 2fa.directory.
All data used to populate the categories is sourced from 2factorauth/twofactorauth.
- Frontend: HTML, JavaScript, CSS
- Frameworks & Libraries: Preact, HTM, Vite
- Hosting: Cloudflare Pages
To run the site locally, follow these steps:
- Ensure you have Node.js installed (Recommended version: 20.x or higher).
- Clone the repository:
git clone https://github.com/2factorauth/2fa.directory.git cd frontend
- Install NPM packages:
npm install
- Run the site locally:
After running this command, the site will be accessible at http://localhost:5173 (or another port if 5173 is taken).
npm run dev
Note
The region-redirection script does not run locally. You will therefore always be directed to
the international page when using npm run dev
.
If you’d like to deploy your own version of this site, you can use Cloudflare Pages to host it. Here’s how you can publish a fork of this repository:
- Log in to your Cloudflare Dashboard and select "Pages."
- Create a new project and select your fork as the source.
- Configure the build settings:
- Framework preset:
None
- Build command:
npm run build
- Build output directory:
dist
- Framework preset:
- Deploy your project. Once completed, your site will be live on Cloudflare Pages.
Tip
Be sure to update the fork with any new changes from the main repository to keep your version up-to-date.
When contributing changes to this repository, please make sure your IDE follows our editorconfig.
The general file structure is as follows:
Type | Path |
---|---|
JavaScript | src |
CSS | assets/css |
Layout components | src/components |
Translations | data/languages.json |
This project is licensed under the GPLv3. See LICENSE for the full text.
Before you make changes to the code, please keep the following in mind:
- Data License: The data is licensed separately.
- Attribution: If you use this project as a template for your own website, attribution is required.
- License Modifications: The original contents of LICENSE must be retained in distributions and forks, but you are allowed (and encouraged) to prepend your own copyright and GPLv3-compatible license for any changes you make.
For more details on what is and isn't allowed under a GPLv3 license, see this guide.