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

#i4 #9

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
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
12 changes: 12 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM mcr.microsoft.com/devcontainers/javascript-node:0-18

# [Optional] Uncomment this section to install additional OS packages.
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
# && apt-get -y install --no-install-recommends <your-package-list-here>

# [Optional] Uncomment if you want to install an additional version of node using nvm
# ARG EXTRA_NODE_VERSION=10
# RUN su node -c "source /usr/local/share/nvm/nvm.sh && nvm install ${EXTRA_NODE_VERSION}"

# [Optional] Uncomment if you want to install more global node modules
# RUN su node -c "npm install -g <your-package-list-here>"
32 changes: 32 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/javascript-node-postgres
{
"name": "Node.js & PostgreSQL",
"dockerComposeFile": "docker-compose.yml",
"service": "app",
"workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}",

// Features to add to the dev container. More info: https://containers.dev/features.
// "features": {},

// Use 'forwardPorts' to make a list of ports inside the container available locally.
// This can be used to network with other containers or with the host.
"forwardPorts": [3000,3001,5432],

// Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "yarn install",

// Configure tool-specific properties.
"customizations": {
"vscode": {
"extensions": [
"esbenp.prettier-vscode",
"zixuanchen.vitest-explorer",
"cweijan.vscode-postgresql-client2"
]
}
}

// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
}
35 changes: 35 additions & 0 deletions .devcontainer/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
version: '3.8'

services:
app:
build:
context: .
dockerfile: Dockerfile

volumes:
- ../..:/workspaces:cached

# Overrides default command so things don't shut down after the process ends.
command: sleep infinity

# Runs app on the same network as the database container, allows "forwardPorts" in devcontainer.json function.
network_mode: service:db

# Use "forwardPorts" in **devcontainer.json** to forward an app port locally.
# (Adding the "ports" property to this file will not forward from a Codespace.)

db:
image: postgres:latest
restart: unless-stopped
volumes:
- postgres-data:/var/lib/postgresql/data
environment:
POSTGRES_PASSWORD: postgres
POSTGRES_USER: postgres
POSTGRES_DB: postgres

# Add "forwardPorts": ["5432"] to **devcontainer.json** to forward PostgreSQL locally.
# (Adding the "ports" property to this file will not forward from a Codespace.)

volumes:
postgres-data:
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,5 @@ dist
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# render files
6 changes: 3 additions & 3 deletions backend/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ PORT=3001
JWT_KEY=supersecretkey_example

## Development Database
DEV_DB_USERNAME=root
DEV_DB_PASSWORD=null
DEV_DB_USERNAME=postgres
DEV_DB_PASSWORD=postgres
DEV_DB_NAME=database_development
DEV_DB_HOSTNAME=127.0.0.1
DEV_DB_DIALECT=mysql
DEV_DB_DIALECT=postgres
DEV_DB_LOGGGIN=true

## Testing Database
Expand Down
2 changes: 2 additions & 0 deletions backend/models/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ const env = process.env.NODE_ENV || "development";
const config = require(__dirname + "/../config/config.js")[env];
const db = {};

console.log('config', config);
console.log('env', env);
const sequelize = new Sequelize(
config.database,
config.username,
Expand Down
2 changes: 1 addition & 1 deletion frontend/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
name="description"
content="Web site created using create-react-app"
/>
<title>Conduit</title>
<title>Conduit dcTeam7</title>
<!-- Import Ionicon icons & Google Fonts our Bootstrap theme relies on -->
<link
href="//code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css"
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/Navbar/Navbar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ function Navbar() {
<nav className="navbar navbar-light">
<div className="container">
<Link className="navbar-brand" to="/">
conduit
dcTeam7
</Link>

<SourceCodeLink left />
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/routes/Home.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ function Home() {
<div className="home-page">
{!isAuth && (
<BannerContainer>
<h1 className="logo-font">conduit</h1>
<h1 className="logo-font">dcTeam7</h1>
<p>A place to share your knowledge.</p>
</BannerContainer>
)}
Expand Down
Loading