|
1 | 1 | # Zero One Group Monorepo |
2 | 2 |
|
3 | | -## Table of Contents |
4 | | -- [Overview](#overview) |
5 | | -- [Quick Start](#quick-start) |
6 | | - - [Golang application](#golang-application) |
7 | | - - [Local development server](#local-development-server) |
8 | | - - [Creating application from template](#creating-application-from-template) |
9 | | - - [Moon commands](#moon-commands) |
10 | | -- [Monorepo CLI](#monorepo-cli) |
11 | | -- [E2E Testing](#e2e-testing) |
12 | | -- [Managing Dependencies](#managing-dependencies) |
13 | | - - [Updating dependencies](#updating-dependencies) |
14 | | - - [Cleanup projects](#cleanup-projects) |
15 | | -- [Tasks to Complete](#tasks-to-complete) |
16 | | -- [Contributions](#contributions) |
| 3 | +A unified foundation for building modern backend and frontend applications with TypeScript and Go. Powered by [moonrepo](https://moonrepo.dev/docs/install), this monorepo offers curated templates, shared UI libraries, and essential developer tools to accelerate development and foster best practices across teams. |
17 | 4 |
|
18 | | -## Overview |
19 | | - |
20 | | -This repository contains framework projects utilizing [moonrepo][moonrepo] and the technology |
21 | | -stack commonly used within Zero One Group, with TypeScript and Go as the main languages. |
22 | | - |
23 | | -To get started, several templates for backend and frontend applications are available. |
24 | | -The frontend stack includes React with the Vite bundler, as well as Next.js. A shared |
25 | | -UI Library, shadcn/ui, is also provided. |
26 | | - |
27 | | -Additionally, the following tools and libraries are included: |
28 | | - |
29 | | -- **Tailwind CSS** for utility-first CSS framework. |
30 | | -- **Radix UI** for accessible, unstyled UI components. |
31 | | -- **Vitest** for fast unit testing. |
32 | | -- **Playwright** for end-to-end testing. |
33 | | -- **Biome** for code formatting and linting. |
| 5 | +**Motivation:** |
| 6 | +We built this monorepo to accelerate development, promote best practices, and simplify collaboration across teams by providing ready-to-use templates, consistent tooling, and a scalable structure for all Zero One Group projects. |
34 | 7 |
|
35 | 8 | ## Quick Start |
36 | 9 |
|
37 | | -To begin, we suggest installing `moon` globally, read the documentation [here][moonrepo]. |
38 | | -Then, follow these steps (_don't forget to replace `moon-project` with your project name_): |
39 | | - |
40 | | -1. Clone this repository: `pnpm dlx tiged zero-one-group/monorepo moon-project` |
41 | | -2. Install the necessary dependencies: `cd moon-project && pnpm install` |
42 | | -3. Create `.env` file or duplicate the `.env.example` file inside the app or package. |
43 | | - |
44 | | -Find and replace the `myorg` namespace and `example.com` string with your own organization |
45 | | -or project-specific namespace. This is necessary to ensure that all configurations, |
46 | | -dependencies, and references are correctly aligned with your project's unique identifier. |
47 | | -This includes updating any configuration files, package names, and other references |
48 | | -throughout the codebase where `myorg` is used. |
49 | | - |
50 | | -### Golang application |
51 | | - |
52 | | -Currently, Go is not supported as an official moonrepo toolchain. You need to manually |
53 | | -install and configure it for your project. Please read the [Go installation docs][go-docs]. |
54 | | - |
55 | | -For a list of supported toolchains, visit [moonrepo documentation][moon-toolchain]. |
56 | | - |
57 | | -### Local development server |
58 | | - |
59 | | -This repository includes a local development server for testing and development purposes. |
60 | | -Currently, it supports PostgreSQL, Valkey (drop-in replacement for Redis), [mailpit][mailpit] (SMTP server), |
61 | | -and [pgweb][pgweb] (PostgreSQL web interface). |
62 | | - |
63 | | -These commands are used for managing the local development server: |
64 | | - |
65 | | -```sh |
66 | | -pnpm compose:up # Start local development server |
67 | | -pnpm compose:down # Stop local development server |
68 | | -pnpm compose:cleanup # Remove all local development server data |
69 | | -``` |
70 | | - |
71 | | -### Creating application from template |
72 | | - |
73 | | -To get started, you can use the following command to generate a new application from a template. |
74 | | - |
75 | | -```sh |
76 | | -pnpm -s cmd generate:app |
77 | | -``` |
78 | | - |
79 | | -Follow the prompts to create a new application. |
80 | | - |
81 | | -Current available templates are: |
82 | | - |
83 | | -| Template Name | Description | |
84 | | -|-------------------------------------------------------|-------------------------------------------------------| |
85 | | -| [`template-golang`](./template-golang) | Basic Go application for backend | |
86 | | -| [`template-react-app`](./template-react-app) | SPA React Router application with Tailwind CSS | |
87 | | -| [`template-react-ssr`](./template-react-ssr) | SSR React Router application with Tailwind CSS | |
88 | | -| [`template-shared-ui`](./template-shared-ui) | Collections of UI components based on `shadcn/ui` | |
89 | | -| [`template-nextjs`](./template-nextjs) | Next.js application with Tailwind CSS | |
90 | | -| [`template-strapi`](./template-strapi) | Strapi headless CMS with PostgreSQL and Nodemailer | |
91 | | -| [`template-astro`](./template-astro) | Astro website with Tailwind CSS | |
92 | | -| [`template-fastapi-ai`](./template-fastapi-ml) | FastAPI template for AI apps | |
93 | | -| [`template-terragrunt`](./template-terragrunt) | IAC tools for provisioning server | |
94 | | -| [`template-ansible`](./template-ansible) | Ansible for automation and hardening server | |
95 | | -| [`template-load-balancer`](./template-load-balancer) | Load balancer and reverse proxy using Nginx | |
96 | | -| [`template-gitlab-cicd`](./template-gitlab-cicd) | Gitlab CI/CD initiate template | |
97 | | -| [`template-postgresql`](./template-postgresql) | Initial template for database | |
98 | | -| [`template-squidproxy`](./template-squidproxy) | To make egress from one ip in multiple nodes container| |
99 | | -| [`template-monitoring`](./template-monitoring) | Monitoring using LGTV stack | |
100 | | -| [`template-swarm`](./template-swarm) | Swarm configuration for each service | |
101 | | - |
102 | | -### Moon commands |
103 | | - |
104 | | -After setting up your project, use the following commands for common tasks: |
105 | | - |
106 | | -| Command | Description | |
107 | | -|----------------------------|------------------------------------------| |
108 | | -| `moon :dev` | Start developing the project | |
109 | | -| `moon :build` | Build all projects | |
110 | | -| `moon :test` | Run tests in all projects | |
111 | | -| `moon :lint` | Lint code in all projects | |
112 | | -| `moon :format` | Format code in all projects | |
113 | | -| `moon <project_id>:env` | Print system env and individual project | |
114 | | -| `moon <project_id>:<task>` | Run specific task by project | |
115 | | -| `moon check <project_id>` | Run check for individual project | |
116 | | -| `moon check --all` | Run check for all tasks | |
117 | | -| `moon run '#tag:task'` | Run a task in all projects with a tag | |
118 | | -| `moon project-graph` | Display an interactive graph of projects | |
119 | | -| `moon :update-deps` | Update all projects dependencies | |
120 | | - |
121 | | -Type `moon help` for more information. Refer to the [moon tasks documentation](https://moonrepo.dev/docs/run-task) for more details. |
122 | | - |
123 | | -## Monorepo CLI |
124 | | - |
125 | | -The monorepo CLI is a command-line interface for managing and interacting with the monorepo. |
126 | | -It provides a set of commands for common tasks such as creating application secrets, database |
127 | | -migrations, seeders, etc. |
128 | | - |
129 | | -To getting started, you can use the following command: |
130 | | - |
131 | | -```sh |
132 | | -pnpm -s cmd --help |
133 | | -``` |
| 10 | +1. **Clone the repository:** |
| 11 | + `pnpm dlx tiged zero-one-group/monorepo my-monorepo-project` |
| 12 | +2. **Install dependencies:** |
| 13 | + `cd moon-project && pnpm install` |
| 14 | +3. **Generate the application from template:** |
| 15 | + `moon generate TEMPLATE_NAME` |
| 16 | +4. **Configure your environment:** |
| 17 | + copy `.env.example` to `.env` and adjust as needed. |
| 18 | +5. **Start development:** |
| 19 | + run all by running command `moon :dev` or `moon '#app:dev'` |
134 | 20 |
|
135 | | -You can also register your own commands. To do this, you need to create a file in the |
136 | | -[`internal/cmd`](./internal/cmd) directory then register the sub-commands in the |
137 | | -[`cli.ts`](./internal/cli.ts) file. |
| 21 | +## Templates |
138 | 22 |
|
139 | | -## E2E Testing |
| 23 | +This monorepo includes a wide range of templates to help you start new projects quickly and consistently. |
| 24 | +Templates are available for backend (Go, FastAPI), frontend (Astro, Next.js, React), and infrastructure (Strapi, shared UI libraries). |
140 | 25 |
|
141 | | -This monorepo includes E2E tests for testing the application, powered by Playwright. |
142 | | -To run E2E tests, you need to install Playwright dependencies. You can do this by |
143 | | -running the following command: |
| 26 | +Each template is designed to follow best practices and comes with pre-configured tooling, recommended folder structures, and example code to get you up and running fast. |
| 27 | +You can generate new apps from these templates using provided commands, and customize them to fit your needs. |
144 | 28 |
|
145 | | -**Install Playwright dependencies for all projects** |
| 29 | +For the full list of available templates, usage instructions, and customization options, please refer to the [documentation](https://oss.zero-one-group.com/monorepo/available-templates/). |
146 | 30 |
|
147 | | -```sh |
148 | | -moon <project_id>:e2e-install |
149 | | -``` |
| 31 | +## Learn More |
150 | 32 |
|
151 | | -**Install Playwright dependencies for a specific project** |
152 | | - |
153 | | -```sh |
154 | | -moon <project_id>:e2e-install |
155 | | -``` |
156 | | - |
157 | | -Run E2E tests for specific project in headless mode: |
158 | | - |
159 | | -```sh |
160 | | -moon <project_id>:e2e |
161 | | -``` |
162 | | - |
163 | | -If you want to use Playwright UI mode, you can use the following command: |
164 | | - |
165 | | -```sh |
166 | | -moon <project_id>:e2e-ui |
167 | | -``` |
168 | | - |
169 | | -To run E2E test for specific browser, you can use the following command: |
170 | | - |
171 | | -```sh |
172 | | -moon <project_id>:e2e-chrome # Run E2E test for Chrome browser |
173 | | -moon <project_id>:e2e-firefox # Run E2E test for Firefox browser |
174 | | -moon <project_id>:e2e-mobile # Run E2E test for Chrome Mobile browser |
175 | | -moon <project_id>:e2e-safari # Run E2E test for Safari browser |
176 | | -``` |
177 | | - |
178 | | -## Managing Dependencies |
179 | | - |
180 | | -To add a new dependency to a project, you can use the following command: |
181 | | - |
182 | | -```sh |
183 | | -pnpm --filter <project_id> add <dependency> |
184 | | -``` |
185 | | - |
186 | | -Or, if you want to add development dependencies, you can use the following command: |
187 | | - |
188 | | -```sh |
189 | | -pnpm --filter <project_id> add -D <dependency> |
190 | | -``` |
191 | | - |
192 | | -Example: |
193 | | - |
194 | | -```sh |
195 | | -pnpm --filter react-app add -D vitest |
196 | | -``` |
197 | | - |
198 | | -### Updating dependencies |
199 | | - |
200 | | -To update workspace dependencies, you can use the following command: |
201 | | - |
202 | | -```sh |
203 | | -pnpm run update-deps |
204 | | -``` |
205 | | - |
206 | | -### Cleanup projects |
207 | | - |
208 | | -Sometimes it is necessary to clean up dependencies and build artifacts from the project. |
209 | | -To do this, you can use the following command: |
210 | | - |
211 | | -```sh |
212 | | -pnpm run cleanup |
213 | | -``` |
214 | | - |
215 | | -After all, you can reinstall the dependencies and build the project. |
216 | | - |
217 | | -## Tasks to Complete |
218 | | - |
219 | | -After creating a new project from this template repository, ensure you update the documentation, including: |
220 | | - |
221 | | -1. **Project Overview:** Briefly describe the project's purpose and features. |
222 | | -2. **Installation Instructions:** Update steps to reflect any project-specific changes. |
223 | | -3. **Usage Guide:** Provide instructions on how to use the project, including commands and configurations. |
224 | | -4. **API Documentation:** If applicable, update API endpoints, request/response formats, and examples. |
225 | | -5. **Contributing Guidelines:** Reflect any new processes or requirements for contributions. |
226 | | -6. **License Information:** Ensure the license is accurate for the new project. |
227 | | - |
228 | | -Keeping documentation current helps others understand, use, and contribute to the project. |
| 33 | +For complete guides and advanced usage, visit: 👉 [https://oss.zero-one-group.com/monorepo](https://oss.zero-one-group.com/monorepo) |
229 | 34 |
|
230 | 35 | ## Contributions |
231 | 36 |
|
232 | | -Contributions are welcome! Please open a pull requests for your changes and tickets in case you would like to discuss something or have a question. |
233 | | - |
234 | | -Read [CONTRIBUTING.md](./CONTRIBUTING.md) for detailed documentation. |
| 37 | +Contributions are welcome! Please open a pull request or ticket for questions and improvements. |
235 | 38 |
|
236 | | -<!-- link reference definition --> |
237 | | -[go-docs]: https://go.dev/doc/install |
238 | | -[mailpit]: https://mailpit.axllent.org/ |
239 | | -[moon-toolchain]: https://moonrepo.dev/docs/concepts/toolchain |
240 | | -[moonrepo]: https://moonrepo.dev/docs/install |
241 | | -[pgweb]: https://sosedoff.github.io/pgweb |
| 39 | +Read the full guidelines at: 👉 [https://oss.zero-one-group.com/monorepo/contribution-guidelines](https://oss.zero-one-group.com/monorepo/contribution-guidelines) |
0 commit comments