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

Merge Develop onto Main #401

Merged
merged 4 commits into from Apr 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
43 changes: 43 additions & 0 deletions .devcontainer/devcontainer.json
@@ -0,0 +1,43 @@
// Comments generated through the "Create a Dev Container" wizard in Visual Studio Code
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/docker-existing-docker-compose
{
"name": "Existing Docker Compose (Extend)",
// Update the 'dockerComposeFile' list if you have more compose files or use different names.
// The .devcontainer/docker-compose.yml file contains any overrides you need/want to make.
"dockerComposeFile": [
"../docker-compose.yml",
"docker-compose.yml"
],
// The 'service' property is the name of the service for the container that VS Code should
// use. Update this value and .devcontainer/docker-compose.yml to the real service name.
"service": "api",
// The optional 'workspaceFolder' property is the path VS Code should open by default when
// connected. This is typically a file mount in .devcontainer/docker-compose.yml
"workspaceFolder": "/app",
// Features to add to the dev container. More info: https://containers.dev/features.
// "features": {
// "ghcr.io/devcontainers/features/github-cli:1": {}
// },
// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],
// Uncomment the next line if you want start specific services in your Docker Compose config.
"runServices": [
"db"
],
// Uncomment the next line if you want to keep your containers running after VS Code shuts down.
// "shutdownAction": "none",
// Uncomment the next line to run commands after the container is created.
// "postCreateCommand": "cat /etc/os-release",
// Configure tool-specific properties.
"customizations": {
"vscode": {
"extensions": [
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode"
]
}
}
// Uncomment to connect as an existing user other than the container default. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "devcontainer"
}
27 changes: 27 additions & 0 deletions .devcontainer/docker-compose.yml
@@ -0,0 +1,27 @@
# Comments generated through the "Create a Dev Container" wizard in Visual Studio Code
version: '3.9'
services:
# Update this to the name of the service you want to work with in your docker-compose.yml file
api:
# Uncomment if you want to override the service's Dockerfile to one in the .devcontainer
# folder. Note that the path of the Dockerfile and context is relative to the *primary*
# docker-compose.yml file (the first in the devcontainer.json "dockerComposeFile"
# array). The sample below assumes your primary file is in the root of your project.
#
# build:
# context: .
# dockerfile: .devcontainer/Dockerfile

# volumes:
# # Update this to wherever you want VS Code to mount the folder of your project
# - ..:/workspaces:cached

# Uncomment the next four lines if you will use a ptrace-based debugger like C++, Go, and Rust.
# cap_add:
# - SYS_PTRACE
# security_opt:
# - seccomp:unconfined

# Overrides default command so things don't shut down after the process ends.
command: /bin/sh -c "while sleep 1000; do :; done"

22 changes: 0 additions & 22 deletions .eslintrc.js

This file was deleted.

15 changes: 15 additions & 0 deletions .github/dependabot.yml
@@ -0,0 +1,15 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for more information:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
# https://containers.dev/guide/dependabot

# Run dependabot weekly to check for updates to the devcontainers package ecosystem.
# Might need to combine this with future dependabot configurations later.

version: 2
updates:
- package-ecosystem: "devcontainers"
directory: "/"
schedule:
interval: weekly
2 changes: 1 addition & 1 deletion .github/workflows/.ci.yml
Expand Up @@ -28,7 +28,7 @@ jobs:
- name: Use NodeJs
uses: actions/setup-node@v1
with:
node-version: '16.x'
node-version: '20.x'
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Run prettier
Expand Down
14 changes: 7 additions & 7 deletions .vscode/extensions.json
@@ -1,8 +1,8 @@
{
"recommendations": ["dbaeumer.vscode-eslint", "esbenp.prettier-vscode"],
"unwantedRecommendations": [
"hookyqr.beautify",
"dbaeumer.jshint",
"ms-vscode.vscode-typescript-tslint-plugin"
]
}
"recommendations": ["dbaeumer.vscode-eslint", "esbenp.prettier-vscode"],
"unwantedRecommendations": [
"hookyqr.beautify",
"dbaeumer.jshint",
"ms-vscode.vscode-typescript-tslint-plugin"
]
}
39 changes: 20 additions & 19 deletions .vscode/settings.json
@@ -1,21 +1,22 @@
{
"editor.formatOnPaste": true,
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.organizeImports": "explicit",
"source.fixAll": "explicit",
"source.fixAll.eslint": "explicit"
},
"editor.defaultFormatter": "esbenp.prettier-vscode",
"vetur.format.defaultFormatterOptions": {
"prettier": {
"singleQuote": true
}
},
"[jsonc]": {
"editor.defaultFormatter": "vscode.json-language-features"
},
"cSpell.words": [
"simplybook"
]
"editor.formatOnPaste": true,
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.organizeImports": "explicit",
"source.fixAll": "explicit",
"source.fixAll.eslint": "explicit"
},
"editor.defaultFormatter": "esbenp.prettier-vscode",
"eslint.experimental.useFlatConfig": true,
"vetur.format.defaultFormatterOptions": {
"prettier": {
"singleQuote": true
}
},
"[jsonc]": {
"editor.defaultFormatter": "vscode.json-language-features"
},
"cSpell.words": [
"simplybook"
]
}
5 changes: 4 additions & 1 deletion Dockerfile
@@ -1,4 +1,7 @@
FROM node:16-alpine
FROM node:20-alpine

