Skip to content

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.

License

Notifications You must be signed in to change notification settings

ismiljanic/Syntaxbase-auth-ticketing-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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
  • 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:

    npm install
  6. Start the server

    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.

About

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.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published