This is a boilerplate project designed to easily create full-stack applications. It includes a React frontend and an Express.js backend using TypeORM, structured within a pnpm monorepo.
- Monorepo: Managed with pnpm workspaces for streamlined dependency management and scripting. See here for more info on pnpm.
- Backend:
- Express.js with TypeScript.
- TypeORM for database interaction (pre-configured for MySQL).
- JWT-based authentication (endpoints for registration and login).
- Password hashing using
bcryptjs. - Environment variable management with
dotenv.
- Frontend:
- React with Vite for a fast and modern development experience.
- Node.js (v16 or higher recommended)
- pnpm (Install with
npm install -g pnpmif you haven't already) - A MySQL database instance.
- Fork this repository.
- Clone your forked repository:
git clone <your-repository-url> cd <repository-name>
- Install dependencies from the root directory:
This will install dependencies for all packages in the monorepo.
pnpm install
The backend API requires environment variables for its configuration. Create a .env file in the api/ directory (api/.env) with the following content.
Example .env file:
# MySQL Database Configuration
DB_HOST=localhost
DB_PORT=3306
DB_USERNAME=user
DB_PASSWORD=pass
DB_NAME=database
JWT_SECRET=sample-jwt-secret
# API Port (Optional, defaults to 3001)
# PORT=3001