Robert Schäfer 61813c4eb8
refactor(backend): put config into context (#8603)
This is a side quest of #8558. The motivation is to be able to do dependency injection in the tests without overwriting global data. I saw the first merge conflict from #8551 and voila: It seems @Mogge could have used this already.

refactor: follow @Mogge's review

See: https://github.com/Ocelot-Social-Community/Ocelot-Social/pull/8603#pullrequestreview-2880714796

refactor: better test helper methods

wip: continue refactoring

wip: continue posts

continue

wip: continue groups

continue registration

registration

continue messages

continue observeposts

continue categories

continue posts in groups

continue invite codes

refactor: continue notificationsMiddleware

continue statistics spec

followed-users

online-status

mentions-in-groups

posts-in-groups

email spec

finish all tests

improve typescript

missed one test

remove one more reference of CONFIG

eliminate one more global import of CONFIG

fix language spec test

fix two more test suites

refactor: completely mock out 3rd part API request

refactor test

fixed user_management spec

fixed more locatoin specs

install types for jsonwebtoken

one more fetchmock

fixed one more suite

fix one more spec

yet another spec

fix spec

delete whitespaces

remove beforeAll that the same as the default

fix merge conflict

fix e2e test

refactor: use single callback function for `context` setup

refactor: display logs from backend during CI

Because why not?

fix seeds

fix login

refactor: one unnecessary naming

refactor: better editor support

refactor: fail early

Interestingly, I've had to destructure `context.user` in order to make
typescript happy. Weird.

refactor: undo changes to workflows - no effect

We're running in `--detached` mode on CI, so I guess we won't be able to
see the logs anyways.

refactor: remove fetch from context after review

See:

refactor: found an easier way for required props

Co-authored-by: Max <maxharz@gmail.com>
Co-authored-by: Ulf Gebhardt <ulf.gebhardt@webcraft-media.de>
2025-07-03 11:58:03 +02:00
2020-01-15 08:34:49 +01:00
2025-06-19 13:44:02 +00:00
2021-02-25 21:17:51 +01:00
2019-04-12 11:26:13 +02:00
2025-04-16 14:54:44 +02:00
2023-03-20 10:53:00 +01:00
2023-11-18 11:44:17 +01:00
2025-06-19 13:44:02 +00:00
2023-11-21 13:19:09 +01:00

Ocelot.Social

Backend Test CI Webapp Test CI E2E Test CI Build Status Publish MIT License Discord Channel Open Source Helpers

Ocelot.social is free and open source software program code to run social networks. Its development is supported by a community of programmers and interested network operators.

ocelot.social

Our goal is to enable people to participate fairly and equally in online social networks. The equality of opportunity applies both to the fundamental equality of all people and to the possibility of letting their diverse voices be heard.

We therefore consider it desirable that operators offer such networks so that people can choose where they want to be on the move.

Our vision for the future is that at some point it should be possible to link these networks together (ActivityPub, Fediverse) so that users can also connect with people from other networks - for example, by friending them or following posts or other contributions.

If you would like to help set up this capability with us, please contact us.

In other words, we are interested in a network of networks and in keeping the data as close as possible to the user and the operator they trusts.

Screenshots

Post feed

Check out more screenshots here.

Features

Ocelot.social networks features:

  • news feed
  • posts
  • as articles and events
  • comments
  • filter
  • search
  • groups
  • map
  • user accounts
  • user roles
  • make your own branded network
  • and more …

Check out the full feature list.

User Guide and Frequently Asked Questions

In the wiki you can find more information.

Demo

Try out our live demo network, see here.

Help us

If you're wondering how you could help, there are plenty of ways, e.g.:

Donate

Your donation is very welcome and helps to enhance and improve the network. This software is mostly developed and maintained by the association busFaktor() e.V. . Please support us with a donation to busFaktor() e.V. . Thanks a lot! ❤️

Contact

Are you interested in operating your own ocelot.social network or becoming a user? Please contact us here:

For Developers and Contributors

Introduction

Have a look into our short video: ocelot.social - GitHub - Developer Welcome - Tutorial (english)

Directory Layout

There are three important directories:

  • Backend runs on the server and is a middleware between database and frontend
  • Frontend is a server-side-rendered and client-side-rendered web frontend
  • Cypress contains end-to-end tests and executable feature specifications

In order to setup the application and start to develop features you have to setup webapp and backend.

There are two approaches:

  1. Local installation, which means you have to take care of dependencies yourself.
  2. Or install everything through Docker which takes care of dependencies for you.

Installation

Clone the Repository

Clone the repository, this will create a new folder called Ocelot-Social:

Using HTTPS:

$ git clone https://github.com/Ocelot-Social-Community/Ocelot-Social.git

Using SSH:

$ git clone git@github.com:Ocelot-Social-Community/Ocelot-Social.git

Change into the new folder.

$ cd Ocelot-Social

Live Demo and Developer Logins

Try out our deployed development environment.

Visit our staging networks:

Login

Logins for the live demos and developers (local developers after the following installations) in the browser:

email password role
user@example.org 1234 user
moderator@example.org 1234 moderator
admin@example.org 1234 admin

Docker Installation

Docker is a software development container tool that combines software and its dependencies into one standardized unit that contains everything needed to run it. This helps us to avoid problems with dependencies and makes installation easier.

General Installation of Docker

There are several ways to install Docker on your computer or server.

Check the correct Docker installation by checking the version before proceeding. E.g. we have the following versions:

# use Docker version 24.0.6 or newer
# includes Docker Compose
$ docker --version
Start Ocelot-Social via Docker Compose

ATTENTION: For using Docker commands in Apple Silicon environments see here.

Prepare ENVs once beforehand:

# in folder webapp/
$ cp .env.template .env

# in folder backend/
$ cp .env.template .env

For Development:

```bash
# in main folder
$ docker compose up

For Production:

# in main folder
$ docker compose -f docker-compose.yml up

This will start all required Docker containers.
Make sure your database is running on http://localhost:7474/browser/.

Prepare database once before you start by running the following command in a second terminal:

# in main folder while docker compose is up
$ docker compose exec backend yarn run db:migrate init
$ docker compose exec backend yarn run db:migrate up

Then clear and seed database by running the following command as well in the second terminal:

# in main folder while docker compose is up
$ docker compose exec backend yarn run db:reset
$ docker compose exec backend yarn run db:seed

For a closer description see backend.
For a full documentation of the Docker installation see summary.

Local Installation

For a full documentation of the local installation see summary.

Contributing

Choose an issue (consider our label good-first-issue) and leave a comment there. We will then invite you to join our volunteers team. To have the necessary permission to push directly to this repository, please accept our invitation to join our volunteers team, you will receive via the email, Github will send you, once invited. If we did not invite you yet, please request an invitation via Discord.

We are happy if you fork our repository, but we don't recommend it for development. You do not need a fork.

Clone this repository locally as described above, create your branch named <issue-number>-<description>, add your code and push your branch direct to this repository. Then create a PR by comparing it to our master.

!!! Be aware: Please don't compare from a fork, because the tests are breaking caused by credential problems.

Please run the following commands before you push:

# in folder backend/
$ yarn lint --fix
$ yarn test
# in folder webapp/
$ yarn lint --fix
$ yarn locales --fix
$ yarn test

Check out our contribution guideline, too!

Developer Chat

Join our friendly open-source community on Discord 😻 Just introduce yourself at #introduce-yourself and mention a mentor or @@Mentors to get you onboard 🤓

We give write permissions to every developer who asks for it. Just text us on Discord.

Deployment

Deployment methods can be found in our deployment folder described in the README. Our branding template is our stage.ocelot.social repository. Place your branding repository inside deployment/configurations.

The only deployment method in this repository for production purposes is Kubernetes for now. But we just started to develop a deployment for Docker Compose as well.

The only deployment method with branding in this repository for development purposes as described above is Docker Compose:

# in folder deployment/
# set your branding folder name in .env
# then run
$ docker compose up

The code is branded automatically. To setup the Neo4j database see above.

Technology Stack

For Testing

Attributions

Locale Icons made by Freepik from www.flaticon.com is licensed by CC 3.0 BY.

Browser compatibility testing with BrowserStack.

BrowserStack Logo

License

See the LICENSE file for license rights and limitations (MIT).

Languages
TypeScript 36%
JavaScript 20.4%
Vue 19.2%
HTML 18.3%
SCSS 4.6%
Other 1.4%