Skip to content

Commit

Permalink
chore: update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
marcellmueller committed Nov 28, 2024
1 parent 232abf7 commit 80039d1
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 6 deletions.
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ drop_db:
grep -q 0 || \
$(PSQL) -d postgres -c "DROP DATABASE $(DB_NAME)";

.PHONY: migrations
migrations: ## create the migrations
migrations:
## TODO:: use flyway for migrations
.PHONY: migrate
migrate: ## create the migrations
migrate:
## TODO:: this is a very basic setup, we should use flyway for migrations
for file in ./migrations/sql/*.sql; do \
printf "Applying migration: ${DB_NAME}/$$(basename $$file)\n"; \
$(PSQL) -d $(DB_NAME) -f $$file; \
Expand Down
57 changes: 57 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,63 @@ Backend (JavaScript/TypeScript)
- (License)[LICENSE.md]
- (Security)[SECURITY.md]

## Local Development

### Prerequisites

- Node.js
- npm
- Docker OR PostgreSQL 15

### Docker Compose

To run the entire application using Docker Compose, run the following commands:

```bash
git clone [email protected]:bcgov/nr-rec-resources.git
cd nr-rec-resources
docker-compose up
```

Navigate to `http://localhost:3000` in your web browser to view the application.

### Installation

To run this on your local machine, you will need a working installation of PostgreSQL 15.

### Database

Create an `.env` file in the `backend` directory using the example in `backend/.env.example` as a template.

```bash
cd nr-rec-resources
make create_db
make migrate
```

### Backend

Ensure you have the `.env` file in the `backend` directory from the previous step.

```bash
cd backend
npm install
npm run dev
```

### Frontend

Create an `.env` file in the `frontend` directory using the example in `frontend/.env.example` as a template.

```bash
cd frontend
npm install
npm run dev
```

Navigate to `http://localhost:3000` in your web browser to view the application.


## Style Guide

Commits follow the conventions defined in the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) specification.
Expand Down
4 changes: 2 additions & 2 deletions backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
"build": "prisma generate && nest build",
"format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
"deploy": "npm ci --ignore-scripts --no-update-notifier && npm run build",
"dev": "nest start --watch",
"dev:debug": "nest start --debug --watch",
"start": "nest start",
"start:dev": "nest start --watch",
"start:debug": "nest start --debug --watch",
"start:prod": "node dist/main",
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix",
"lint:staged": "./node_modules/.bin/lint-staged",
Expand Down
1 change: 1 addition & 0 deletions frontend/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ root.render(
<StrictMode>
<Header />
<main
// use bcparks bootstrap theme container class to share same page max width
className="container"
style={{
display: 'flex',
Expand Down

0 comments on commit 80039d1

Please sign in to comment.