Your forum should work based on services. Using services to create a project means that instead of having a monolith architecture, you actually have various components distributed across a cluster of instances. In other words, dividing the project in smaller "projects", this way it becomes easier to understand and your project will become more scalable.
- For example for a taxi like application you can divide it in : passenger management, billing, notifications, payments, trip management and driver management.
SQLite is a popular choice as embedded database software for local/client storage in application software such as web browsers. It enables you to create a database as well as controlling it by using queries.
To structure your database and to achieve better performance we highly advise you to take a look at the [entity relationship diagram](https://www.smartdraw.com/entity-relationship-diagram/) and build one based on your own database.
In this segment the client must be able to `register` as a new user for the forum, by inputting their credentials. You also have to create a `login session` to access the forum and be able to add posts and/or comments.
You should use cookies to allow each user to have only one open session. Each of this sessions must contain an expiration date. It's up to you to decide what time the cookie stays "alive".
Instructions for user registration:
- Must ask for email
- When the email is taken return an error response.
- Must ask for username
- Must ask for password
- The password must be encrypted
The forum must be able to check if the email provided is present in the database and if all credentials are correct. It will check if the password is the same with the one provided and if the password is not the same return an error response.
#### Docker
For the forum project you must use Docker. You can see all about docker basics on the [ascii-art-web-dockerize](https://public.01-edu.org/subjects/ascii-art-web/ascii-art-web-dockerize.en) subject.
You must build a network using containers. In docker you can create your own network of containers through network drivers. Docker provides two network drivers : `bridge` and `overlay`.
- You can see the default network :
```console
student$ docker network ls
NETWORK ID NAME DRIVER SCOPE
b64130fc5aae bridge bridge local
033f3a191908 host host local
159cdc8d8083 none null local
```
Your objective is to use the [`bridge` network](https://docs.docker.com/engine/tutorials/networkingcontainers/) to create your own network for the services. Docker connects to this network by default, creating a subnet and a gateway for the `bridge` network. The command `docker run` automatically adds containers to it. To inspect the network for more details you can just run `docker network inspect <network>`.
- Each service will have to run in a container that will be associated to a docker host, which must contain at least two containers/services and these must be connected to a bridge.
- You must be careful, bridges are a private network, so it is restricted to a single Docker host, for instance containers can communicate within networks but not across networks.
- You may have to use [Port Mapping](https://docker-k8s-lab.readthedocs.io/en/latest/docker/port-mapping.html).
- Or attaching containers to multiple networks connecting with all containers on all networks creating a ["hub"](https://docs.docker.com/engine/tutorials/bridge3.png).