A simple script to automatically set up clean Vite+React projects and JSON servers for Full Stack Open course exercises.
It also places executable .bat files inside them to instantly run the project and/or the server.
Place create-project.bat in your course root folder, where your exercise parts are (or will be) located:
fullstack-course/ # Your root folder
├── part1/
├── part2/
└── create-project.bat <-- Put it here!
- Double-click
create-project.bat - Enter the part number (e.g.,
3for part3) - Enter the project name (e.g.,
phonebook) - Choose if you need JSON Server features (Y/N)
- Choose if you want to remove the default
.cssfiles (Y/N)
After you confirm, the script will:
- Create the part folder + README if missing
- Set up a clean Vite+React project
- Remove default template assets (always)
- Optionally remove default
.cssfiles - Install dependencies automatically
- (Optional) Add a JSON Server setup:
- Install the
axiospackage - Create an empty
db.json - Add a
run-json-server.batscript
- Install the
If you created a project called phonebook in part3, you will end up with a structure like this:
fullstack-course/
├── part2/
├── part3/
│ └── README.md
│ └── phonebook/
│ ├── (...)
│ ├── db.json (only if JSON Server was requested)
│ ├── run-json-server.bat (only if JSON Server was requested)
│ └── runweb.bat
│
└── create-project.bat
-
Frontend
Double-clickrunweb.batin the project folder
(Kills existing Vite dev servers on ports 5173 / 5174, then opens the new one in the browser) -
JSON Server
If JSON Server features were enabled, double-clickrun-json-server.bat
(Starts a mock API server on port 3001, watchingdb.json)
- Windows (due to
.batscripts) - Node.js + npm installed and available in your PATH
- Basic understanding of JSON Server (if you choose to enable it)
- Node not recognized: Make sure Node.js and npm are installed and properly configured in your system’s PATH.
- Ports in use: The script attempts to kill existing processes on ports 5173 and 5174 (used by default by Vite). If you still have conflicts, close any existing Node processes manually or reboot.
MIT - Do whatever you want with it!