Getting Started
Local Development Setup
Getting Started: Local Development Setup
This guide provides step-by-step instructions for setting up the THLSPress monorepo on your local machine for development and contribution.
Prerequisites
Before you begin, ensure you have the following software installed:
- Node.js: LTS version (v18 or newer recommended).
- PNPM: The required package manager for this monorepo. Install it globally:
npm install -g pnpm - Git: For version control.
- Database: A running MySQL server instance.
- Docker (Optional): A
docker-compose.ymlfile can be provided to easily spin up a development database.
Step-by-Step Installation
-
Clone the Repository: Clone the entire monorepo from GitHub to your local machine.
git clone https://github.com/thelolos/thlspress-cms.git cd thlspress-cms -
Configure Environment Variables: The Core CMS (
/cms) requires a.envfile for database credentials and application secrets. Copy the example file and fill in your details.cp cms/.env.example cms/.envOpen
cms/.envand update theDATABASE_URLandNEXTAUTH_SECRETvariables. -
Install All Dependencies: From the root directory of the monorepo (
thlspress-cms/), run thepnpm installcommand.pnpm installPNPM will read the
pnpm-workspace.yamlfile, identify all packages (cms,cli, etc.), and install their dependencies into a single, sharednode_modulesdirectory at the root. -
Synchronize the Database Schema: THLSPress uses Prisma as its ORM. To apply the database schema defined in
cms/prisma/schema.prismato your MySQL database, run the following command from the root:pnpm --filter cms prisma db pushNote: The
--filter cmsflag instructs PNPM to execute the command specifically within thecmspackage. This will create all the necessary tables for the core system. -
Run the Development Server: To start the Next.js development server for the CMS, run the
devscript from the root directory:pnpm devThis command utilizes Turborepo to find and execute the
devscript defined incms/package.json. The application will be available athttp://localhost:3000.
You now have a fully functional local development environment for THLSPress.