|
1 |
| -# Jeu de mots |
| 1 | +# Jeu De Mots |
2 | 2 |
|
3 |
| -<a href="https://github.com/berdal84/jeudemots-ng/actions?query=workflow Node.js CI" title="ng build"> |
4 |
| -<img src="https://github.com/berdal84/jeudemots-ng/workflows/Node.js CI/badge.svg" /> |
5 |
| -</a> |
| 3 | +[](https://github.com/berdal84/jeudemots/actions/workflows/ui.yml) |
| 4 | +[](https://github.com/berdal84/jeudemots/actions/workflows/api.yml) |
| 5 | +[](https://github.com/berdal84/jeudemots/actions/workflows/db.yml) |
6 | 6 |
|
7 | 7 | ## Introduction
|
8 | 8 |
|
9 |
| -This is a client-server solution to host jokes using Angular and PHP/MySQL. Two alternative React/Vue clients are work in progress. The project is deployed at [https://jeudemots.42borgata.com](https://jeudemots.42borgata.com), |
| 9 | +_Jeu De Mots_ is a web application to host jokes developed with Angular and PHP. |
| 10 | + |
| 11 | +Try it: [https://jeudemots.42borgata.com](https://jeudemots.42borgata.com) |
10 | 12 |
|
11 | 13 | <div align="center">
|
12 |
| - <img width="100%" height="100%" src="./screenshot.png" /> |
| 14 | + <img width="100%" height="100%" src="./docs/screenshot.png" /> |
13 | 15 | <p>Angular Frontend | Slideshow capture<p/>
|
14 | 16 | </div>
|
15 | 17 |
|
16 |
| -## Project files |
17 |
| - |
18 |
| -This repository contains source code for different parts of the project: |
19 |
| - |
20 |
| -- `server`: backend PHP sources files |
21 |
| -- `client/ng`: main Angular frontend sources |
| 18 | +## Quick start |
22 | 19 |
|
23 |
| -WIP: |
| 20 | +### Prerequisites |
24 | 21 |
|
25 |
| -- `client/react-js`: alternative React frontend sources (deployed |
26 |
| - at [https://jeudemots.42borgata.com/react](https://jeudemots.42borgata.com/react)) |
27 |
| -- `client/vue`: alternative Vue frontend sources (deployed |
28 |
| - at [https://jeudemots.42borgata.com/vue](https://jeudemots.42borgata.com/vue)) |
29 |
| -- `client/shared`: shared code and resources. |
| 22 | +_Prerequisites: docker is **required**._ |
30 | 23 |
|
31 |
| -## Development |
| 24 | +### Launch |
32 | 25 |
|
33 |
| -### Prerequisites |
| 26 | +Run the following command to build and launch the app: |
34 | 27 |
|
35 |
| -Install the following dependencies: |
36 | 28 | ```
|
37 |
| -sudo apt install nodejs npm php libapache2-mod-php php-mysql php-cli |
| 29 | +docker compose up -d |
38 | 30 | ```
|
39 | 31 |
|
40 |
| -And install the project |
| 32 | +Browse `https://localhost:4200/` |
41 | 33 |
|
42 |
| -``` |
43 |
| -npm install |
44 |
| -``` |
| 34 | +### Post-launch (do once) |
45 | 35 |
|
46 |
| -### `npm run build` |
| 36 | +Browse `https://localhost:4200/#/login` and login with the following credentials: |
| 37 | +- username/pass: `admin`/`admin` |
47 | 38 |
|
48 |
| -Launches the build of the subprojects (server, angular/react frontends). Produce a `./build` subfolder in each |
49 |
| -subprojectfolder (see `in client/`). |
| 39 | +<div align="center"> |
| 40 | + <img height=300 src="./docs/login-page.png" /> |
| 41 | +</div> |
50 | 42 |
|
51 |
| -*note: the first time, before launching the command, you need to duplicate `server/config.sample.php`, |
52 |
| -rename it to `config.prod.php` and replace the data inside the file with your credentials (depends on your server |
53 |
| -config). If not, the server build will fail.* |
| 43 | +Once logged, install the app by following the instructions of the `install` section. |
| 44 | + |
| 45 | +<div align="center"> |
| 46 | + <img width="100%" height="100%" src="./docs/install-page.png" /> |
| 47 | + <img height=100 src="./docs/install-confirmation.png" /> |
| 48 | +</div> |
| 49 | + |
| 50 | +## Project files |
54 | 51 |
|
55 |
| -### `npm run pack` |
| 52 | +Quick summary of the project's folder hierarchy: |
56 | 53 |
|
57 |
| -Copy the last build files from all subprojects to a global `./dist` folder. This folder will contain the files you need |
58 |
| -to copy to your web server to get the application to work. |
| 54 | +- `./ui/ng`: Angular sources |
| 55 | +- `./ui/shared`: shared code and resources |
| 56 | +- `./ui/react`: WIP alternative React sources (deployed |
| 57 | + at [here](https://jeudemots.42borgata.com/react)) |
| 58 | +- `./ui/vue`: WIP alternative Vue frontend (deployed |
| 59 | + at [here](https://jeudemots.42borgata.com/vue)) |
| 60 | +- `./api`: api source |
| 61 | +- `./db`: database sources |
59 | 62 |
|
60 |
| -*note: The first time you will need to install the database. To do that, sign in to the admin page (add `/admin`to the |
61 |
| -URL), go to the installation section and click on install. Then, you can optionally restore a previously backed up file.* |
62 | 63 |
|
63 | 64 | ## History
|
64 | 65 |
|
|
0 commit comments