Skip to content

Commit

Permalink
MongoDB Seeders, Mui DataGrid and migration to v6 (#3)
Browse files Browse the repository at this point in the history
* setup seeder workspace

* db insert done

* apply first migration

* mongo seeders to esm

mongo seeders to esm

* update seeders to read from json file

* def app schema, get dummy data

* update people collection

* wip

* run seeders on db

* create models package

* def person route in express server

* demo setup of people data grid

* mongoose virtuals wip

* integrate seeding DB

* people avatar

* change person avatar

* theming in react-client

* table formatting wip

* wip

* wip

* upgrade mui to v6

* datagrid styling

* add env config in migrate-mongo

* datatable props wip

* grid sizing wip

* wip

* add comments on rowHeight

* wip

* paginate model almost done

* optimize wip

* pagination updated

* CustomNoRowsOverlay

* update rows

* set  filterModel

* debounce filtering and handle edge cases

* def salary in person model, seeder

* check sortKeys typeguard

* filter conditions wip

* date filter conditions eval wip

* date filter conditions done

* starting to test filters

* handle numbers

* clear filters, rm unnecessary filters on virtuals fields

* add cases for virtuals field

* address.houseNo from  number to string

* case insenstivity for "isAnyOf" condition

* fix filter selection issue

* add person page initial setup

* update eslint and rhf-mui, Person form design done

* wip

* person forms setup done

* add person api done

* person crud api done

* code cleanup

* minor changes

* error-boundary component

* fix lint errs

* upgrade turborepo and mui

---------

Co-authored-by: nishant.kohli <[email protected]>
  • Loading branch information
nishkohli96 and nish-kellton authored Dec 17, 2024
1 parent 3e59a71 commit e13136f
Show file tree
Hide file tree
Showing 129 changed files with 6,288 additions and 10,386 deletions.
7 changes: 2 additions & 5 deletions .github/workflows/build-apps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,8 @@ jobs:
- name: Install dependencies
run: yarn

- name: Build @csl/react-express
run: yarn re:build

- name: Build @csl/shared-fe
run: yarn fe:build
- name: Build @csl/react-express, @csl/shared-fe, @csl/mongo-models
run: yarn lib

- name: Build express-server
run: yarn workspace express-server build
Expand Down
2 changes: 1 addition & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
"singleAttributePerLine": false,
"singleQuote": true,
"tabWidth": 2,
"trailingComma": "es5",
"trailingComma": "none",
"useTabs": false
}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ yarn

Build, run, lint or test all your apps in one command thanks to [Turborepo's Pipelines](https://turborepo.org/docs/core-concepts/pipelines)

To Build the shared packages,
To build all the shared packages,

```
turbo lib:build
Expand Down
4 changes: 3 additions & 1 deletion apps/express-server/.env_sample
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
NODE_ENV=
PORT=
PORT=
DB_URL=
DB_NAME=
5 changes: 4 additions & 1 deletion apps/express-server/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,7 @@ $ yarn run start:prod
- upload video as base64 files and combine
- combine video using ***fluent-ffmpeg***
- reading from and writing to a file
- delete file and folder
- delete file and folder
- People API
- CRUD operations
- Advanced filtering using operators from [Mui Datagrid](https://mui.com/x/react-data-grid/)
5 changes: 5 additions & 0 deletions apps/express-server/nodemon.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"watch": ["src/"],
"ext": "js,ts,json,yml,yaml",
"ignore": ["*.test.{js,ts}", "node_modules/"]
}
7 changes: 3 additions & 4 deletions apps/express-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
"private": true,
"scripts": {
"dev": "nodemon --exec 'ts-node -r tsconfig-paths/register src/index.ts'",
"build": "rimraf dist && tsc && tsc-alias",
"build": "tsc && tsc-alias",
"start": "node dist/index.js",
"start:local": "env-cmd -f .env.prod node dist/index.js",
"prod": "yarn build && yarn start",
"seed:db": "node scripts/seed.mjs",
"lint": "eslint --fix ."
},
"dependencies": {
"@csl/mongo-models": "*",
"@csl/react-express": "*",
"cors": "^2.8.5",
"dotenv": "^16.4.4",
Expand All @@ -23,7 +23,7 @@
"winston": "3.11.0"
},
"devDependencies": {
"@nish1896/eslint-config": "^2.1.1",
"@nish1896/eslint-config": "^2.1.2",
"@types/cors": "^2.8.17",
"@types/express": "^4.17.21",
"@types/express-serve-static-core": "^4.19.5",
Expand All @@ -33,7 +33,6 @@
"env-cmd": "^10.1.0",
"eslint": "^8.57.0",
"nodemon": "^3.0.3",
"rimraf": "^5.0.5",
"tsc-alias": "^1.8.10",
"ts-node": "^10.9.2",
"tsconfig-paths": "^4.2.0",
Expand Down
21 changes: 0 additions & 21 deletions apps/express-server/scripts/seed.mjs

This file was deleted.

6 changes: 5 additions & 1 deletion apps/express-server/src/app-constants/env_vars.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,9 @@ const env = process.env;

export const ENV_VARS = Object.freeze({
env: env.NODE_ENV ?? 'development',
port: env.PORT ?? 8000
port: env.PORT ?? 8000,
mongoDB: {
url: process.env.DB_URL ?? 'mongodb://localhost:27017',
dbName: process.env.DB_NAME ?? 'SeederDB'
}
});
4 changes: 3 additions & 1 deletion apps/express-server/src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,13 @@ app.get('/', (_: Request, response: Response) => {
});

app.use(generatePath(ExpressServerEndpoints.files.rootPath), Routes.fileRouter);
app.use(generatePath(ExpressServerEndpoints.people.rootPath), Routes.personRouter);

/* 404 Handler - To be written at last */
/* 404 Handler */
app.get('*', (req: Request, response: Response) => {
const notFoundMsg = `Not Found - "${req.originalUrl}"`;
response.status(404).send(notFoundMsg);
});

export default app;

1,001 changes: 0 additions & 1,001 deletions apps/express-server/src/data/people.csv

This file was deleted.

Loading

0 comments on commit e13136f

Please sign in to comment.