trt-global-cms
v1.67.0
Published
A blank template to get started with Payload 3.0
Downloads
61
Readme
Readme Top
- We recommend using
pnpm
for managing dependencies in this project.
About The Project
This project is developed to manage and publish content for TRT Global. We utilize PayloadCMS version 3 for content management and various modern technologies for efficient performance and scalability.
Built With
- ![PayloadCMS] http://localhost:3000/admin
Project Structure
The project is organized in a modular structure to maintain scalability and readability. Below is a brief overview of the key directories and their purposes:
app/
: Main application logic.payload/
: Payload CMS configuration and custom functionalities.collections/
: CMS collections and related logic.docker-compose.yml
: Docker setup for development and production environments.
Important Files
payload.config.ts
The main configuration file for PayloadCMS. This file contains the setup for collections, fields, access control, and other settings required for PayloadCMS to function correctly.
/src/app/(app)/layout.tsx
Handles the layout for the main application, including header, footer, and main content area.
/src/app/(payload)/layout.tsx
Manages the layout for the PayloadCMS admin interface.
/src/app/(app)/page.tsx and /src/app/(payload)/page.tsx
These files define the main pages for the application and the PayloadCMS admin interface, respectively.
Scripts Explanation
scripts
in package.json
build
: Builds the project using Next.js.- Command:
pnpm run build
- Explanation: Uses the Next.js builder to compile the project for production.
- Command:
build:css
: Builds CSS using TailwindCSS.- Command:
pnpx tailwindcss build -i ./src/styles/tailwind.css -o ./src/app/styles.css
- Explanation: Processes TailwindCSS and outputs the final CSS file.
- Command:
dev
: Runs the project in development mode.- Command:
pnpm run dev
- Explanation: Starts the development server with hot-reloading.
- Command:
devsafe
: Runs the project in development mode with a clean build.- Command:
pnpm run devsafe
- Explanation: Cleans the build directory before starting the development server.
- Command:
generate:types
: Generates types for PayloadCMS.- Command:
pnpm run generate:types
- Explanation: Creates TypeScript types based on the PayloadCMS schema.
- Command:
lint
: Lints the code using ESLint.- Command:
pnpm run lint
- Explanation: Checks the code for linting errors.
- Command:
lint:fix
: Fixes linting errors.- Command:
pnpm run lint:fix
- Explanation: Automatically fixes linting errors where possible.
- Command:
format
: Formats the code using Prettier.- Command:
pnpm run format
- Explanation: Formats the code according to the Prettier configuration.
- Command:
payload
: Runs PayloadCMS.- Command:
pnpm run payload
- Explanation: Starts the PayloadCMS server.
- Command:
start
: Starts the project.- Command:
pnpm run start
- Explanation: Starts the project in production mode.
- Command:
Commit Guidelines
Commit messages should follow a consistent format to ensure readability and maintainability. Example:
git commit -m "TGMS-0 feat(typesense): add Typesense integration and create repositories
Added Typesense integration to important models like content.
Added various types based on DTO logic.
Created repositories for content, language, strategy, and translate models.
Tested the implementation and it works correctly."
How to Test
How to Install
- Clone the repository:
use ssh:
git clone [email protected]:trt-digital/trt-global-cms.git
- Install dependencies using
pnpm
:
pnpm install
How to Start
- Run the project:
pnpm run dev OR docker-compose up
How to Build
- Build the project:
pnpm run build
- Start the project:
pnpm run start
How to Develop
- Create a new branch:
git checkout -b new-feature
- Make changes to the code.
- Test your changes:
pnpm run dev
- Commit your changes:
git commit -m "new-feature"
- Push your changes to the remote branch:
git push origin new-feature
- Create a pull request on GitHub.
How to Run with Docker
To run the project using Docker, follow these steps:
- Ensure Docker and Docker Compose are installed on your machine.
- Build and run the Docker containers:
docker-compose up --build
This will start all the services defined in the docker-compose.yml
file, including MongoDB and the application itself. 3. For production environment, use the production Docker Compose file:
docker-compose up --build
DevOps
The project uses RabbitMQ and Prisma for database management, with MongoDB as the primary database. Environment variables are managed using YAML files. The development environment is set up using docker-compose.dev
and the production environment using docker-compose
.
Inside the configs
directory, you will find an example configuration file named example.yaml
. This file contains all the necessary environment variable configurations. Make sure to update this file according to your environment settings.
Contact
- Sezer Yıldız - [email protected]
- Sahas Prajapati - [email protected]
- Behrooz Evans - [email protected]
- Ahmet Can Turan - [email protected]
- Omer Alkadri - [email protected]
- Abdullah Obaid - [email protected]