Giter VIP home page Giter VIP logo

lyntr's Introduction

Lyntr.com - the micro-blogging social media with an IQ test

Privacy Policy | Terms of Service | License | YouTube video

Images

Dark mode - Lyntr

Lyntr.com

Light mode - Lyntr

Lyntr.com - white

Self-host

First, we need to setup the .env file with the right secrets.

  • Rename .env.example to .env

Supabase

Firstly we have to setup the database. Head to https://supabase.com and create an account.

New project

Now, click "New project".

New project - 2

For the project name, choose whatever name you wish. For the database password, you could generate a random password or input yours. Make sure to save it. For the region, choose the region closer to your machine.

Then click Create new project. It will take a few minutes, so in the meantime you can copy the secrets.

New project - 3 On this page we can see the Project API keys and Project configuration sections.

  • Copy the anon public secret and put it in your .env:
PUBLIC_SUPABASE_ANON_KEY="ey........................"
  • Copy the Project Configuration > URL:
PUBLIC_SUPABASE_URL="https://.....supabase.co"
  • Copy the Project Configuration > JWT Secret:
JWT_SECRET="..........x............x........."

New project - 4 Now that the Database has been created, click "Connect". New project - 5 Copy the URL and put it in your .env:

DATABASE_URL="postgresql://postgres.USERNAME:PASSWORD/options"

If you clicked Copy on the Connect page, you should already have the USERNAME. Simply replace PASSWORD with the one you put at:

For the database password, you could generate a random password or input yours. Make sure to save it.

Now simply split the DATABASE_URL components:

DB_HOST="LOCATION.pooler.supabase.com" # Change "LOCATION"
DB_USER="postgres.USERNAME" # Change "USERNAME"
DB_PASSWORD="PASSWORD" # Change "PASSWORD"
DB_NAME="postgres" # Can be left like this

New project - 6

Now run the following:

npx drizzle-kit generate
npx drizzle-kit migrate
npx drizzle-kit push

And follow this guide on how to enable the Discord auth in Supabase, until the code part. It should look something like this. image

MinIO

We need Min.io for images. This and the next step can be omitted if you don't need Image support / reporting.

Setup

Install Docker and run the following command:

MINIO_USER=admin MINIO_PASS=admin docker compose up --build -d

โ€ผ This may fail if you haven't followed the Supabase step properly (because the compose.yml file also starts Lyntr in production at 5999 port.)

After that's done, navigate to https://localhost:9001. You will see this.

MinIO - 1 If you followed the Docker command properly, the username and password should both be admin. Log in.

MinIO - 2 Create a bucket.

MinIO - 3 Input a bucket name and click Create Bucket.

And change the .env:

S3_BUCKET_NAME="the_name_you_chose"

MinIO - 4 Now navigate to "Access Keys" and click "Create Access key" MinIO - 4 Simply copy the Access key and Secret key and update your .env accordingly:

MINIO_ACCESS_KEY="first_field"
MINIO_SECRET_KEY="second_field"

Then click "Create".

Great, now we have to make the bucket public so we can access it at http://localhost:9000/lyntr/ without a token.

Run this:

docker exec -it minio sh -c "mc alias set myminio http://localhost:9000 "admin" "admin" && mc anonymous set public myminio/lyntr"

And you're good to go! You can now simply go to http://localhost:5999 to access Lyntr locally, or run npm i && npm run dev in your terminal for dev mode and access it at http://localhost:5173/.

If you wish to get Reporting to work, follow the last step.

Discord

  • Create a Discord bot and copy the token.
  • Create a Discord server and invite the bot there.
  • Create a Channel and copy its ID.
  • Create a Role, give it to yourself, and copy its ID.

Now update the .env:

DISCORD_BOT_TOKEN="discord.token.here"
DISCORD_CHANNEL_ID="channel.id.here"
ADMIN_KEY="can.be.anything.just.make.sure.its.secure"
SUDO_USER_ID="your.lyntr.account.id" # Create a Lyntr account and copy its ID. If this field won't be filled, your bot will fail to fetch `api/lynt` at GET for info on report. Check the Network tab for the `api/me` request and copy the ID it returns.

DISCORD_ADMIN_ROLE="your.admin.role"

Contributing

If you wish to contribute, you are free to do so. Please keep in mind:

  • Don't open pull requests that simply fix grammatical issues or such. Open an issue instead.
  • Don't modify the IQ test unless it's a bug fix.
  • Don't submit "troll" pull requests.
  • Don't submit pull requests that rewrite a part of the project. Please create a GitHub issue and ask if such a rewrite is welcome before starting.

License

This project is licensed under Attribution-NonCommercial 2.0 International.

You are free to:

๐Ÿ“ฉโœ… Share โ€” copy and redistribute the material in any medium or format

๐Ÿ”โœ… Adapt โ€” remix, transform, and build upon the material

The licensor cannot revoke these freedoms as long as you follow the license terms.

Under the following terms:

๐Ÿ‘คโœ… Attribution โ€” You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.

๐Ÿ’ตโŒ NonCommercial โ€” You may not use the material for commercial purposes.

๐Ÿ“œโŒ No additional restrictions โ€” You may not apply legal terms or technological measures that legally restrict others from doing anything the license permits.

Please refer to CC BY-NC 2.0 for more information.

Created by FaceDev

lyntr's People

Contributors

face-hh avatar linker-123 avatar xyzeva avatar gstudiosx2 avatar realpacket avatar nobrehd avatar smartlinuxcoder avatar myra1337 avatar bloeckchengrafik avatar codename-anti avatar palmdevs avatar darkenedring avatar kremec 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.