This is a monorepo project using Turbo and NestJS for building a MongoDB-powered API and a frontend web client developed with React + TypeScript. This project requires docker desktop, node v20+(recommended) to run locally. Please make sure you have them installed on your machine.
- Clone the repository:
git clone https://github.com/shuvro1226/schoolmanagement.git- Install Docker for your operating system (if not installed already). Open up a Terminal session and run:
docker run --name mongo -p 27017:27017 -d mongoMongoDB should be running.
- Install dependencies:
cd schoolmanagement
npm install- To generate local .env file in project root folder run:
npm run createenvTo start the development environment, run the following command:
npm run devThis will launch Turbo in development mode and start the API server at http://localhost:3000/. The GraphQL endpoint is available at http://localhost:3000/graphql and the client server will be running at http://localhost:5173/.
To build the project for production, run the following command:
npm run buildThis will compile the TypeScript code and generate the necessary build artifacts.
To start the API server in production mode, run the following command:
npm run startTo run all tests unit tests for api and client run the following command from project root folder:
npm run testThe same command can be used to run inside api and client folder to run tests only for api and client.
To run all e2e tests for client run the following command from project root folder:
npm run test:e2e- The
appsfolder contains two sub-folders:apiandclient. - The
apifolder contains the backend API code built with NestJS. It has its own package.json, source code in thesrcfolder, and TypeScript configuration in thetsconfig.jsonfile. - The
clientfolder contains the frontend web client code built with React. It also has its own package.json, source code in thesrcfolder, and TypeScript configuration in thetsconfig.jsonfile. - The root folder contains the main package.json, package lock file, and Turbo configuration file.
Please refer to the respective README files inside the api and client folders for more information on setting up and running each component.