This monorepo contains the following packages:-
@bupd/client
: Next.js client package for BUPD@bupd/seeder
: Database seeder package for BUPD@bupd/server
: Node.js Express server package for BUPD@bupd/types
: Typescript type definition package for BUPD@bupd/validation
: Payload validation package for BUPD@bupd/constants
: Shared constants packagenode -v
and check the version14
go here to download the required versionnpm
is installed using npm -v
(It should be installed along side node.js)npm install
to install shared dependenciesnpm run bootstrap
to install package dependencies and symlink binariesnpm run build
to build all packages except the client using typescript
npm run lint
to lint all packages using eslint
npm run test
to run tests for all packages using jest
npm run build:watch
to starting building in watch modecd packages/server
and start the server using npm run start
cd packages/seeder
and run the following commands
npm run create-db <db-name>
to create a database with all the tablesnpm run seeder
to generate and populate database with random datapolices.json
file generated in packages/seeder/dist/polices.json
to view the info about the generated police.cd packages/client
and start the client using npm run dev
Before proceeding further please make sure you create the .env
files
.env
folder in root directoryseeder.env
and .env
thereseeder.env
store these variables
ADMIN_PASSWORD
: Password of admin userADMIN_EMAIL
: Email of admin user.env
store these variables
DATABASE_PASSWORD
: Mysql database passwordDATABASE_USER
: Mysql Database userDATABASE_HOST
: Mysql database hostDATABASE_NAME
: Mysql database nameSERVER_PORT
: Express server portPASSWORD_SALT
: Password salt used when hashingJWT_SECRET
: Jwt secretA sample .env
directory
We tried to maintain a specific git workflow in this project.
prod
and staging
branchesstaging
to work on their tasksstaging
branch and add other members to review itstaging
branch
staging
branch.staging
branch, the owner will create a PR from staging
to prod
branchdigitalocean droplet
vercel
project.server
: Our server is deployed on a digitalocean dropletclient
: Our client is deployed on a vercel hobby plan projectNOTE: We are hosting our database on the same droplet as the server
We are using a few shared dependencies across the monorepo to avoid installing same npm packages multiple times
tsc
: typescript compilerjest
: Javascript test runnereslint
: Javascript/Typescript linterdel-cli
: Package to delete directoriesnodemon
: Package to automatically restart node processlerna
: Javascript framework to maintain multi-package repositories (monorepo)