# Install git for devcontainers
RUN apk add --no-cache git

ENV NODE_ENV=development

Expand Down
27 changes: 23 additions & 4 deletions README.md
Expand Up @@ -51,10 +51,25 @@ For a more detailed explanation of this project's key concepts and architecture,

### Prerequisites

- NodeJS v16.x
- NodeJS v20.x
- Yarn v1.x
- Docker

### Run in Dev Container - OPTIONAL

**Recommended for Visual Studio & Visual Studio Code users.**

This method will automatically install all dependencies and IDE settings in a Dev Container (Docker container) within Visual Studio Code. Simply clone this repo to your computer, open in Visual Studio Code, and select "Re-open in Container" when notified.

After re-opening VS Code in a dev container, develop as you normally would and use the container terminal within VS Code. Next, [configure your environment variables](#configure-environment-variables).

The dev Container is configured in the `.devcontainer` directory:

- `docker-compose.yml` file in this directory extends the `docker-compose.yml` in the root directory.
- `devcontainer.json` configures the integrations with Visual Studio Code, such as the IDE extensions and settings in the `vscode` directory.

Read for more detailed instructions: [Visual Studio Code Docs: Developing Inside a Dev Container](https://code.visualstudio.com/docs/devcontainers/containers).

### Install dependencies

```bash
Expand Down Expand Up @@ -123,7 +138,9 @@ RESPOND_IO_CREATE_CONTACT_WEBHOOK=
RESPOND_IO_DELETE_CONTACT_WEBHOOK=
```

### Run locally (with Docker) - RECOMMENDED
### Run the App Locally

#### Using Docker - RECOMMENDED

The project is containerized and can be run solely in docker - both the PostgreSQL database and NestJS app. To run the backend locally, make sure your system has Docker installed - you may need Docker Desktop if using a Mac.

Expand All @@ -141,7 +158,9 @@ Listening on localhost:35001, CTRL+C to stop

_Note: you can use an application like Postman to test the apis locally_

**Run the app**
#### Without Docker

First install [postgres](https://www.postgresql.org/). Next follow directions to [seed the database](#seed-local-database), then run:

```bash
yarn start:dev
Expand Down Expand Up @@ -217,7 +236,7 @@ Workspace settings for VSCode are included for consistent linting and formatting

### Seed Local Database

Visit our [Tech Volunteer Guide](https://chayn.notion.site/Tech-volunteer-wiki-5356c7118c134863a2e092e9df6cbc34#84635bd9b82543ccaab4fb932ca35ebf) for directions on how to seed your local database with data.
If you're a volunteer, add data to your local database by seeding it with a backup file. Please [read our Tech Volunteer Guide](https://www.notion.so/chayn/Tech-volunteer-wiki-5356c7118c134863a2e092e9df6cbc34?pvs=4#0fb25ffde84f4854b2d9730200eee283) for directions on seeding the local database.

If you're staff and have access to Heroku, you also have the option to seed the database via the following script. Before you start, make sure:

Expand Down
28 changes: 28 additions & 0 deletions eslint.config.js
@@ -0,0 +1,28 @@
/* eslint-disable */
const eslintJs = require('@eslint/js');
const tsEslint = require('typescript-eslint');
const eslintPrettier = require('eslint-config-prettier');

module.exports = [
eslintJs.configs.recommended,
...tsEslint.configs.recommended,
eslintPrettier,
{
languageOptions: {
globals: {
node: true,
require: true,
jest: true,
},
},
plugins: { tsEslint },
rules: {
'@/interface-name-prefix': 'off',
'@/explicit-function-return-type': 'off',
'@/explicit-module-boundary-types': 'off',
'@/no-explicit-any': 'off',
'@/no-unused-vars': ['error', { ignoreRestSiblings: true }],
},
ignores: ['eslint.config.js', 'dist/*'],
},
];
32 changes: 0 additions & 32 deletions ormconfig.ts

This file was deleted.