This project consists in creating a web forum that allows communication between users through the creation of posts and comments. It also allows non-registered users to only see posts and comments.
- Your forum should work based on services. Using services to create a project means that instead of having all of your project in one location, you actually divide it in smaller "projects".
- For example if you want to create a gym application you can split it in: login/register, workouts, stats (weight, muscle mass, etc.), and so on.
You can learn more about services [here](https://medium.com/myntra-engineering/my-journey-with-golang-web-services-4d922a8c9897).
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, being `bridge` and `overlay`.
Your objective is to use the [`bridge` network](https://docs.docker.com/engine/tutorials/networkingcontainers/) to create your own network for the services created for the forum project. Docker connected to this network by default, so docker creates 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>`.
- 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
```
- Each service will have to run in a container that will be associated to a docker host, a docker host must contain at least two containers/services, the containers must be connected to a bridge.
- You must be carful, 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, that way connecting with all of the containers on all networks creating a "hub".
In this segment you will have to create a page that allows you to `register` new users for the forum, by inputting their credentials. You also have to create a `login session` to access te forum and be able to add posts or comments.
Instructions for user register:
- Must ask for email
- Must ask for password
- When the user is taken return an error response.
- The password must be encrypted
After the registrations the new users must be able to login into the forum. For that they will fill their credentials in the login page.
This page must be able to check if the email provided is present in our 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.
If there is an error in the login it must be handled properly:
- If there is an error when casting, return an error response.
- If the email is not present or incorrect return an error response.
- If the password is not present or incorrect return an error response.
#### SQLite
In order to store the data in your forum (like users, posts, comments, etc.) you will use the database library SQLite.
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.