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
2 changes: 1 addition & 1 deletion .github/workflows/aws-frontend-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v3 # Sets up Node.js for build
with:
node-version: 18 # Uses Node.js v18
node-version: 24 # Uses Node.js v24 (matches .nvmrc and the Dockerfiles)
cache: "npm" # Enables npm caching
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v3 # Sets AWS credentials for CLI
Expand Down
8 changes: 0 additions & 8 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,14 +173,6 @@ Note: Understanding how git remotes work will make collaborating much easier. Yo

- Navigate to the root of the application `vrms/` and run `yarn start`

_Troubleshooting :_ If you encounter the following error after running `yarn start`:

```
Error: error:0308010C:digital envelope routines::unsupported
```

Try changing your node version to `16.14.2` by running `nvm use 16.14.2`. If you do not have `nvm` installed, see [install instructions](https://github.com/nvm-sh/nvm#installing-and-updating)

You should now have a live app. Happy hacking.

### **2.4 Running Tests**
Expand Down
2 changes: 1 addition & 1 deletion backend/Dockerfile.dev
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:18.12.0 AS api-development
FROM node:24 AS api-development
RUN mkdir /srv/backend
WORKDIR /srv/backend
RUN mkdir -p node_modules
Expand Down
3 changes: 2 additions & 1 deletion backend/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ assertEnv([

// Create a new application using the Express framework
const app = express();
app.set('query parser', 'extended');

// Required to view Request Body (req.body) in JSON
app.use(express.json());
Expand Down Expand Up @@ -139,7 +140,7 @@ app.use('/api/healthcheck', healthCheckRouter);
app.use('/api/featureFlags', featureFlagsRouter);

// 404 for all non-defined endpoints.
app.get('*', (req, res, next) => {
app.get('/{*splat}', (req, res, next) => {
const error = new Error('Not Found');
error.status = 404;
next(error);
Expand Down
4 changes: 2 additions & 2 deletions backend/env.bootstrap.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { fileURLToPath } from 'url';
import dotenv from 'dotenv';
import dotenvExpand from 'dotenv-expand';
import { expand as dotenvExpand } from 'dotenv-expand';

const envFilePath = fileURLToPath(new URL('./.env', import.meta.url));
const envResult = dotenv.config({ path: envFilePath });
const envResult = dotenv.config({ path: envFilePath, quiet: true });

if (envResult.error && envResult.error.code !== 'ENOENT') {
throw envResult.error;
Expand Down
49 changes: 25 additions & 24 deletions backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,36 +22,37 @@
"author": "sarL3y",
"license": "ISC",
"devDependencies": {
"concurrently": "^5.1.0",
"debug": "^4.3.1",
"concurrently": "^10.0.6",
"debug": "^4.4.3",
"mockdate": "^3.0.5",
"nodemon": "^2.0.2",
"supertest": "^4.0.2",
"nodemon": "^3.1.14",
"supertest": "^7.3.1",
"swagger-autogen": "^2.23.7",
"vitest": "^4.1.5",
"why-is-node-running": "^2.2.0"
"vite": "^8.3.4",
"vitest": "^5.0.4",
"why-is-node-running": "^3.2.3"
},
"dependencies": {
"@js-temporal/polyfill": "^0.5.1",
"@slack/bolt": "^2.2.3",
"@slack/bolt": "^5.1.0",
"assert-env": "^0.6.0",
"async": "^3.2.2",
"cookie-parser": "^1.4.5",
"cors": "^2.8.5",
"dotenv": "^8.2.0",
"dotenv-expand": "^5.1.0",
"express": "^4.20.0",
"express-validator": "^6.6.1",
"googleapis": "^59.0.0",
"helmet": "^3.22.0",
"jsonwebtoken": "^8.5.1",
"mongodb-memory-server": "^11.1.0",
"mongoose": "^8.9.5",
"morgan": "^1.10.0",
"node-cron": "^2.0.3",
"node-fetch": "^2.6.7",
"nodemailer": "^7.0.11",
"posthog-node": "^5.21.2",
"async": "^3.2.6",
"cookie-parser": "^1.4.7",
"cors": "^2.8.6",
"dotenv": "^18.0.7",
"dotenv-expand": "^13.0.0",
"express": "^5.3.0",
"express-validator": "^7.3.2",
"googleapis": "^185.0.0",
"helmet": "^8.3.0",
"jsonwebtoken": "^9.0.3",
"mongodb-memory-server": "^11.3.0",
"mongoose": "^9.11.2",
"morgan": "^1.12.1",
"node-cron": "^4.6.0",
"node-fetch": "^3.3.2",
"nodemailer": "^10.1.0",
"posthog-node": "^5.55.3",
"swagger-ui-express": "^5.0.1"
},
"directories": {
Expand Down
28 changes: 28 additions & 0 deletions backend/test/event.integration.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import supertest from 'supertest';
import { beforeAll, describe, expect, test } from 'vitest';
import app from '../app.js';
import { Event } from '../models/index.js';
import { setupIntegrationDB } from '../setup-test.js';

setupIntegrationDB('api-events');

const request = supertest(app);
const backendHeaders = process.env.CUSTOM_REQUEST_HEADER;

describe('GET /api/events', () => {
beforeAll(async () => {
await Event.create([
{ name: 'Past Event', date: new Date('2020-01-01T00:00:00Z') },
{ name: 'Future Event', date: new Date('2099-01-01T00:00:00Z') },
]);
});

test('filters events with a bracket-style date[$gt] query', async () => {
const res = await request
.get(`/api/events/?date[$gt]=${new Date('2025-01-01T00:00:00Z').toISOString()}`)
.set('x-customrequired-header', backendHeaders);

expect(res.status).toBe(200);
expect(res.body.map((event) => event.name)).toEqual(['Future Event']);
});
});
Loading