Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
36 changes: 36 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# MongoDB Credentials for the local Docker container
MONGO_USERNAME=root
MONGO_PASSWORD=root

# Mongo-Express UI Credentials
MONGO_EXPRESS_USERNAME=admin
MONGO_EXPRESS_PASSWORD=admin

# Rerum server settings
PORT=3001
RERUM_API_VERSION=1.0.0
COLLECTION_ACCEPTEDSERVER=acceptedServer
COLLECTION_V0=annotation
AUDIENCE=http://rerum.io/api
ISSUER_BASE_URL=https://example.auth0.com/
RERUM_BASE=http://localhost:3001
RERUM_PREFIX=http://localhost:3001/v1/
RERUM_ID_PREFIX=http://localhost:3001/v1/id/
RERUM_AGENT_CLAIM=http://store.rerum.io/agent
RERUM_CONTEXT=http://store.rerum.io/v1/context.json
RERUM_API_DOC=http://localhost:3001/v1/API.html

# The local MongoDB connection string
MONGO_CONNECTION_STRING=mongodb://${MONGO_USERNAME}:${MONGO_PASSWORD}@mongo:27017/
Copy link

Copilot AI Nov 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The MONGO_CONNECTION_STRING uses variable substitution syntax (${MONGO_USERNAME} and ${MONGO_PASSWORD}) which will not be expanded in a .env file. Most .env parsers (including dotenv) do not perform variable substitution. This line should either use the literal values 'root' and 'root' directly as 'mongodb://root:root@mongo:27017/', or include a comment explaining that this value will be overridden by the docker-compose.yml environment section.

Suggested change
MONGO_CONNECTION_STRING=mongodb://${MONGO_USERNAME}:${MONGO_PASSWORD}@mongo:27017/
MONGO_CONNECTION_STRING=mongodb://root:root@mongo:27017/

Copilot uses AI. Check for mistakes.
MONGODBNAME=annotationStore
MONGODBCOLLECTION=alpha

# Read only mode
DOWN=false
READONLY=false

# Auth0 and bot secrets (replace with fake values for local use)
CLIENT_ID=dummy_client_id
CLIENT_SECRET=dummy_client_secret
BOT_TOKEN=dummy_bot_token
BOT_AGENT=http://devstore.rerum.io/v1/id/dummy_agent
20 changes: 20 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@

FROM node

# Set the working directory inside the container.
WORKDIR /app

# Copy package.json and package-lock.json first to leverage Docker's build cache.
COPY package*.json ./

# Install application dependencies.
RUN npm install

# Copy the rest of the application code.
COPY . .

# Expose the port the app runs on.
EXPOSE 3001

# The command to start the application.
CMD ["node", "./bin/rerum_v1.js"]
38 changes: 38 additions & 0 deletions README.md
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think in general we are really expecting this to change to reflect that it is the community edition. For example, the Who's to Blame? section. You're to blame now.

Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,44 @@ MONGODBCOLLECTION = OBTAINED_FROM_MONGODB_SET_UP
DOWN = false
READONLY = false
```
#### Add .env.example instructions
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this an old note-to-self?

##### Using `.env.example` for Community Testing
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You probably want this one to be #### for consistency, it probably replaces #### Add .env.example instructions

To allow the application to run safely without exposing secrets:
1. Copy the example environment file to `.env`:
```bash
cp .env.example .env
2. .env.example contains dummy values for all required variables. You do not need real credentials to run the app locally.
3. Note:
Write actions (create, update, delete) may not work without valid Auth0 credentials.
You can still explore the API, MongoDB, and UI for testing purposes.
#### Instructions
1. Running the RERUM API with Docker
Ensure Docker and Docker Compose are installed.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think you want 'ensure' to be lowercase

Copy the example environment file:
bash
Copy code
cp .env.example .env
Comment on lines +94 to +96
Copy link

Copilot AI Nov 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code block syntax is incorrect. Lines 94-96 appear to be attempting a code block but 'bash' and 'Copy code' are written as plain text rather than using proper markdown code block syntax. This should be formatted as a proper code block with triple backticks: bash on line 94, the command on line 95, and closing on line 96. Remove 'Copy code' which appears to be accidentally copied from another source.

Suggested change
bash
Copy code
cp .env.example .env
```bash
cp .env.example .env
```

Copilot uses AI. Check for mistakes.

Copy link

Copilot AI Nov 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The bash code block is not properly closed. Line 85 starts a code block with triple backticks but there's no closing triple backticks before line 86, which continues the numbered list. Add a closing ``` after line 85 to properly terminate the code block.

Copilot uses AI. Check for mistakes.
2. Build and start the containers:
bash
Copy code
docker-compose up --build
Comment on lines +90 to +101
Copy link

Copilot AI Nov 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The documentation structure is confusing with nested headings under a numbered list item. Line 90 has a level-4 heading '#### Instructions' appearing inside item 3 of the list, and line 91 starts a new numbered list (1.) that's nested under the same item 3. This should be restructured so that the 'Instructions' section and its numbered steps are at the proper level, not nested inside item 3.

