VanaStack is a modern Fullstack project using Node.js for the backend and React with TypeScript for the frontend. It implements tools like Bun, ESLint, Prettier, and Husky to ensure high code quality and efficient workflows. This project includes a concrete example of interconnection between the backend and frontend.
-
Backend with Node.js:
- Express server.
- Endpoint
/api/message
returning a JSON message. - Complete TypeScript setup with Nodemon for automatic reloads.
-
Frontend with React and Vite:
- API call to the backend to display dynamic data.
- TypeScript configuration with modern development tools.
-
Code Quality:
- Integration of ESLint, Prettier, and Husky for automatic linting before commits.
-
Modern Package Manager:
- Using Bun for improved performance and simplified dependency management.
Before starting, ensure you have:
- Bun: Install Bun
- Git: Download Git
- Node.js (v18 or newer): Download Node.js
- Visual Studio Code: Download VS Code
-
Clone the Git repository:
git clone https://github.com/<your-username>/VanaStack.git cd VanaStack
-
Install backend dependencies and start the server:
cd backend bun install bun run dev
-
Install frontend dependencies and start the UI:
cd ../frontend bun install bun run dev
-
The backend exposes an endpoint at
http://localhost:5000/api/message
which returns:{ "message": "Hello from the backend!" }
-
The frontend consumes this endpoint to display the message in the UI.
To use VanaStack as the base for another project, follow these steps:
git clone https://github.com/<your-username>/VanaStack.git
cd VanaStack
git remote remove origin
- If creating a new repository, initialize it on GitHub or your preferred hosting service. Do not add any initial files (like README).
- Copy the new repository URL (e.g.,
https://github.com/<your-username>/<new-project-name>.git
).
git remote add origin https://github.com/<your-username>/<new-project-name>.git
Verify the new remote configuration:
git remote -v
git push -u origin main
If your branch is named differently, replace main
with your branch name.
If you want to reset the Git history and start fresh:
-
Remove the
.git
directory:rm -rf .git
-
Reinitialize Git and push to the new repository:
git init git remote add origin https://github.com/<your-username>/<new-project-name>.git git add . git commit -m "Initial commit for <new-project-name>" git push -u origin main
bun run dev
: Starts the server with Nodemon.bun run start
: Compiles and runs the backend.
bun run dev
: Starts the UI.bun run lint
: Lints the code with ESLint.bun run lint:fix
: Automatically fixes linting errors.
-
Fork the project.
-
Create a branch for your changes:
git checkout -b feature/your-feature-name
-
Make your changes and commit them:
git commit -m "Add a new feature"
-
Push the branch to the remote repository:
git push origin feature/your-feature-name
-
Open a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.