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

[CHE-193] Create and Seed Mongo Container for Dev #145

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
101f3bc
add mongo dev service
seantokuzo Jun 14, 2024
f8e3d0c
sloppy seed
seantokuzo Jun 14, 2024
56c01cc
delete all temp data generation files
seantokuzo Jun 15, 2024
fb1430d
update to include mongo dev container
seantokuzo Jun 15, 2024
4e3c657
add dev db seeding data and scripts
seantokuzo Jun 15, 2024
443c2ea
add mongo-init folder to eslint ignores
seantokuzo Jun 15, 2024
a785590
add env vars - no need for .env file - add version back for dev branc…
seantokuzo Jun 15, 2024
9af3373
dev branch pull and merge
seantokuzo Jun 15, 2024
1ad99f1
reorder service definitions for consistency
seantokuzo Jun 15, 2024
e3a1caa
add s3 presignURL bypass on profile pic in dev mode
seantokuzo Jun 19, 2024
8977de3
update seed data
seantokuzo Jun 19, 2024
ee93c24
Merge branch 'dev' of https://github.com/Code-Hammers/code-hammers in…
seantokuzo Jun 20, 2024
3271166
CHE-193 Adjusted core user ID's
brok3turtl3 Jun 20, 2024
7516493
CHE-193 Aligning ID's between PostgreSQL and MongoDB seeders
brok3turtl3 Jun 20, 2024
79ee0f7
update mock data with predefined (and pg friendly) test user ids
seantokuzo Jun 21, 2024
9cbfa4b
Merge branch 'CHE-193/subtask/Create-and-Seed-Mongo-Container-for-Dev…
seantokuzo Jun 21, 2024
93ba682
delete mock data for rewrites
seantokuzo Jun 21, 2024
a63d409
regenerate mock data with predefined (and pg friendly) test user ids
seantokuzo Jun 21, 2024
894288b
Merge branch 'dev' of https://github.com/Code-Hammers/code-hammers in…
seantokuzo Jun 21, 2024
4855c6f
update for IS_SK bypass bypass
seantokuzo Jun 21, 2024
bf03c76
remove AWS credential placeholders from env vars
seantokuzo Jun 21, 2024
bba10e6
remove AWS credential env var checks from server startup
seantokuzo Jun 21, 2024
4ee6c88
fix status codes for dev S3 pfp signedUrl bypass
seantokuzo Jun 21, 2024
1273942
fix status code and add log / comments for working on pfp route
seantokuzo Jun 21, 2024
24b4e8b
add comments about pfp S3 bypass
seantokuzo Jun 21, 2024
778f5f3
CHE-193 Re-aligned user id's for seeders
brok3turtl3 Jun 21, 2024
8ff6767
all in a days work
seantokuzo Jun 21, 2024
7a3d399
Merge branch 'CHE-193/subtask/Create-and-Seed-Mongo-Container-for-Dev…
seantokuzo Jun 21, 2024
5642918
add back AWS env vars supplied from .env with comments
seantokuzo Jun 21, 2024
68437d1
add polite & helpful comments to pfp upload thunk
seantokuzo Jun 21, 2024
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
5 changes: 5 additions & 0 deletions client/src/features/userProfile/userProfileSlice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ export const uploadProfilePicture = createAsyncThunk(
'Content-Type': 'multipart/form-data',
},
});
if (process.env.NODE_ENV === 'development') {
console.log('💰 Woah there, that ish costs money 💰');
console.log('❓❓Did Big Sean approve you to tax his AWS account❓❓');
console.log("I didn't think so, get outta here");
}
return response.data;
} catch (error) {
let errorMessage = 'An error occurred during profile picture upload';
Expand Down
38 changes: 33 additions & 5 deletions docker-compose-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,34 @@ services:
container_name: ch-dev
ports:
- '8080:8080'
- '3000:3000'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

volumes:
- .:/usr/src/app
- node_modules:/usr/src/app/node_modules
- client_node_modules:/usr/src/app/client/node_modules
command: npm run dev-ts
environment:
- PORT=3000
- NODE_ENV=development
- JWT_SECRET=fakeDevelopmentSecret
- MONGO_URI=mongodb://root:rootPass@ch-mongo-dev:27017/ch-testdb
- DATABASE_URL=postgres://codehammers:ch-dev@postgres:5432/ch-dev-database
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=ch-dev
- POSTGRES_DB=ch-dev-database
- AWS_ACCESS_KEY_ID=placeholder-value
- AWS_SECRET_ACCESS_KEY=placeholder-value
- AWS_REGION=placeholder-value
- BUCKET_NAME=placeholder-value
# AWS credentials and IS_SK environment variables are retrieved from .env file
# Leave AWS credentials undefined unless approved to work on profile picture routes by Big Sean
- AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID}
- AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY}
- AWS_REGION=${AWS_REGION}
- BUCKET_NAME=${BUCKET_NAME}
- IS_SK=${IS_SK}
# suppress aws sdk v2 deprecation warning
- AWS_SDK_JS_SUPPRESS_MAINTENANCE_MODE_MESSAGE=1;
depends_on:
- postgres
- ch-mongo-dev
command: npm run dev-ts

postgres:
image: codehammers/postgres-dev:latest
container_name: codehammers-postgres
Expand All @@ -35,7 +44,26 @@ services:
- postgres-data:/var/lib/postgresql/data
ports:
- '5432:5432'

ch-mongo-dev:
image: mongo
container_name: ch-mongo-dev
restart: always
ports:
- 27017:27017
environment:
- MONGO_INITDB_DATABASE=ch-testdb
- MONGO_INITDB_ROOT_USERNAME=admin
- MONGO_INITDB_ROOT_PASSWORD=adminpassword
- MONGO_HOST=ch-mongo-dev
- MONGO_USER=root
- MONGO_USER_PWD=rootPass
volumes:
- ./scripts/db/mongo-dev-init/:/docker-entrypoint-initdb.d
- mongo-dev-volume:/data/db
command: mongod --quiet --logpath /dev/null
volumes:
node_modules:
client_node_modules:
postgres-data:
mongo-dev-volume:
4 changes: 0 additions & 4 deletions docker-compose-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@ services:
- POSTGRES_USER=postgres
- POSTGRES_DB=ch-dev-database
- POSTGRES_PASSWORD=ch-dev
- AWS_ACCESS_KEY_ID=placeholder-value
- AWS_SECRET_ACCESS_KEY=placeholder-value
- AWS_REGION=placeholder-value
- BUCKET_NAME=placeholder-value
# suppress aws sdk v2 deprecation warning
- AWS_SDK_JS_SUPPRESS_MAINTENANCE_MODE_MESSAGE=1;
command: npm run test:all
Expand Down
8 changes: 7 additions & 1 deletion eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,13 @@ module.exports = [
},
// Files/Directories to be ignored by ESLint
{
ignores: ['**/node_modules/', 'coverage/', '**/build/', '**/dist/'],
ignores: [
'**/node_modules/',
'coverage/',
'**/build/',
'**/dist/',
'**/scripts/db/mongo-dev-init',
],
},
// ESLint Recommended Configuration
{
Expand Down
Loading
Loading