Suggested change
#### Instructions
1. Running the RERUM API with Docker
Ensure Docker and Docker Compose are installed.
Copy the example environment file:
bash
Copy code
cp .env.example .env
2. Build and start the containers:
bash
Copy code
docker-compose up --build
#### Instructions
1. Running the RERUM API with Docker
Ensure Docker and Docker Compose are installed.
Copy the example environment file:
```bash
cp .env.example .env
  1. Build and start the containers:
    docker-compose up --build

Copilot uses AI. Check for mistakes.
Comment on lines +98 to +101
Copy link

Copilot AI Nov 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code block syntax is incorrect. Lines 99-101 have the same formatting issue as the previous code block - 'bash' and 'Copy code' are written as plain text. This should use proper markdown code block syntax with triple backticks, and 'Copy code' should be removed.

Copilot uses AI. Check for mistakes.

Services will be available at:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did these come out in the format you expect? They are all on the same line

RERUM API → http://localhost:3001
Mongo Express → http://localhost:8081
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oo what's Mongo Express? You might need to explain what this is somewhere in the readme.

Local Auth0 → http://localhost:3002
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oo what's this Local Auth0? You might need to explain what this is somewhere in the readme.


3. To stop the containers:
bash
Copy code
docker-compose down
Comment on lines +108 to +111
Copy link

Copilot AI Nov 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code block syntax is incorrect. Lines 109-111 have the same formatting issue - 'bash' and 'Copy code' are written as plain text instead of using proper markdown code block syntax with triple backticks. 'Copy code' should be removed.

Copilot uses AI. Check for mistakes.

4. This setup uses dummy credentials so the API runs safely. For full Auth0 functionality, replace the dummy values in .env with real credentials.
5. The .env.example file contains safe dummy credentials:
Auth0 CLIENT_ID, CLIENT_SECRET
Bot tokens
6. You can safely run the application with these values without affecting real data.
Comment on lines +113 to +117
Copy link

Copilot AI Nov 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The numbered list continues items 4, 5, and 6 at the same level as the nested 'Instructions' section, creating a confusing structure. Items 4-6 appear to be additional notes about the Docker setup but they're formatted as if they're part of the original numbered list that started at line 83. These should either be reformatted as a separate list or integrated properly into the Docker instructions section.

Suggested change
4. This setup uses dummy credentials so the API runs safely. For full Auth0 functionality, replace the dummy values in .env with real credentials.
5. The .env.example file contains safe dummy credentials:
Auth0 CLIENT_ID, CLIENT_SECRET
Bot tokens
6. You can safely run the application with these values without affecting real data.
#### Notes
- This setup uses dummy credentials so the API runs safely. For full Auth0 functionality, replace the dummy values in .env with real credentials.
- The .env.example file contains safe dummy credentials:
- Auth0 CLIENT_ID, CLIENT_SECRET
- Bot tokens
- You can safely run the application with these values without affecting real data.

Copilot uses AI. Check for mistakes.

#### Set Up Auth0 Authorization
Please contact the [Research Computing Group at Saint Louis University](https://github.com/CenterForDigitalHumanities) via an E-mail to [email protected] for more information and assistance with this step of the installation process.
Expand Down
59 changes: 59 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
services:
rerum:
build: .
container_name: rerum-server
restart: always
ports:
- "3001:3001"
env_file: .env
environment:
- MONGO_CONNECTION_STRING=mongodb://${MONGO_USERNAME}:${MONGO_PASSWORD}@mongo:27017/
depends_on:
- localauth0 # Restored dependency on localauth0
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment is confusing

- mongo

mongo:
image: mongo
container_name: rerum-mongo
restart: always
ports:
- "27017:27017"
volumes:
- mongo-data:/data/db
environment:
- MONGO_INITDB_ROOT_USERNAME=${MONGO_USERNAME}
- MONGO_INITDB_ROOT_PASSWORD=${MONGO_PASSWORD}

mongo-express:
image: mongo-express
container_name: rerum-mongo-express
restart: always
ports:
- "8081:8081"
environment:
- ME_CONFIG_MONGODB_ADMINUSERNAME=${MONGO_USERNAME}
- ME_CONFIG_MONGODB_ADMINPASSWORD=${MONGO_PASSWORD}
- ME_CONFIG_MONGODB_URL=mongodb://${MONGO_USERNAME}:${MONGO_PASSWORD}@mongo:27017/
- ME_CONFIG_BASICAUTH_USERNAME=${MONGO_EXPRESS_USERNAME}
- ME_CONFIG_BASICAUTH_PASSWORD=${MONGO_EXPRESS_PASSWORD}
depends_on:
- mongo

# RESTORED SERVICE - Uses port 3002 and includes the debugging command
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment is confusing.

localauth0:
image: public.ecr.aws/primaassicurazioni/localauth0:0.8.2
container_name: rerum-localauth0
restart: always
healthcheck:
test: ["CMD", "/localauth0", "healthcheck"]
ports:
- "3002:3002"
env_file: .env
depends_on:
- mongo
# CRITICAL DEBUGGING STEP: Forces the application to run in the foreground.
# This will dump the startup error (which is causing ERR_EMPTY_RESPONSE) directly to your console.
command: /localauth0

volumes:
mongo-data: