Skip to content

ma-molinari/node-template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🚀 Node Template API

A boilerplate API built with Node.js to serve as a solid foundation for new projects.

⚙️ Tech Stack

  • Fastify – Fast and low-overhead web framework
  • 🐘 PostgreSQL – Relational database
  • 🧪 Prisma ORM – Type-safe database ORM
  • 🧱 TypeScript – Typed development for better developer experience
  • 🐳 Docker support (optional)

📦 Features

  • 📚 Auto-generated API documentation with Swagger (OpenAPI)
  • 🔐 JWT-based authentication
  • 🚀 High-performance with Fastify
  • 🌱 Scalable architecture and Docker-ready

🔐 Environment Variables

Create a .env file based on the following template:

NODE_ENV=development
PORT=8080
DATABASE_URL=postgresql://user:password@localhost:5432/node-template?schema=public
JWT_SECRET=your_secret
JWT_EXPIRY_SECONDS=3600000

🛠 Common Prisma Commands

# Create and apply a new migration
pnpm prisma migrate dev --name your-migration-name

# Open Prisma Studio to explore and manage your data
pnpm prisma studio

# Generate Prisma Client based on your schema
pnpm prisma generate

# Format your Prisma schema file
pnpm prisma format

# Reset the database and apply all migrations
pnpm prisma migrate reset

# Run migrations on docker container
docker exec -it <container> npx prisma migrate deploy --schema=prisma/schema.prisma

🚀 Getting Started

To run the project locally:

# Clone the repository
git clone https://github.com/ma-molinari/node-template.git

# Enter the project directory
cd node-template

# Install dependencies
pnpm install

# Run database migrations
pnpm prisma migrate dev

# Start the dev server
pnpm dev

About

Node.js API Template | Fastify ⚡ • Prisma ORM • PostgreSQL • TypeScript • Swagger. Arquitetura escalável e tipagem estrita para acelerar o início de novos projetos.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors