A location-based social network.
Warning
This project is under active development and is not yet ready for production use.
- Install dependencies
- Clone the repository:
git clone https://github.com/ColoradoSchoolOfMines/beacon.git
- Inside the repository, install the dependencies:
npm install
- If you want to run Supabase locally, start the Docker container:
# This can take a while the first time you run it because it has to download a bunch of Docker images
npm run supabase:start
# Check the status of the Supabase (Including the dashboard URL and mock email server URL)
npm run supabase:status
-
Update
.env
with the appropriate values (See Frontend Environment Variables). -
Still inside the repository, start the development server:
npm run dev
-
Open
http://localhost:3000
in your browser to access the frontend -
If running Supabase locally, reset the database after each schema change:
npm run supabase:reset
To build the frontend for production, run:
docker build -t beacon -f Dockerfile .
To run the frontend in production, run:
docker run -p 80:8080 beacon
Development Name (i.e.: not in the container) | Production Name (i.e.: in the container) | Description | Default/Required |
---|---|---|---|
VITE_HCAPTCHA_SITE_KEY |
CADDY_HCAPTCHA_SITE_KEY |
The hCaptcha site key | Required ( |
VITE_SUPABASE_URL |
CADDY_SUPABASE_URL |
The absolute Supabase API URL | Required (Automatically set by the setup script) |
VITE_SUPABASE_ANON_KEY |
CADDY_SUPABASE_ANON_KEY |
The Supabase API anonymous key | Required (Automatically set by the setup script) |
VITE_SENTRY_DSN |
CADDY_SENTRY_DSN |
The Sentry DSN | Optional (Automatically set by the setup script) |
- Frontend
- Language: TypeScript
- Web framework: React + Vite
- Component library: Ionic React
- Styling: UnoCSS (Wind preset) (Tailwind/WindiCSS compatible)
- Backend: Supabase
Beacon's ranking algorithm is somewhat inspired by the Lemmy algorithm, but has the following properties:
Description | Reasoning |
---|---|
Quadratic distance contribution | Posts that are closer to the user should have a higher rank. This helps users see posts that are more geographically relevant to them. |
Logarithmic score contribution | The first |
Exponential age reduction | The older a post is, the less relevant it likely is. This helps newer posts rank higher. |
The algorithm is as follows:
with the following variables:
Name | Definition | Min value | Default value | Max value |
---|---|---|---|---|
Integer post sorting order (Higher will be sorted first) | - | - | - | |
Ranking scale factor (To allow the rank to be rounded) |
|
- | ||
Distance between the post and the user's location (In meters) | - | - | - | |
Distance weight factor |
|
- | ||
Maximum distance to be considered (In meters) | ||||
Post upvotes | - | - | - | |
Post downvotes | - | - | - | |
Minimum score threshold considered | - | |||
Post age (In hours) | - | - | - | |
Age weight factor |
|
- |