Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/wpcodevo/node_typeorm
In this article, you'll learn how to build CRUD RESTful API with Node.js, ExpressJs, TypeORM, and PostgreSQL. We will define the database schema with TypeORM and run the migration command to push the TypeORM schema to the database. Next, we will create higher-level CRUD function to perform the CRUD operations.
https://github.com/wpcodevo/node_typeorm
crud crud-api jwt jwt-auth jwt-authentication jwt-tokens node node-js nodejs nodemon postgres postgresql postgresql-database restful restful-api typeorm
Last synced: 28 days ago
JSON representation
In this article, you'll learn how to build CRUD RESTful API with Node.js, ExpressJs, TypeORM, and PostgreSQL. We will define the database schema with TypeORM and run the migration command to push the TypeORM schema to the database. Next, we will create higher-level CRUD function to perform the CRUD operations.
- Host: GitHub
- URL: https://github.com/wpcodevo/node_typeorm
- Owner: wpcodevo
- Created: 2022-05-09T20:48:52.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2022-10-15T18:56:34.000Z (about 2 years ago)
- Last Synced: 2024-05-15T15:32:45.177Z (7 months ago)
- Topics: crud, crud-api, jwt, jwt-auth, jwt-authentication, jwt-tokens, node, node-js, nodejs, nodemon, postgres, postgresql, postgresql-database, restful, restful-api, typeorm
- Language: TypeScript
- Homepage: https://codevoweb.com/node-express-typeorm-postgresql-rest-api
- Size: 622 KB
- Stars: 89
- Watchers: 1
- Forks: 50
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# API with Node.js + PostgreSQL + TypeORM
## API with Node.js + PostgreSQL + TypeORM: Project Setup
![API with Node.js + PostgreSQL + TypeORM: Project Setup](https://codevoweb.com/wp-content/uploads/2022/05/API-with-Node.js-PostgreSQL-TypeORM-Project-Setup.webp)
In this article, you'll learn how to set up a Node.js project with TypeScript, ExpressJs, PostgreSQL, TypeORM, and Redis. Also, you will learn how to run Postgres and Redis servers with Docker.
### Topics Covered
- Setup Node.js with Express, PostgreSQL, Redis, and TypeORM
- Creating PostgreSQL and Redis Database with Docker
- Setup Environment Variables with Dotenv
- Initialize a New TypeORM Express App
- Connecting an Express application with PostgreSQL
- Connecting an ExpressJs application to Redis
- Run the Express ServerRead the entire article here: [https://codevoweb.com/api-node-postgresql-typeorm-project-setup](https://codevoweb.com/api-node-postgresql-typeorm-project-setup)
## API with Node.js + PostgreSQL + TypeORM: JWT Authentication
![API with Node.js + PostgreSQL + TypeORM: JWT Authentication](https://codevoweb.com/wp-content/uploads/2022/05/API-with-Node.js-PostgreSQL-TypeORM-JWT-Authentication.webp)
This article will teach you how to implement JSON Web Token (JWT) Authentication with Node.js, PostgreSQL, TypeORM, ExpressJs, Redis, Docker, and Docker-compose. We will implement the assymetric (RS256 algorithm) JSON Web Token authentication manually without using any Node.js authentication library like PassportJs.
### Topics Covered
- List the Node.js API Routes
- User Login and Register Flow with JWT Authentication
- Defining Base and User Entities with TypeORM
- Defining Zod Schemas to Validate Request Body
- Create Middleware to Parse Zod Schema
- Password Management with Bcrypt
- Create Services to Interact with the Database
- Asymmetric Encryption (RS256 algorithm) Json Web Tokens
- Service to Sign Access and Refresh Tokens
- Error Handling in Express
- Create Authentication Route Controllers
- Create User Route Controller
- Create Authentication Middleware Guard
- Create the API Routes
- Authentication Routes
- User Routes
- Add the Routes to the Express Middleware Stack
- Run Database Migrations with TypeORM
- Inspect the Data with VS Code MySQL ExtensionRead the entire article here: [https://codevoweb.com/api-node-postgresql-typeorm-jwt-authentication](https://codevoweb.com/api-node-postgresql-typeorm-jwt-authentication)
## API with Node.js + PostgreSQL + TypeORM: Send Emails
![API with Node.js + PostgreSQL + TypeORM: Send Emails](https://codevoweb.com/wp-content/uploads/2022/05/API-with-Node.js-PostgreSQL-TypeORM-Send-Emails.webp)
In this article, you'll learn how to send development and production-ready emails with Nodemailer, Node.js, PostgreSQL, and TypeORM. We will include the Email verification feature in the API to ensure the users provide valid email addresses during the account registration process.
### Topics Covered
- Setting up Express.js with Pug Templating Engine
- Create a Utility Class to Send Emails
- Require the Nodemailer Credentials
- Define the Email Class Attributes
- Create a Nodemailer Transporter
- Create a Method to Generate the Email Templates
- Create a Method to Send the Emails
- Creating the Email Templates with Pug
- Create the User Entity with TypeORM
- Database Schema Migration with TypeORM
- Update the User Register Controller
- Add a Controller to Verify the Email
- Update the Login ControllerRead the entire article here: [https://codevoweb.com/api-node-postgresql-typeorm-send-emails](https://codevoweb.com/api-node-postgresql-typeorm-send-emails)
## Node.js, Express, TypeORM, PostgreSQL: CRUD Rest API
![Node.js, Express, TypeORM, PostgreSQL: CRUD Rest API](https://codevoweb.com/wp-content/uploads/2022/05/Node.js-Express-TypeORM-PostgreSQL-CRUD-Rest-API.webp)
In this article, you'll learn how to build CRUD RESTful API with Node.js, ExpressJs, TypeORM, and PostgreSQL. We will define the database schema with TypeORM and run the migration command to push the TypeORM schema to the database. Next, we will create higher-level CRUD function to perform the CRUD operations.
### Topics Covered
- Node.js, TypeORM, PostgreSQL CRUD RESTful API Overview
- Project Structure
- Model Data with TypeORM and PostgreSQL
- Define a Base Entity
- Add One-to-Many Relationship to User Entity
- Complete User Entity
- Create a Post Entity
- Create Validation Schemas with Zod
- Create Services to Communicate with Database
- Create Route Controllers
- Create a New Post Controller
- Get a Single Post Controller
- Get All Posts Controller
- Update a Single Post Controller
- Delete a Single Post Controller
- Create Routes with Express
- Add the Routes to the Express Middleware Pipeline
- Run Database Migration with TypeORMRead the entire article here: [https://codevoweb.com/node-express-typeorm-postgresql-rest-api](https://codevoweb.com/node-express-typeorm-postgresql-rest-api)
## Node.js and PostgreSQL: Upload and Resize Multiple Images
![Node.js and PostgreSQL: Upload and Resize Multiple Images](https://codevoweb.com/wp-content/uploads/2022/05/Node.js-and-PostgreSQL-Upload-and-Resize-Multiple-Images.webp)
In this article, you'll learn how to upload and resize single and multiple images with Node.js, TypeScript, Multer, and Sharp. The Node.js API will run on an Express.js HTTP server and use PostgreSQL database.
### Topics Covered
- Upload Single Image With Multer
- Using Multer to Upload a Single Image
- Route Handler Functions
- Upload Single Image with Multer and Sharp
- Using Multer to Upload a Single Image
- Using Sharp to Resize a Single Image
- Create the API Route Handlers
- Upload Multiple Images with Multer and Sharp
- Using Multer to Upload Multiple Images
- Using Sharp to Resize Multiple Images
- Processing a single file
- Processing multiple files
- Create the Route Functions
- Frontend for Uploading Either Single or Multiple ImagesRead the entire article here: [https://codevoweb.com/node-postgresql-upload-resize-multiple-images](https://codevoweb.com/node-postgresql-upload-resize-multiple-images)