This repository contains a full-stack application template with a frontend built using Vue 3, Vite, and TypeScript, and a backend using Express and TypeORM with PostgreSQL database access.
vite-typeorm-template/
├── express-backend/
│ ├── src/
│ │ ├── entities/
│ │ │ └── user.ts
│ │ └── main.ts
│ ├── package.json
│ └── ormconfig.json
└── vite-frontend/
├── src/
├── package.json
└── README.md
The frontend is developed using Vue 3, Vite, and TypeScript. It provides a modern setup for building reactive user interfaces.
- Vue 3 with Single File Components (SFCs)
- TypeScript for static typing
- Vite for fast development and build
Refer to the Vue Docs TypeScript Guide for recommended project setup and IDE support.
The backend is a simple Express API that connects to a PostgreSQL database using TypeORM.
- Express for handling HTTP requests
- TypeORM for database interaction
- PostgreSQL as the database
The database connection is configured in ormconfig.json
:
{
"type": "postgres",
"host": "localhost",
"port": 5432,
"username": "postgres",
"password": "postgres",
"database": "dev",
"entities": ["src/entities/*.ts"],
"synchronize": true
}
GET /users
: Retrieve all usersPOST /users
: Add a new user
- Node.js and npm
- PostgreSQL
-
Clone the repository:
git clone https://github.com/yourusername/vite-typeorm-template.git cd vite-typeorm-template
-
Install dependencies for both frontend and backend:
cd express-backend npm install cd ../vite-frontend npm install
-
Set up the database:
Ensure PostgreSQL is running and a database named
dev
is created. -
Run the backend:
cd express-backend pnpx tsx src/main.ts
-
Run the frontend:
cd vite-frontend npm run dev
npm start
: Start the Express servernpm test
: Run tests (not specified)
npm run dev
: Start the Vite development servernpm run build
: Build the frontend for production
This project is licensed under the MIT License.