Teolohiya.site

A live, moderated book-listing platform where readers across the Philippines discover Christian theological books and contact sellers directly.

Status
Live at teolohiya.site
Region
AWS Singapore, ap-southeast-1
Frontend
Next.js App Router, TypeScript, Tailwind CSS
Backend
AWS Amplify Gen 2, serverless

The public repository documents the product, architecture and engineering decisions. The production source code is kept in a private repository.

The live homepage and recent listingsteolohiya.site

Why it exists

Christian books in the Philippines are scattered across marketplaces, social groups and individual sellers. Teolohiya.site brings the listings into one searchable place.

It began as hands-on practice while I studied for cloud certifications and grew into a deployed, production-oriented AWS application. It is a discovery platform, not a checkout service: payment, delivery and seller arrangements happen outside the site.

A member lists a bookstaff review itapproved books become publicreaders contact the seller

Who can do what

Capabilities by role
RoleCapabilities
VisitorsBrowse approved books, search and filter listings, view photos and seller details, and report listings.
MembersSign up with Cognito, create and manage listings, upload up to five photos, track review status and resubmit rejected listings.
ModeratorsReview pending listings and photos, approve or reject with reasons, handle reports and remove listings.
AdminsFind registered users, manage moderator permissions, review reports, inspect audit logs and perform logged administrative reviews.

The application

Homepage with search and listing actions
Homepage and search
Book categories and recently listed book cards
Categories and recent listings
Book detail page with photos, price, condition and seller contact
Book details and direct seller contact
Create a listing form with category, condition, location and contact fields
Create a listing
Admin team management page with account search and role overview
Admin team and roles, account email redacted
Community guidelines covering transactions, safety, copyright and theological standards
Community guidelines and safety

Architecture

Serverless and usage-priced end to end: no always-on compute and no NAT gateway, deployed from GitHub through Amplify to ap-southeast-1.

Teolohiya.site architecture Users reach Amplify Hosting with CloudFront for the Next.js app, Amazon Cognito for sign-in, AWS AppSync for the GraphQL API and Amazon S3 for photo uploads. AppSync reads and writes a private DynamoDB model and a public DynamoDB model, and invokes AWS Lambda. Lambda handles moderation and admin actions against both DynamoDB models, Cognito and S3. Readers, sellersand staff, in the browser Amplify HostingNext.js · CloudFront · ACM Amazon CognitoSign-in, groups, roles AWS AppSyncGraphQL API Amazon S3pending/ and approved/ photos AWS LambdaModeration, admin actions DynamoDB, privateListings, reports, audit DynamoDB, publicApproved listings only
Request paths between services. The public table, in sage, only ever receives sanitised copies written by Lambda.

How the services work together

  1. Amplify Hosting and CloudFront serve the Next.js site over HTTPS with an ACM certificate on the custom domain.
  2. Cognito authenticates users and sets permissions through groups and IAM roles.
  3. The frontend reads and writes listing data through AppSync, backed by DynamoDB.
  4. Sellers upload photos to S3 under restricted paths; Lambda handles approval and publishing.
  5. CDK and CloudFormation manage infrastructure changes; IAM Identity Center and AWS Budgets cover secure access and cost.

AWS services and how each got there

Amplify Gen 2 provisions and manages several of these. They are listed separately to show their roles, not to suggest each was configured from scratch.

AWS services used by Teolohiya.site, their role, and how they are provisioned
ServiceRole in Teolohiya.siteProvisioned through
AWS Amplify Hosting (Gen 2)Hosts the Next.js app, connects GitHub deployments, manages the backend infrastructure.Amplify
Amazon CloudFrontDelivers the hosted site through a CDN.Managed by Amplify
AWS Certificate ManagerTLS certificate for HTTPS on the custom domain.Managed HTTPS via Amplify
Amazon CognitoRegistration, email sign-in, identities, moderator and admin groups, role-based access.Amplify Gen 2 backend
AWS AppSyncGraphQL API the frontend uses for listings and related operations.Amplify Gen 2 backend
Amazon DynamoDBPrivate listings, approved public listings, reports and moderation audit records.Amplify Gen 2 backend
Amazon S3Uploaded book photos, pending images kept apart from approved ones with scoped access.Amplify Gen 2 backend
AWS LambdaTrusted moderation and admin actions: approval, rejection, removal, role management.Amplify Gen 2 backend
CloudFormation and CDKDefine and deploy the backend resources as infrastructure as code.Used by Amplify
AWS IAMLeast-privilege permissions for application roles and deployment access.Amplify and account
AWS IAM Identity CenterSSO access to AWS without long-lived user access keys.AWS account
AWS BudgetsCost alerts and spending visibility for the account.AWS account

Moderation and security

Listings are private until approved. The browser cannot approve a listing or write protected moderation fields.

Listing lifecycle

Listing state transitions
FromToWhen
NewPendingMember submits a listing
PendingApprovedStaff approves
PendingRejectedStaff rejects with a reason
RejectedPendingSeller edits and resubmits
ApprovedPendingSeller makes a significant edit
ApprovedRemovedStaff removes it
ApprovedSoldSeller marks it sold
PendingWithdrawnSeller withdraws it

Engineering decisions

Release discipline: strict TypeScript, ESLint, production builds, sandbox testing, explicit deployment confirmation, and rollback plans that account for database schema changes.

Challenges and the approach taken
ChallengeApproach
Keep unreviewed listings out of public viewSeparate Listing and PublicListing models, with Lambda-controlled publication
Stop client-side approval or role escalationProtected fields, server-side group checks and scoped IAM permissions
Avoid approving outdated contentVersion-aware moderation using optimistic locking
Ship changes without losing production dataAmplify sandbox testing, guarded releases and staged schema migrations
Keep running costs proportional to usageServerless, usage-based services; no always-on compute or NAT gateway

Lessons learned

  • Authorisation spans services. Cognito group membership alone is not enough; IAM and S3 permissions have to match each role.
  • Moderation is a backend concern. Protected state changes belong on the server, not in requests the browser controls.
  • Schema changes need deliberate rollouts. Reverting to an older backend build can be unsafe once newer data models exist.
  • Small production safeguards matter. Audit logs, version checks, scoped uploads and release gates make a real difference.

Next steps

  • Listing view and contact-click metrics
  • Branded verification emails with Amazon SES
  • Better indexing and server-rendered book pages
  • Optional image screening to assist, not replace, manual review