Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
WilcoApp committed Dec 13, 2024
1 parent 1946f9a commit ccdda3e
Show file tree
Hide file tree
Showing 10 changed files with 23 additions and 15 deletions.
7 changes: 6 additions & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -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"]
}
}
}
8 changes: 1 addition & 7 deletions .devcontainer/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 1 addition & 0 deletions backend/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
FROM public.ecr.aws/v0a2l7y2/wilco/anythink-backend-node:latest
2 changes: 1 addition & 1 deletion backend/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ app.use(express.static(__dirname + "/public"));

app.use(
session({
secret: "e6F9KvSDf4dyXj",
secret: "secret",
cookie: { maxAge: 60000 },
resave: false,
saveUninitialized: false
Expand Down
2 changes: 1 addition & 1 deletion backend/config/index.js
Original file line number Diff line number Diff line change
@@ -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'
};
5 changes: 5 additions & 0 deletions backend/routes/api/comments.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
const router = require("express").Router();
const mongoose = require("mongoose");
const Comment = mongoose.model("Comment");

module.exports = router;
1 change: 1 addition & 0 deletions backend/routes/api/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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){
Expand Down
9 changes: 5 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand Down
1 change: 1 addition & 0 deletions frontend/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
FROM public.ecr.aws/v0a2l7y2/wilco/anythink-frontend-react:latest
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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?

Expand Down

0 comments on commit ccdda3e

Please sign in to comment.