You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+61-35Lines changed: 61 additions & 35 deletions
Original file line number
Diff line number
Diff line change
@@ -22,11 +22,11 @@
22
22
-[Logging and logs rotation](./api/app/utils/Logger.py#L12)
23
23
-[Choose](./app/app/src/App.js#L65) between sidebar and navbar (or use both !)
24
24
- Responsive design
25
-
- Production and development builds
25
+
-[Production](./prod.docker-compose.yml) and [development](./docker-compose.yml) builds
26
26
27
27
## API documentation
28
28
29
-
I chose to use Swagger to document the API. Run the API following the steps below and go to [`http://localhost:5000`](http://localhost:5000).
29
+
We've chosen Swagger to document the API. Run the API following the steps below and go to [`http://localhost:5000`](http://localhost:5000).
30
30
31
31
Here you can take a look at the database architecture scheme :
32
32
@@ -44,11 +44,7 @@ With this boilerplate, you will be able to develop corporate-ready services AND
44
44
45
45
## Getting started (development)
46
46
47
-
The API is made to run with an LDAP server for managing users. Whether use the provided Docker LDAP server or remove the conf. in [`docker-compose.yml`](./docker-compose.yml) and use your own LDAP server.
48
-
49
-
This section will explain to you how to run this project and set-up the LDAP server with one user.
50
-
51
-
### 1. Starting authentication services
47
+
This section will explain how to properly run this project and set-up the LDAP server with one user.
52
48
53
49
1. Copy the `.env.example` to `.env`
54
50
@@ -58,52 +54,82 @@ This section will explain to you how to run this project and set-up the LDAP ser
58
54
59
55
> This is a good practice so your `.env` can't be committed along with your modifications (is in `.gitignore`)
60
56
61
-
2. Change the database/LDAP passwords and keys in `.env`
62
-
63
-
Then run :
57
+
2. Start the authentication services
64
58
65
59
```bash
66
60
docker-compose up ldap phpldapadmin database adminer -d
67
61
```
68
62
69
-
- **adminer** (PostgreSQL management) will be available at `http://localhost:8082`
70
-
- **phpLDAPAdmin** (LDAP management) will be available at `https://localhost:8081`
63
+
- **phpLDAPAdmin** (LDAP management) will be available at `https://localhost:8081`
64
+
- **adminer** (PostgreSQL management) will be available at `http://localhost:8082`
65
+
66
+
**Create** your first user by accessing phpLDAPAdmin at `https://localhost:8081` and [following the LDAP user creation guide](./CREATE_LDAP_USER.md).
67
+
68
+
3. NGINX reverse-proxy
69
+
70
+
This boilerplate includes NGINX as a reverse proxy so we can have a unique endpoint for our app and API. Else, we would have to open two endpoints : one for the app, the other for the API.
71
+
72
+
```bash
73
+
docker-compose up --build -d nginx
74
+
```
71
75
72
-
### 2. Creating the first user in the LDAP
76
+
> NGINX will auto restart until you have started the app and API below.
73
77
74
-
Access phpLDAPAdmin at `https://localhost:8081` and [follow the LDAP user creation guide](./CREATE_LDAP_USER.md) to add your first user
78
+
4. Run the API
75
79
76
-
### 3. NGINX reverse-proxy
80
+
The database will be automatically set-up thanks to Flask Migrate and any future modification brought to [models](./api/app/model) will be automatically applied when the API is **restarted**.
77
81
78
-
This boilerplate includes NGINX as a reverse proxy so we can have a unique endpoint for our app and API. Else, we would have to open two endpoints : one for the app, the other for the API.
82
+
You might wait some time before the database get updated after starting the API :
79
83
80
-
```bash
81
-
docker-compose up --build -d nginx
82
-
```
84
+
```bash
85
+
docker-compose up --build -d api
86
+
```
83
87
84
-
NGINX will auto restart until you have started the app and API below.
88
+
> For development, go to [`http://localhost:5000`](http://localhost:5000) to access the API documentation
85
89
86
-
### 4. Run the API
90
+
5. Run the web app
87
91
88
-
The database will be automatically set-up thanks to Flask Migrate and any future modification brought to [models](./api/app/model) will be automatically applied when the API is **restarted**.
92
+
```bash
93
+
# Expect several minutes for first launch (npm install)
94
+
docker-compose up --build -d app
95
+
```
89
96
90
-
You might wait some time before the database get updated after starting the API :
97
+
> :information_source: If you want to add a NPM package, just stop & re-launch `docker-compose up app`.
91
98
92
-
```bash
93
-
docker-compose up --build -d api
94
-
```
99
+
Enjoy the app on [`http://localhost:8080`](http://localhost:8080)
95
100
96
-
> For development, go to [`http://localhost:5000`](http://localhost:5000) to access the API documentation
101
+
## Deploy to production
97
102
98
-
### 5. Run the web application
103
+
1. Prepare environment configuration
99
104
100
-
:clock9: NPM's initial install may take quite a lot of time
105
+
Copy `.env.example` to `.env` and **edit** the passwords, keys and credentials
101
106
102
-
```bash
103
-
# Expect several minutes for first launch (npm install)
104
-
docker-compose up --build -d app
105
-
```
107
+
Use the provided Docker LDAP server or edit the config to use your own.
106
108
107
-
Enjoy the app on [`http://localhost:8080`](http://localhost:8080)
109
+
```bash
110
+
cp .env.example .env
111
+
```
112
+
113
+
2. Build the application for production
114
+
115
+
```bash
116
+
docker-compose -f prod.docker-compose.yml build
117
+
```
118
+
119
+
3. Start the authentication services
120
+
121
+
```bash
122
+
docker-compose up ldap phpldapadmin database adminer -d
123
+
```
124
+
125
+
**Create** your first user by accessing phpLDAPAdmin at `https://localhost:8081` and [following the LDAP user creation guide](./CREATE_LDAP_USER.md).
126
+
127
+
:information_source: We recommend you to hide this service behind a firewall
128
+
129
+
4. Run the application
130
+
131
+
```bash
132
+
docker-compose -f prod.docker-compose.yml up nginx api app -d
133
+
```
108
134
109
-
> :information_source: If you want to add a NPM package, just stop & re-launch `docker-compose up app`.
0 commit comments