diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 171e2d2a8..930afce11 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,4 +1,9 @@ { "name": "Anythink Development Container", - "image": "public.ecr.aws/v0a2l7y2/wilco/anythink-devcontainer:latest" + "image": "public.ecr.aws/v0a2l7y2/wilco/anythink-devcontainer:latest", + "customizations": { + "vscode": { + "extensions": ["GitHub.copilot", "GitHub.copilot-chat"] + } + } } diff --git a/.devcontainer/setup.sh b/.devcontainer/setup.sh index f7bc939f8..5a6cfc3d6 100755 --- a/.devcontainer/setup.sh +++ b/.devcontainer/setup.sh @@ -15,10 +15,4 @@ echo "export CODESPACE_WDS_SOCKET_PORT=443" >> ~/.bashrc echo "printf \"\n\n☁️☁️☁️️ Anythink: Develop in the Cloud ☁️☁️☁️\n\"" >> ~/.bashrc echo "printf \"\n\x1b[31m \x1b[1m👉 Type: \\\`docker compose up\\\` to run the project. 👈\n\n\"" >> ~/.bashrc -nohup bash -c "cd /wilco-agent && node agent.js &" >> /tmp/agent.log 2>&1 - -# Check if docker is installed -if command -v docker &> /dev/null -then - docker compose pull -fi +nohup bash -c "cd /wilco-agent && node agent.js &" >> /tmp/agent.log 2>&1 diff --git a/backend/Dockerfile b/backend/Dockerfile new file mode 100644 index 000000000..e779cce14 --- /dev/null +++ b/backend/Dockerfile @@ -0,0 +1 @@ +FROM public.ecr.aws/v0a2l7y2/wilco/anythink-backend-node:latest diff --git a/backend/app.js b/backend/app.js index 1a1d5a802..f4e7f355a 100644 --- a/backend/app.js +++ b/backend/app.js @@ -27,7 +27,7 @@ app.use(express.static(__dirname + "/public")); app.use( session({ - secret: "e6F9KvSDf4dyXj", + secret: "secret", cookie: { maxAge: 60000 }, resave: false, saveUninitialized: false diff --git a/backend/config/index.js b/backend/config/index.js index f69b9957e..1bf9d6a12 100644 --- a/backend/config/index.js +++ b/backend/config/index.js @@ -1,3 +1,3 @@ module.exports = { - secret: process.env.NODE_ENV === 'production' ? process.env.SECRET : 'e6F9KvSDf4dyXj' + secret: process.env.NODE_ENV === 'production' ? process.env.SECRET : 'secret' }; diff --git a/backend/routes/api/comments.js b/backend/routes/api/comments.js new file mode 100644 index 000000000..47b0bc591 --- /dev/null +++ b/backend/routes/api/comments.js @@ -0,0 +1,5 @@ +const router = require("express").Router(); +const mongoose = require("mongoose"); +const Comment = mongoose.model("Comment"); + +module.exports = router; diff --git a/backend/routes/api/index.js b/backend/routes/api/index.js index 380d027cb..9f23863b6 100644 --- a/backend/routes/api/index.js +++ b/backend/routes/api/index.js @@ -4,6 +4,7 @@ router.use('/', require('./users')); router.use('/profiles', require('./profiles')); router.use('/items', require('./items')); router.use('/tags', require('./tags')); +router.use('/comments', require('./comments')); router.use('/ping', require('./ping')); router.use(function(err, req, res, next){ diff --git a/docker-compose.yml b/docker-compose.yml index da550a362..c233da873 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,8 +1,9 @@ +version: "3.8" services: anythink-backend-node: - image: public.ecr.aws/v0a2l7y2/wilco/anythink-backend-node:latest + build: ./backend container_name: anythink-backend-node - command: sh -c "cd backend && /wait-for-it.sh mongodb-node:27017 -q -t 60 && yarn dev" + command: sh -c "cd backend && yarn install && /wait-for-it.sh mongodb-node:27017 -q -t 60 && yarn dev" environment: - NODE_ENV=development @@ -19,9 +20,9 @@ services: - "mongodb-node" anythink-frontend-react: - image: public.ecr.aws/v0a2l7y2/wilco/anythink-frontend-react:latest + build: ./frontend container_name: anythink-frontend-react - command: sh -c "cd frontend && /wait-for-it.sh anythink-backend-node:3000 -t 120 --strict -- curl --head -X GET --retry 30 --retry-connrefused --retry-delay 1 anythink-backend-node:3000/api/ping && yarn start" + command: sh -c "cd frontend && yarn install && /wait-for-it.sh anythink-backend-node:3000 -t 120 --strict -- curl --head -X GET --retry 30 --retry-connrefused --retry-delay 1 anythink-backend-node:3000/api/ping && yarn start" environment: - NODE_ENV=development - PORT=3001 diff --git a/frontend/Dockerfile b/frontend/Dockerfile new file mode 100644 index 000000000..c8ba55462 --- /dev/null +++ b/frontend/Dockerfile @@ -0,0 +1 @@ +FROM public.ecr.aws/v0a2l7y2/wilco/anythink-frontend-react:latest diff --git a/readme.md b/readme.md index 19f396e2b..3ff175d70 100644 --- a/readme.md +++ b/readme.md @@ -6,7 +6,7 @@ Please find more info about each part in the relevant Readme file ([frontend](fr ## Development -When implementing a new feature or fixing a bug, please create a new pull request against `main` from a feature/bug branch and the Wilco app review it right away +When implementing a new feature or fixing a bug, please create a new pull request against `main` from a feature/bug branch and add `@vanessa-cooper` as reviewer. ## How to run in dev mode?