An open API service indexing awesome lists of open source software.

https://github.com/maur1th/naxos-forum

Django-based bulletin board
https://github.com/maur1th/naxos-forum

Last synced: about 1 year ago
JSON representation

Django-based bulletin board

Awesome Lists containing this project

README

          

# Naxos-Forum

## Purpose

Bulletin board project created to replace a [CoolForum](https://github.com/dsoriano/coolforum) solution. (Including DB migration script.) Comes with a light community blog.

Made in Python 3. Backend mostly based on Django, PostgreSQL and memcached. Frontend in BootStrap + JQuery. Node.js + Socket.io for some realtime capabilities. Deploys with Docker & Ansible.

## Getting started

### Prerequisite

Install [Docker](https://www.docker.com/community-edition)

### Starting a development environment

The development environment uses `docker-compose`, more information on the CLI usage [here](https://docs.docker.com/compose/reference/).

```bash
docker-compose up -d # Start environment
docker-compose logs -f # Read all components logs
docker-compose logs -f forum # Read forum component logs
docker-compose exec forum sh # Execute an interactive shell on the forum container
```

The development server is accessible at: .

### Stopping a development environment

```bash
docker-compose down # Stop environment (add -v to delete the volumes)
docker volume ls # List volumes
docker volume rm naxos_forum-db # Delete the db
```

### Fixtures

Initial data (fixtures) is provided and installed automatically by `docker-entrypoint.sh`.

Out of the box, you will be able to log in using those credentials:

- Username: "admin"
- Password: "crimson"

#### Create new fixtures

```sh
python3 manage.py dumpdata --natural-foreign \
--exclude auth.permission --exclude contenttypes \
--indent 4 > data.json
```

## Building

### Update dependencies

```bash
pipenv run pip install setuptools==57.5.0
pipenv install
pipenv update
pipenv requirements > requirements.txt
```

### Docker image

```bash
docker build --build-arg VERSION="$(git rev-parse HEAD)" --tag maur1th/naxos-forum app/forum && \
docker build --build-arg VERSION="$(git rev-parse HEAD)" --tag maur1th/naxos-websocket app/websocket && \
docker tag maur1th/naxos-forum maur1th/naxos-forum:"$(git rev-parse HEAD)" && \
docker tag maur1th/naxos-websocket maur1th/naxos-websocket:"$(git rev-parse HEAD)" && \
docker push maur1th/naxos-forum && \
docker push maur1th/naxos-forum:"$(git rev-parse HEAD)" && \
docker push maur1th/naxos-websocket && \
docker push maur1th/naxos-websocket:"$(git rev-parse HEAD)"
```

## Deployment

### Application

```bash
# Deploy latest Docker images
$ ansible-playbook -i hosts --vault-password-file=~/.vault_pass playbook.yml
# Deploy specific commit
$ ansible-playbook -i hosts --vault-password-file=~/.vault_pass playbook.yml -e "app_version="
```

### Static files

```bash
docker-compose run -e LOCAL_ENV=0 -e AWS_STORAGE_BUCKET_NAME=geekattitude -e AWS_ACCESS_KEY_ID=foo -e AWS_SECRET_ACCESS_KEY=bar --entrypoint "python3 manage.py collectstatic --no-input" forum
```