Skip to content

Commit 805cfed

Browse files
refactor: update paths and structure for server services in Docker and documentation (#7333)
- Changed references from 'apiserver' to 'apps/server' in Docker configurations and environment setup. - Updated contributing documentation to reflect the new service structure. - Adjusted setup script to accommodate the new directory layout. - Removed obsolete files related to the previous structure.
1 parent 1de95ef commit 805cfed

File tree

11 files changed

+105
-94
lines changed

11 files changed

+105
-94
lines changed

.github/workflows/build-test-pull-request.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
types: ["opened", "synchronize", "ready_for_review"]
77

88
jobs:
9-
lint-apiserver:
9+
lint-server:
1010
if: github.event.pull_request.draft == false
1111
runs-on: ubuntu-latest
1212
steps:
@@ -17,10 +17,10 @@ jobs:
1717
python-version: "3.x" # Specify the Python version you need
1818
- name: Install Pylint
1919
run: python -m pip install ruff
20-
- name: Install Apiserver Dependencies
21-
run: cd apiserver && pip install -r requirements.txt
22-
- name: Lint apiserver
23-
run: ruff check --fix apiserver
20+
- name: Install Server Dependencies
21+
run: cd apps/server && pip install -r requirements.txt
22+
- name: Lint apps/server
23+
run: ruff check --fix apps/server
2424

2525
lint-admin:
2626
if: github.event.pull_request.draft == false

CONTRIBUTING.md

Lines changed: 50 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ When opening a new issue, please use a clear and concise title that follows this
2525
- For documentation: `📘 Docs: [short description]`
2626

2727
**Examples:**
28+
2829
- `🐛 Bug: API token expiry time not saving correctly`
2930
- `📘 Docs: Clarify RAM requirement for local setup`
3031
- `🚀 Feature: Allow custom time selection for token expiration`
@@ -47,7 +48,7 @@ This helps us triage and manage issues more efficiently.
4748

4849
The project is a monorepo, with backend api and frontend in a single repo.
4950

50-
The backend is a django project which is kept inside apiserver
51+
The backend is a django project which is kept inside apps/server
5152

5253
1. Clone the repo
5354

@@ -105,11 +106,13 @@ To ensure consistency throughout the source code, please keep these rules in min
105106
- **Improve documentation** - fix incomplete or missing [docs](https://docs.plane.so/), bad wording, examples or explanations.
106107

107108
## Contributing to language support
109+
108110
This guide is designed to help contributors understand how to add or update translations in the application.
109111

110112
### Understanding translation structure
111113

112114
#### File organization
115+
113116
Translations are organized by language in the locales directory. Each language has its own folder containing JSON files for translations. Here's how it looks:
114117

115118
```
@@ -122,7 +125,9 @@ packages/i18n/src/locales/
122125
└── [language]/
123126
└── translations.json
124127
```
128+
125129
#### Nested structure
130+
126131
To keep translations organized, we use a nested structure for keys. This makes it easier to manage and locate specific translations. For example:
127132

128133
```json
@@ -137,81 +142,88 @@ To keep translations organized, we use a nested structure for keys. This makes i
137142
```
138143

139144
### Translation formatting guide
145+
140146
We use [IntlMessageFormat](https://formatjs.github.io/docs/intl-messageformat/) to handle dynamic content, such as variables and pluralization. Here's how to format your translations:
141147

142148
#### Examples
149+
143150
- **Simple variables**
144-
```json
145-
{
151+
152+
```json
153+
{
146154
"greeting": "Hello, {name}!"
147-
}
148-
```
155+
}
156+
```
149157

150158
- **Pluralization**
151-
```json
152-
{
159+
```json
160+
{
153161
"items": "{count, plural, one {Work item} other {Work items}}"
154-
}
155-
```
162+
}
163+
```
156164

157165
### Contributing guidelines
158166

159167
#### Updating existing translations
168+
160169
1. Locate the key in `locales/<language>/translations.json`.
161170

162171
2. Update the value while ensuring the key structure remains intact.
163172
3. Preserve any existing ICU formats (e.g., variables, pluralization).
164173

165174
#### Adding new translation keys
175+
166176
1. When introducing a new key, ensure it is added to **all** language files, even if translations are not immediately available. Use English as a placeholder if needed.
167177

168178
2. Keep the nesting structure consistent across all languages.
169179

170180
3. If the new key requires dynamic content (e.g., variables or pluralization), ensure the ICU format is applied uniformly across all languages.
171181

172182
### Adding new languages
183+
173184
Adding a new language involves several steps to ensure it integrates seamlessly with the project. Follow these instructions carefully:
174185

175-
1. **Update type definitions**
176-
Add the new language to the TLanguage type in the language definitions file:
186+
1. **Update type definitions**
187+
Add the new language to the TLanguage type in the language definitions file:
177188

178-
```typescript
179-
// types/language.ts
180-
export type TLanguage = "en" | "fr" | "your-lang";
181-
```
189+
```typescript
190+
// types/language.ts
191+
export type TLanguage = "en" | "fr" | "your-lang";
192+
```
182193

183-
2. **Add language configuration**
184-
Include the new language in the list of supported languages:
194+
2. **Add language configuration**
195+
Include the new language in the list of supported languages:
185196

186-
```typescript
187-
// constants/language.ts
188-
export const SUPPORTED_LANGUAGES: ILanguageOption[] = [
189-
{ label: "English", value: "en" },
190-
{ label: "Your Language", value: "your-lang" }
191-
];
192-
```
197+
```typescript
198+
// constants/language.ts
199+
export const SUPPORTED_LANGUAGES: ILanguageOption[] = [
200+
{ label: "English", value: "en" },
201+
{ label: "Your Language", value: "your-lang" }
202+
];
203+
```
193204

194-
3. **Create translation files**
195-
1. Create a new folder for your language under locales (e.g., `locales/your-lang/`).
205+
3. **Create translation files**
206+
1. Create a new folder for your language under locales (e.g., `locales/your-lang/`).
196207

197208
2. Add a `translations.json` file inside the folder.
198209

199210
3. Copy the structure from an existing translation file and translate all keys.
200211

201-
4. **Update import logic**
202-
Modify the language import logic to include your new language:
212+
4. **Update import logic**
213+
Modify the language import logic to include your new language:
203214

204-
```typescript
205-
private importLanguageFile(language: TLanguage): Promise<any> {
206-
switch (language) {
207-
case "your-lang":
208-
return import("../locales/your-lang/translations.json");
209-
// ...
210-
}
211-
}
212-
```
215+
```typescript
216+
private importLanguageFile(language: TLanguage): Promise<any> {
217+
switch (language) {
218+
case "your-lang":
219+
return import("../locales/your-lang/translations.json");
220+
// ...
221+
}
222+
}
223+
```
213224

214225
### Quality checklist
226+
215227
Before submitting your contribution, please ensure the following:
216228

217229
- All translation keys exist in every language file.
@@ -222,6 +234,7 @@ Before submitting your contribution, please ensure the following:
222234
- There are no missing or untranslated keys.
223235

224236
#### Pro tips
237+
225238
- When in doubt, refer to the English translations for context.
226239
- Verify pluralization works with different numbers.
227240
- Ensure dynamic values (e.g., `{name}`) are correctly interpolated.

ENV_SETUP.md

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ USE_MINIO=1
3636
NGINX_PORT=80
3737
```
3838

39-
## {PROJECT_FOLDER}/apiserver/.env
39+
## {PROJECT_FOLDER}/apps/server/.env
4040

4141
```
4242
# Backend
@@ -63,8 +63,6 @@ AWS_S3_ENDPOINT_URL="http://plane-minio:9000"
6363
AWS_S3_BUCKET_NAME="uploads"
6464
# Maximum file upload limit
6565
FILE_SIZE_LIMIT=5242880
66-
# Settings related to Docker
67-
DOCKERIZED=1 # deprecated
6866
# set to 1 If using the pre-configured minio setup
6967
USE_MINIO=1
7068
# Nginx Configuration
@@ -78,11 +76,15 @@ ADMIN_BASE_URL=
7876
SPACE_BASE_URL=
7977
APP_BASE_URL=
8078
SECRET_KEY="gxoytl7dmnc1y37zahah820z5iq3iozu38cnfjtu3yaau9cd9z"
79+
# RabbitMQ Settings
80+
RABBITMQ_HOST="plane-mq"
81+
RABBITMQ_PORT="5672"
82+
RABBITMQ_USER="plane"
83+
RABBITMQ_PASSWORD="plane"
84+
RABBITMQ_VHOST="plane"
85+
AMQP_URL=""
86+
# Authentication Settings
87+
ENABLE_SIGNUP=1
88+
ENABLE_EMAIL_PASSWORD=1
89+
ENABLE_MAGIC_LINK_LOGIN=0
8190
```
82-
83-
## Updates​
84-
85-
- The naming convention for containers and images has been updated.
86-
- The plane-worker image will no longer be maintained, as it has been merged with plane-backend.
87-
- The Tiptap pro-extension dependency has been removed, eliminating the need for Tiptap API keys.
88-
- The image name for Plane deployment has been changed to plane-space.

aio/Dockerfile-app

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,18 +70,18 @@ ENV PYTHONDONTWRITEBYTECODE=1
7070
ENV PYTHONUNBUFFERED=1
7171
ENV PIP_DISABLE_PIP_VERSION_CHECK=1
7272

73-
COPY apiserver/requirements.txt ./api/
74-
COPY apiserver/requirements ./api/requirements
73+
COPY apps/server/requirements.txt ./api/
74+
COPY apps/server/requirements ./api/requirements
7575

7676
RUN pip install -r ./api/requirements.txt --compile --no-cache-dir
7777

7878
# Add in Django deps and generate Django's static files
79-
COPY apiserver/manage.py ./api/manage.py
80-
COPY apiserver/plane ./api/plane/
81-
COPY apiserver/templates ./api/templates/
79+
COPY apps/server/manage.py ./api/manage.py
80+
COPY apps/server/plane ./api/plane/
81+
COPY apps/server/templates ./api/templates/
8282
COPY package.json ./api/package.json
8383

84-
COPY apiserver/bin ./api/bin/
84+
COPY apps/server/bin ./api/bin/
8585

8686
RUN chmod +x ./api/bin/*
8787
RUN chmod -R 777 ./api/

apps/server/Procfile

Lines changed: 0 additions & 3 deletions
This file was deleted.

apps/server/runtime.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

deploy/selfhost/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ services:
2020
api:
2121
image: ${DOCKERHUB_USER:-local}/plane-backend:${APP_RELEASE:-latest}
2222
build:
23-
context: ./apiserver
23+
context: ./apps/server
2424
dockerfile: ./Dockerfile.api
2525

2626
proxy:

docker-compose-local.yml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -122,18 +122,18 @@ services:
122122

123123
api:
124124
build:
125-
context: ./apiserver
125+
context: ./apps/server
126126
dockerfile: Dockerfile.dev
127127
args:
128128
DOCKER_BUILDKIT: 1
129129
restart: unless-stopped
130130
networks:
131131
- dev_env
132132
volumes:
133-
- ./apiserver:/code
133+
- ./apps/server:/code
134134
command: ./bin/docker-entrypoint-api-local.sh
135135
env_file:
136-
- ./apiserver/.env
136+
- ./apps/server/.env
137137
depends_on:
138138
- plane-db
139139
- plane-redis
@@ -143,56 +143,56 @@ services:
143143

144144
worker:
145145
build:
146-
context: ./apiserver
146+
context: ./apps/server
147147
dockerfile: Dockerfile.dev
148148
args:
149149
DOCKER_BUILDKIT: 1
150150
restart: unless-stopped
151151
networks:
152152
- dev_env
153153
volumes:
154-
- ./apiserver:/code
154+
- ./apps/server:/code
155155
command: ./bin/docker-entrypoint-worker.sh
156156
env_file:
157-
- ./apiserver/.env
157+
- ./apps/server/.env
158158
depends_on:
159159
- api
160160
- plane-db
161161
- plane-redis
162162

163163
beat-worker:
164164
build:
165-
context: ./apiserver
165+
context: ./apps/server
166166
dockerfile: Dockerfile.dev
167167
args:
168168
DOCKER_BUILDKIT: 1
169169
restart: unless-stopped
170170
networks:
171171
- dev_env
172172
volumes:
173-
- ./apiserver:/code
173+
- ./apps/server:/code
174174
command: ./bin/docker-entrypoint-beat.sh
175175
env_file:
176-
- ./apiserver/.env
176+
- ./apps/server/.env
177177
depends_on:
178178
- api
179179
- plane-db
180180
- plane-redis
181181

182182
migrator:
183183
build:
184-
context: ./apiserver
184+
context: ./apps/server
185185
dockerfile: Dockerfile.dev
186186
args:
187187
DOCKER_BUILDKIT: 1
188188
restart: "no"
189189
networks:
190190
- dev_env
191191
volumes:
192-
- ./apiserver:/code
192+
- ./apps/server:/code
193193
command: ./bin/docker-entrypoint-migrator.sh --settings=plane.settings.local
194194
env_file:
195-
- ./apiserver/.env
195+
- .env
196196
depends_on:
197197
- plane-db
198198
- plane-redis

0 commit comments

Comments
 (0)