Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

instructions for development setup #422

Merged
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 74 additions & 0 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# Setting up newsroom for development

## Repositories

Use `develop` branch of `newsroom-core` repository and `master` branch of `superdesk-app`.
MarkLark86 marked this conversation as resolved.
Show resolved Hide resolved

## Install dependencies

* docker engine - follow instructions at https://docs.docker.com/engine/install/ubuntu
* `sudo apt install docker-compose`
* `sudo apt install git`
* `sudo apt install python3.10-venv` (may vary depending on python version)
* `sudo apt-get install python3-dev`
* `sudo apt install nodejs`
* `sudo apt install npm`
* `sudo npm install -g n`
* use node 14 - `sudo n 14`

## Setup and link newsroom-core client
* navigate to `newsroom-core`
* `npm install`
* `npm link`

## Start client (needs to be started before back-end server)
* navigate to `newsroom-app/client`
* `npm install`
* `npm link newsroom-core`
* `npm start`

## Starting required services via docker (redis, mongo, elastic)
* navigate to `newsroom-app`
* `cd server`
* `sudo docker-compose up redis mongo elastic`

## Create .env file
* navigate to `newsroom-app/server`
* create .env file with the following contents:

```
WEBPACK_ASSETS_URL=http://localhost:8080
WEBPACK_SERVER_URL=http://localhost:8080
SECRET_KEY=newsroom
```

## Starting local server
* navigate to `newsroom-app`
* make sure you're on `master` branch
MarkLark86 marked this conversation as resolved.
Show resolved Hide resolved
* `cd server`
* create virtual environment `python3 -m venv env`
* activate virtual environment `source env/bin/activate`
* install python dependencies - `pip install -r dev-requirements.txt`
* link local server - `pip install -Ue <path-to-newsroom-core>`
* create a user - `python manage.py create_user admin@localhost.com admin John Doe true`
MarkLark86 marked this conversation as resolved.
Show resolved Hide resolved
* `python manage.py elastic_init`
* start server - `honcho start -p 5050`

## Setup Superdesk to publish news items to Newshub

### Create a subscriber

* Go to Superdesk settings -> Subscribers -> Add new
* Set "Target Type" to "All"
* Set "Sequence number settings" to 1 and 10.
* Click "Add new destination"
* Set "Format" to "Newsroom NINJS"
* Set "Delivery type" to "HTTP Push"
* Set "Resource URL" to "http://localhost:5050/push"
MarkLark86 marked this conversation as resolved.
Show resolved Hide resolved
* Save destination
* Save subscriber





Loading