Skip to content

Commit 693aea4

Browse files
authored
Updates: (#24)
- Rename repo to `base-app-monorepo` to reflect what it is now - Update scripts - `client-seo`: move `pages` to inside `src` since next 9.3.4 supports it - Rename folders in `common` to use dashes instead of camel case
1 parent ab2c1c9 commit 693aea4

File tree

154 files changed

+1787
-1189
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

154 files changed

+1787
-1189
lines changed

.env

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# GENERAL
2-
SERVER_NAME=https://bra.com.vm
3-
MAIN_SERVER_NAME=bra.com.vm
4-
GRAPHQL_ENDPOINT=https://bra.com.vm/graphql
2+
SERVER_NAME=https://bam.com.vm
3+
MAIN_SERVER_NAME=bam.com.vm
4+
GRAPHQL_ENDPOINT=https://bam.com.vm/graphql
55

66
# AWS
77
AWS_S3_IMAGES_GET_SIGNED_URL='' # Endpoint to sign URL to upload to S3
@@ -15,7 +15,7 @@ JWT_SECRET=SUPER_SECRET_JWT
1515
PRISMA_SERVICE_NAME=prisma
1616
PRISMA_SECRET=PrismaSecret
1717
PRISMA_PORT=4466
18-
PRISMA_ENDPOINT=http://prisma:4466/bra/dev
18+
PRISMA_ENDPOINT=http://prisma:4466/bam/dev
1919

2020
# SERVER
2121
SERVER_SERVICE_NAME=server

.gitattributes

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
client/src/routes/**/*.* linguist-generated
2+
client-seo/src/routes/**/*.* linguist-generated
3+
server/src/routes/**/*.* linguist-generated

README.md

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Base React App
1+
# Base App Monorepo
22

33
Note: This setup is for Mac, you will have to do the equivalent if you use Linux or Windows
44

@@ -29,13 +29,13 @@ More on how it works [here](./docs/INIT.md)
2929
We use Docker machine since it gives us better performance compared to Docker for Mac. We create the machine and DNS resolver using the following command:
3030

3131
```
32-
$ bra vm-up
32+
$ bam vm-up
3333
```
3434

3535
Then, we switch into the docker-machine environment by running:
3636

3737
```
38-
$ eval $(docker-machine env bra)
38+
$ eval $(docker-machine env bam)
3939
```
4040

4141
Running `docker` commands should now work. For example:
@@ -49,40 +49,34 @@ $ docker ps
4949
To keep things simple, we do not share common components/functions/settings via published npm packages. Instead, `/common` serves as the place where commons live. When changes happen in source folders, they would get copied into target folders. Settings can be found and extended [here](./common/watcher.js#L13-L20). To start, run the following:
5050

5151
```
52-
$ bra ws common:watch
52+
$ bam ws common:watch
5353
```
5454

5555
#### Turn on the containers the first time
5656

5757
```
58-
$ bra build
59-
$ bra up
58+
$ bam build
59+
$ bam up
6060
```
6161

6262
Once they have successfully built, go to the following URL from your favourite browser:
6363

6464
```
65-
https://bra.com.vm/
65+
https://bam.com.vm/
6666
```
6767

6868
#### Generate dummy data
6969

7070
Here's the script to generate some dummy data to get started!
7171

7272
```
73-
$ bra init-data
74-
```
75-
76-
#### Start containers without building
77-
78-
```
79-
$ bra start
73+
$ bam init-data
8074
```
8175

8276
#### Turn off everything
8377

8478
```
85-
$ bra vm-down
79+
$ bam vm-down
8680
```
8781

8882
### Routing
@@ -92,7 +86,7 @@ It is easy to make mistake when routing between multiple apps. Inner-app routing
9286
The config can be found [here](./route-manager/route-codegen.yml). After making changes, run the following to generate route modules:
9387

9488
```
95-
bra ws routegen
89+
bam ws routegen
9690
```
9791

9892
Read more about [route-codegen](https://github.com/eddeee888/route-codegen)

TODO.md

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

bin/core.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/bash
22

33
# We are running this from /usr/local/bin
4-
CORE_CMD_NAME="bra"
4+
CORE_CMD_NAME="bam"
55

66

77
function display_help(){

bin/dm-create.sh

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,11 @@
11
#!/bin/bash
22

33
function dm_create(){
4-
local cmd_create="docker-machine create --driver=virtualbox --virtualbox-cpu-count=2 --virtualbox-memory 4096 --virtualbox-disk-size=100000 $1"
4+
local cmd_create="docker-machine create --driver=virtualbox --virtualbox-cpu-count=4 --virtualbox-memory 8192 --virtualbox-disk-size=100000 $1"
55
echo "*** Creating new docker machine called \"$1\"..."
66
echo $cmd_create
77
eval $cmd_create
88

9-
local cmd_increase_watchers="docker-machine ssh $1 'echo fs.inotify.max_user_watches=1048576 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p'"
10-
echo "*** Increasing IO Notify watch limit on docker machine"
11-
echo $cmd_increase_watchers
12-
eval $cmd_increase_watchers
13-
149
echo ""
1510
echo "Docker machine \"$1\" can now be used!"
1611
echo ""

bin/utils/constants.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#!/bin/bash
22

3-
CORE_CMD_NAME="bra"
3+
CORE_CMD_NAME="bam"
44
USR_BIN="/usr/local/bin"
5-
COMMON_NAME="bra.com.vm"
5+
COMMON_NAME="bam.com.vm"
66
TOP_LEVEL_DOMAIN="vm"
77
DNS_PORT=53535
88
DNS_CONTAINER_NAME="${TOP_LEVEL_DOMAIN}-dnsmasq"

bin/vm-up.sh

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,18 @@ function create_resolver_file {
7474
echo "---"
7575
}
7676

77+
function increase_watchers {
78+
local cmd_increase_watchers="docker-machine ssh $CORE_CMD_NAME 'echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p'"
79+
echo "*** Increasing IO Notify watch limit on docker machine"
80+
echo ""
81+
echo $cmd_increase_watchers
82+
eval $cmd_increase_watchers
83+
echo ""
84+
echo "---"
85+
}
86+
7787
start_docker_machine
7888
docker_machine_env
7989
set_up_dnsmasq
80-
create_resolver_file
90+
create_resolver_file
91+
increase_watchers

client-seo/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM node:12.8.0-alpine AS base
1+
FROM node:13.12.0-alpine3.11 AS base
22

33
RUN apk update \
44
&& apk add bash \

client-seo/next.config.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,16 @@ module.exports = {
55
config.module.rules.push({
66
test: /\.(graphql|gql)$/,
77
exclude: /node_modules/,
8-
loader: 'graphql-tag/loader'
8+
loader: "graphql-tag/loader",
99
});
1010

1111
return config;
1212
},
1313
webpackDevMiddleware: (config) => {
1414
config.watchOptions = {
1515
poll: 1000,
16-
aggregateTimeout: 1000
16+
aggregateTimeout: 1000,
1717
};
1818
return config;
19-
}
19+
},
2020
};

0 commit comments

Comments
 (0)