An open API service indexing awesome lists of open source software.

https://github.com/ismiljanic/syntaxbase-auth-ticketing-app

This project is part of the SyntaxBase Intermediate Web Development Course. It serves as a hands-on full-stack lab that introduces users to practical concepts such as: Authentication & Authorization (OAuth2), Backend API Development with Node.js, PostgreSQL Integration, User Identification via OpenID Connect and QR Code Generation.
https://github.com/ismiljanic/syntaxbase-auth-ticketing-app

auhtentication auth0 backend frontend nodejs oauth2 openid-connect postgresql qrcode-generator syntaxbase

Last synced: 2 months ago
JSON representation

This project is part of the SyntaxBase Intermediate Web Development Course. It serves as a hands-on full-stack lab that introduces users to practical concepts such as: Authentication & Authorization (OAuth2), Backend API Development with Node.js, PostgreSQL Integration, User Identification via OpenID Connect and QR Code Generation.

Awesome Lists containing this project

README

          

# SyntaxBase – Auth Ticketing App

Full-stack project as part of the **SyntaxBase Intermediate Web Development Course**.

This project serves as a **hands-on lab assignment** within the _Intermediate Web Development_ course on the SyntaxBase platform. The goal is to implement a working web application with user authentication, secure ticket generation using QR codes, and proper backend integration using modern web technologies.

---

## Key Technologies

- **Node.js** – Backend logic and API services
- **EJS** – Server-side HTML templating
- **CSS / HTML5** – UI layout and styling
- **PostgreSQL** – Relational data persistence
- **OAuth2 / OpenID Connect** – Secure authentication and authorization
- **QR Code Generator** – Encoding tickets into scannable codes

---

## Functional Requirements

- A **public homepage** displaying the total number of tickets generated
- An **API endpoint** for ticket generation:
- Accepts JSON input with fields: `ID`, `firstName`, and `lastName`
- A maximum of **3 tickets per ID**
- Each ticket must have a **UUID identifier** from PostgreSQL
- The timestamp of ticket creation must be stored in the database
- On success, returns a **QR code image** encoding a URL with the ticket’s UUID
- The URL must **not contain** any personal data (name, surname, ID)
- Returns **HTTP 400** if required fields are missing or the ID already has 3 tickets
- Returns **HTTP 500** for server/internal errors
- Requires **OAuth2 Client Credentials** authorization (app-level, not user-level)

- A **private ticket info page**, accessible only to authenticated users:
- Displaying ticket details based on UUID in URL
- Page shows the **logged-in user’s name** using **OpenID Connect**

---

## Project Implementation

The project is implemented using **Node.js** in the **VSCode** development environment. It uses the **EJS template engine** to render dynamic HTML and basic **CSS** for styling. Authentication and secure data handling are integrated with **OAuth2** and **OpenID Connect**.

---

## How to Run Locally

### Requirements

- [Node.js](https://nodejs.org/)
- PostgreSQL
- VSCode or another development IDE

### Setup Steps

1. **Clone the repository**
2. Open the project folder in **VSCode**
3. Navigate into the project directory (e.g. `cd syntaxbase-auth-ticketing-app`)
4. Run `ls` and check if `node_modules` exists

5. If not, install dependencies:

```bash
npm install
6. Start the server
``` bash
node server.js

### Note:
You must:
- Set up your own PostgreSQL database
- Create a .env file
- Update Auth0 or your identity provider settings for OAuth2/OpenID integration

## Feature Previews

### Login Screen

### Auth0 Login Flow

### Ticket Generation Form

### QR Code Result

### Ticket Information Page

## License
This project is intended for educational purposes only under the SyntaxBase platform. All rights reserved.