Skip to content

Backend RESTful API for movie platform urTicket using NestJS framework, PostgreSQL, TypeScript, TypeORM, Swagger

License

Notifications You must be signed in to change notification settings

plquann/urTicket-backend

Repository files navigation

All-contributors Docker-image CI Code Climate CodeFactor License Hits

🍿 Backend for movie platform urTicket

🚀 Overview

  • Backend RESTful API for movie platform urTicket using Nest (NestJS) is a framework for building efficient, scalable Node.js server-side applications
  • TypeScript - TypeScript is a superset of JavaScript that compiles to plain JavaScript
  • PostgreSQL - Relational Database is used for database management
  • Docker - Containerization is used for deployment
  • TypeORM - TypeORM is a library for Node.js that helps you to work with your database using TypeScript
  • Swagger - Swagger is a tool for documenting RESTful APIs

⚡ What I've learned:

  • Modular architecture, Design pattern, takes advantage of latest JavaScript features with NestJS
  • A REST API is an application programming interface that conforms to specific architectural constraints, like stateless communication and cacheable data. It is not a protocol or standard, but a set of rules for how to communicate with a server.
  • Using SQL techniques and common commands (INSERT INTO, WHERE, ORDER BY, ON DELETE CASCADE, etc) will enable you to create tables, column types and define the schema of your data in PostgreSQL
  • Data modeling and how to represent one-to-one, one-to-many and many-to-many relationships in PostgreSQL.
  • Full-text search in PostgreSQL using PostgreSQL's full-text search functions.
  • Make the managing of a database more convenient, we use an Object-relational mapping (ORM) tool called TypeORM.
  • Build a Payment method using Stripe API
  • Implementing in-memory cache to increase the performance with Redis
  • The OpenAPI specification with Swagger which supports by Swagger plugin in NestJS
  • How to build and deploy a Docker image with Dockerfile, optimization of Dockerfile, and how to use Docker Compose to deploy multiple Docker images
  • Deployment to Digital Ocean droplets using Nginx - reverse proxy and SSL
  • Implement a modern CI/CD pipeline with GitHub Actions and Docker

🚒 Check out my Frontend side:

https://github.com/QuanKhs/urTicket-frontend

🌋 Folder structure

Click to expand

✨ Installations

  • With Docker

  1. Install Docker and Docker compose (from the Docker website)

  2. Fork and clone the urticket-backend repo (see Contributing page)

    git clone https://github.com/QuanKhs/urTicket-backend.git
  3. From the src folder run:

    docker-compose -f docker-compose.prod.yml
  4. Open a browser to see the application running

    http://localhost:5000/api/v1/doc/#
  5. To shutdown the application run:

    docker-compose down
  • Without Docker (for development/debugging)

  1. Fork and clone the urticket-backend repo (see Contributing page)

    git clone https://github.com/QuanKhs/urTicket-backend.git
  2. Install dependencies & add them to your path:

  1. Create a new PostgreSQL database: you can find urticket.sql in the initialize-postgres folder
  1. Start the urticket-backend server:

    npm install
    npm run start
  2. (Optional) Start Node services by running npm run start:dev to start the Node services in development mode:

    npm run start:dev

🏳‍🌈 Release

  1. Docker hub: Docker image

  2. Server: Server

🥇Contributors


Quankhs

💡 👨‍💻 💭 🐛 😩 👿

🤝 Contacts and social networks

Facebook GitHub Gmail Linkedin: quankhs

About

Backend RESTful API for movie platform urTicket using NestJS framework, PostgreSQL, TypeScript, TypeORM, Swagger

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages