Here's the revised README with TypeScript set to ES2022:
This repository is a boilerplate setup for an application using Express, TypeScript, and Prisma. The project is managed using pnpm, and it uses the latest TypeScript features with ES2022.
- Express: A minimal and flexible Node.js web application framework.
- TypeScript: Superset of JavaScript that adds static types, enhancing code quality and developer experience.
- Prisma: Next-generation ORM for Node.js and TypeScript.
- pnpm: Fast, disk space efficient package manager.
- dotenv: Loads environment variables from a .env file into process.env.
-
Clone the repository:
git clone https://github.com/yourusername/your-repo.git cd your-repo
-
Install dependencies:
pnpm install
-
Build: Compiles TypeScript files.
pnpm run build
-
Start: Runs the compiled JavaScript files.
pnpm start
-
Dev: Runs the application in development mode, watching for file changes.
pnpm dev
The project uses the latest TypeScript features with ES2022
. You can find the TypeScript configuration in tsconfig.json
.
-
Initialize Prisma:
npx prisma init
-
Set up your database connection in the
.env
file. -
Deploy the Prisma schema:
npx prisma migrate dev --name init
- src/: Contains the source code.
- index.ts: The entry point of the application.
import express from "express";
import { PrismaClient } from "@prisma/client";
const app = express();
const prisma = new PrismaClient();
app.use(express.json());
app.get("/", (req, res) => {
res.send("Hello World!");
});
const PORT = process.env.PORT || 3000;
app.listen(PORT, () => {
console.log(`Server is running on port ${PORT}`);
});
Contributions are welcome! Please open an issue or submit a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.
Replace yourusername/your-repo
with your actual GitHub username and repository name. This README provides an overview, setup instructions, and example code to get users started with your boilerplate.