Skip to content
This repository was archived by the owner on Jan 17, 2022. It is now read-only.

danjac/localhub

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4,460 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Concept

Open source, small footprint social network platform.

Tech

Python/Django, Docker, PostgreSQL, Redis, Turbolinks, Stimulus, Tailwind.

The architecture and philosophy of the design and implementation are based on the idea of the "web pyramid" outlined for example here: https://docs.tildes.net/philosophy/site-implementation. While Javascript is required for some interactive functionality and a better subjective performance, the site is rendered in plain HTML enhanced with JS and CSS. Turbolinks provides smoother navigation without full page reloads and Stimulus adds discrete Javascript enhancement to the markup without requiring the cognitive and performance load of a full Single Page Application.

License

Localhub is licensed under the GNU Affero Public License. A copy of the license is provided in this repository.

Credits

Favicon: https://www.iconfinder.com/3ab2ou (Creative Commons Attribution)

Development

You should have docker and docker-compose installed on your development machine.

Copy the file .env.sample to .env and edit the values as needed.

To start up the development environment:

./docker-compose up [-d]

You should be able to see the site on http://localhost in your browser.

To run Django management commands through docker:

./scripts/manage [...]

When starting a new environment you should create a default community. First create a superuser:

./scripts/manage createsuperuser

You can then create a new community in the Django admin, or use the command line:

./scripts/manage createcommunity localhost MyCommunityName --admin=username

"username" here can be the superuser, a user you have registered in the sign up page, or one you have created in the Django admin. In general it's best to only create a superuser for Django admin access and create a separate user for community management.

To run unit tests using pytest:

./scripts/runtests [...]

See pytest and pytest-django documentation for more information:

https://docs.pytest.org/en/stable/getting-started.html

https://pytest-django.readthedocs.io/en/latest/

Deployment

Localhub is currently configured to deploy to Heroku. A PostgreSQL and Redis buildpack are required to run the Heroku instances. Production emails require Mailgun. Assets and user uploaded media share a single S3 bucket.

You will need to add a number of environment variables in your Heroku dashboard settings panel:

To set up Heroku containerized deployment:

heroku stack:set container

Assuming "localhub" is the name of your Heroku instance:

heroku git:remote -a localhub

Next, copy .env.example to .env and add your AWS, Heroku, and other secret keys.

To deploy master branch to Heroku and S3:

./scripts/deploy

Note that your local .env AWS settings should be the same as in production, so that the deployment script can push static assets to the same S3 bucket.

Once you have deployed for the first time to your Heroku instance, you can set up an admin user and communities:

heroku run -a localhub ./manage.py createcommunity domain name --admin=...

Each community should have its own domain. You need to configure Heroku and your DNS accordingly. If you want to use a wildcard with multiple subdomains, each community still requires the full domain e.g. demo.localhub.social, ourclub.localhub.social.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors