This is a template for fullstack TypeScript projects. It is designed to be used with both client and server directories contained within a single repository. The client-side code is written in TypeScript and utilizes Node.js for server-side development.
Bundling of the project is handled using Rollup, a module bundler for JavaScript which allows for efficient code splitting and optimization. Additionally, BrowserSync is integrated into the project to provide live reloading and synchronization across multiple devices during development.
-
Install all npm packages required for both the client and server directories by running the following command:
npm run install
-
Once the packages are installed, you can concurrently run the frontend and backend of the project using Browsersync with watch options. This command will start the development server and open your default browser:
npm start
-
In the console log, you will see the port number on which the server is running. Copy this port number.
-
Navigate to the
client > src
directory and locate theenv-config.json
file. Open the file and find the port variable. Paste the previously copied port number as the value for the port variable.
In addition to the main script for installation and running the project (npm run install and npm start), the following scripts are available:
install:client
- This script can be used to install the client-directory dependencies individually.install:server
- This script can be used to install the server-directory dependencies individually.
You can run these scripts when you specifically need to install dependencies for either the client or server directories separately.