Skip to content

Commit

Permalink
Merge branch 'master' into feat/new-statuses
Browse files Browse the repository at this point in the history
  • Loading branch information
LiviaValenti authored Aug 23, 2023
2 parents 3086d9d + 92ed2af commit 85fc7a4
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 4 deletions.
11 changes: 11 additions & 0 deletions backend/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#---- COMMANDS ----#

start: ##@Docker (start)
docker compose up --build

fresh: ##@Docker (start) with fresh fixtures
docker compose --profile fresh down
docker compose --profile fresh up --build

clean: ##@Docker (stop) Stops and removes all containers and volumes
docker compose --profile fresh down -v
25 changes: 21 additions & 4 deletions backend/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,29 @@
- [cors for Express.js](https://github.com/expressjs/cors) - middleware
- [nodemon](https://github.com/remy/nodemon) - development dependency

## Developement

Install and run the backend using `docker compose up`
If you change the fixtures afterwards you have to run `docker compose up --build` to reload the new fixtures to the image.
## Development

### Environment variables

Make a copy of `.env.example` and name it `.env`
When using docker you don't need to do any modifications for developing locally.

### Start the backend and a database

(Requires docker installed and the environment variables from the step above)

Start the backend and a local database:
`make start`

Start the backend and a local database with clean dummy data:
`make fresh`

Stop and remove backend and local database:
`make clean`

---

#### Commands if not using makefile:

Install and run the backend using `docker compose up --build`
If you want to populate your local database with dummy data from the fixtures use `docker compose --profile fresh up --build` instead.
1 change: 1 addition & 0 deletions backend/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ services:

# Auto imports fixtures, will auto exit when done
import-fixtures:
profiles: ['fresh']
env_file:
- .env
build:
Expand Down
7 changes: 7 additions & 0 deletions backend/fixtures/production/committees.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,5 +83,12 @@
"deputy_board_member"
],
"accepts_admissions": false
},
{
"_id": 103,
"name": "Materialutvalget",
"slug": "materialutvalget",
"access_roles": ["deputy_leader"],
"accepts_admissions": false
}
]

0 comments on commit 85fc7a4

Please sign in to comment.