As you can see this project has the following folders:
-
backend
: for the Node TS backend code -
frontend
: for the React TSX / Vite frontend code -
shared
: For any code or interfaces we don't want to duplicate between between thefrontend
andbackend
repos.
-
Enter into
frontend
folder, either by opening the folder in your IDE, or runningcd frontend
-
run
npm install
to install all of the relavent packages.
To run the frontend locally you should be able to run
npm run dev
This should provide the URL required to visualise your frontend code.
For the setup of the backend repo I roughly followed this tutorial.
Note the main difference is our 'models' are stored in the shared folder.
-
Enter into
backend
folder, either by opening the folder in your IDE, or runningcd frontend
-
Run
npm install
To run a development version of the server which restarts each time you edit a file run:
-
npm run dev
-
This is useful if you want to quickly test changes without needing to restart the server.
To run the production version of the server which will simulate what the server will be like whilst it is running, use:
-
npm run start
ornpm start
-
This is for example useful if you want to test if a specific command might crash the server.
These scripts are defined in the package.json file,