This starter template is an npm workspaces TypeScript monorepo that contains a TypeScript client app and an Express server app. The client uses Vite, which is a development server and bundler. The server uses Express.
The following npm packages were added to the backend:
expresszodcorsdotenv
Install the dependencies in the root, frontend and backend, by running the following command from the root directory:
npm run install-allRun the local dev servers for the frontend and backend using the following command:
npm run devThis runs the frontend and backend apps concurrently using the npm package concurrently.
You can access the frontend app at http://localhost:5173 and the backend app at http://localhost:1337.
If you open the frontend app in your browser, you'll see a blank white page.
To add an npm package to the correct app, use the --workspace flag with the npm install command. For example, to add the zod npm package to the backend, use the following command from the root directory:
npm install zod --workspace=backend