Skip to content

Latest commit

 

History

372 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Build Status Vercel License Stars

Pagbutlak Website

Official website of Pagbutlak UPV

About The Project

Official website for the student and community publication of CAS in UP Visayas, Pagbutlak. It publishes articles across News, Opinion, Features, and Kultura.

Getting Started

Prerequisites

  • Node.js (recommended to use nvm)
  • pnpm
  • PostgreSQL (optional, only for local manual setup)
  • Docker (optional, only for Docker setup)

Installation

  1. Clone the repository
  2. cp .env.example .env to copy the example environment variables

Option 1: Local (Manual Setup)

  1. Create a local PostgreSQL database.
  2. pnpm install to install dependencies
  3. pnpm dev start the dev server

Option 2: Docker

  1. Start the services

    docker compose up

Usage

  1. Open http://localhost:3000 to open the app in your browser
  2. Go to http://localhost:3000/admin to open the admin panel
  3. Seed the database using one of the options below.

Seeding the Database

Seeding is destructive: it clears existing content in the seeded collections and repopulates them with demo data. Only run it against a database you're OK resetting.

  • Admin UI: with the app running and an admin user logged in, click "Seed your database" on the admin dashboard.
  • CLI: requires at least one existing user in the users collection (create one via the admin panel first).
    pnpm seed
    # or inside Docker
    docker compose exec payload pnpm seed

The CLI uses DATABASE_URI from your .env, so it can seed any environment you point it at. Export the S3_* vars too if that environment serves media from S3.

Testing

Layer Tool Location
Unit Vitest src/**/*.spec.ts
Integration Vitest + Payload Local API tests/int/**/*.int.spec.ts
E2E Playwright tests/e2e/**/*.e2e.spec.ts
pnpm test       # everything: unit + integration, then E2E
pnpm test:int   # unit + integration only (needs a running Postgres, same DATABASE_URI as the app)
pnpm test:e2e   # E2E only (needs Playwright browsers: pnpm exec playwright install chromium)

Inside Docker, run integration tests with docker compose exec payload pnpm test:int.

Add unit tests next to the source as *.spec.ts, integration tests to tests/int/, and E2E tests to tests/e2e/.

Contributing

Contributions are welcome!

See CONTRIBUTING.md for more information.

License

Distributed under the Apache License 2.0.

Acknowledgments

About

Official website of Pagbutlak UPV

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

4 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages