mirror of https://github.com/01-edu/public.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
101 lines
3.9 KiB
101 lines
3.9 KiB
5 years ago
|
## forum
|
||
|
|
||
|
### Objectives
|
||
|
|
||
5 years ago
|
This project consists in creating a web forum that allows :
|
||
5 years ago
|
|
||
5 years ago
|
- communication between users.
|
||
5 years ago
|
- associating categories to posts.
|
||
5 years ago
|
- liking and disliking posts and comments.
|
||
|
- filtering posts.
|
||
5 years ago
|
|
||
|
#### SQLite
|
||
|
|
||
|
In order to store the data in your forum (like users, posts, comments, etc.) you will use the database library SQLite.
|
||
|
|
||
5 years ago
|
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.
|
||
5 years ago
|
|
||
5 years ago
|
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.
|
||
5 years ago
|
|
||
5 years ago
|
- You must use at least one SELECT, one CREATE and one INSERT queries.
|
||
5 years ago
|
|
||
|
To know more about SQLite you can check the [SQLite page](https://www.sqlite.org/index.html).
|
||
|
|
||
5 years ago
|
#### Authentication
|
||
|
|
||
5 years ago
|
In this segment the client must be able to `register` as a new user on 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 comments.
|
||
5 years ago
|
|
||
5 years ago
|
You should use cookies to allow each user to have only one opened session. Each of this sessions must contain an expiration date. It is up to you to decide how long the cookie stays "alive".
|
||
5 years ago
|
|
||
|
Instructions for user registration:
|
||
|
|
||
|
- Must ask for email
|
||
5 years ago
|
- When the email is already taken return an error response.
|
||
5 years ago
|
- Must ask for username
|
||
|
- Must ask for password
|
||
5 years ago
|
- The password must be encrypted when stored
|
||
5 years ago
|
|
||
5 years ago
|
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, it will return an error response.
|
||
5 years ago
|
|
||
5 years ago
|
#### Communication
|
||
|
|
||
|
In order for users to communicate between each other, they will have to be able to create posts and comments.
|
||
|
|
||
|
- Only registered users will be able to create posts and comments.
|
||
|
- When registered users are creating a post they can associate one or more categories to it.
|
||
|
- The implementation and choice of the categories is up to you.
|
||
|
- The posts and comments should be visible to all users (registered or not).
|
||
|
- Non-registered users will only be able to see posts and comments.
|
||
|
|
||
|
#### Likes and Dislikes
|
||
|
|
||
5 years ago
|
Only registered users will be able to like or dislike posts and comments.
|
||
5 years ago
|
|
||
|
The number of likes and dislikes should be visible by all users (registered or not).
|
||
|
|
||
|
#### Filter
|
||
|
|
||
|
You need to implement a filter mechanism, that will allow users to filter the displayed posts by :
|
||
|
|
||
|
- categories
|
||
|
- created posts
|
||
|
- liked posts
|
||
|
|
||
|
You can look at filtering by categories as subforums. A subforum is a section of an online forum dedicated to a specific topic.
|
||
|
|
||
|
Note that the last two are only available for registered users and must refer to the logged in user.
|
||
|
|
||
5 years ago
|
#### 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.
|
||
|
|
||
5 years ago
|
This project will help you learn about:
|
||
|
|
||
5 years ago
|
- Client utilities.
|
||
|
- The basics of web :
|
||
|
- HTML
|
||
|
- HTTP
|
||
5 years ago
|
- Sessions and cookies
|
||
5 years ago
|
- Using and [setting up Docker](https://docs.docker.com/get-started/)
|
||
|
- Containerizing an application
|
||
|
- Compatibility/Dependency
|
||
|
- Creating images
|
||
5 years ago
|
- SQL language
|
||
5 years ago
|
- Manipulation of databases
|
||
|
- The basics of encryption
|
||
5 years ago
|
|
||
|
### Instructions
|
||
|
|
||
5 years ago
|
- You must use **SQLite**.
|
||
|
- You must handle website errors, HTTP status.
|
||
5 years ago
|
- You must handle all sort of technical errors.
|
||
5 years ago
|
- The code must respect the [**good practices**](https://public.01-edu.org/subjects/good-practices.en).
|
||
5 years ago
|
- It is recommended that the code should present a **test file**.
|
||
5 years ago
|
|
||
5 years ago
|
### Allowed packages
|
||
5 years ago
|
|
||
|
- All [standard go](https://golang.org/pkg/) packages are allowed.
|
||
|
- github.com/mattn/go-sqlite3
|
||
5 years ago
|
- golang.org/x/crypto/bcrypt
|
||
5 years ago
|
- github.com/satori/go.uuid
|