Browse Source

questions: chat, database, authentication, bonus

pull/660/head
lee 4 years ago
parent
commit
294c166c12
  1. 22
      subjects/social-network/README.md
  2. 86
      subjects/social-network/audit/README.md

22
subjects/social-network/README.md

@ -44,7 +44,7 @@ This is typically divided into three major parts:
- **Server**, this is the computer that receives request. Though there are machines made and optimized for this particular purpose, you will use your own computer.
- **App**, this is the application running on the server that listens for requests, retrieves information from the database and sends a response. The server runs an app that contains all the logic about how to respond to various requests based on the HTTP or other types of protocols. Some of these handlers functions will be middleware. Middleware is any code that executes between the server receiving a request and sending a response.
- **App**, this is the application running on the server that listens for requests, retrieves information from the database and sends a response, usually the response is done in JSON, using REST-based API. The server runs an app that contains all the logic about how to respond to various requests based on the HTTP or other types of protocols. Some of these handlers functions will be middleware. Middleware is any code that executes between the server receiving a request and sending a response.
- **Database**, are used as you already know, to organize and persist data. Many requests sent to the server might require a database query. A client might request information that is stored in the database, or a client might submit data with their request to be added to the database.
@ -53,8 +53,8 @@ This is typically divided into three major parts:
The backend will consist, like said above, of an **app** containing all the backend logic. This logic will there for have several middleware, for example:
- Authentication, since HTTP is a stateless protocol, we can use several ways to overcome and authenticate a client/user. You can use [sessions](https://allaboutcookies.org/cookies/session-cookies-used-for.html) or [tokens(JWT)](https://jwt.io/)
- Images handling, supporting various types of extensions. In this project you have to handle at least JPEG, PNG types. You will have to store the images, it can be done by storing the file/path in the database and saving the image in a specific file system.
- Websocket, handling the connections in real time, between clients. This will help with the private chats.
- Images handling, supporting various types of extensions. In this project you have to handle at least JPEG, PNG and GIF types. You will have to store the images, it can be done by storing the file/path in the database and saving the image in a specific file system. Or saving the image in the database, you can see more about images and database [here](https://stackoverflow.com/questions/3748/storing-images-in-db-yea-or-nay).
- Websocket, handling the connections in real time, between clients. This will help with the private and group chats.
#### Sqlite
@ -65,7 +65,7 @@ To know more about SQLite you can check the [SQLite page](https://www.sqlite.org
#### Migrate
You will have to create migrations for this project so every time the application runs it creates the specific tables to make the project work properly
You will have to create migrations for this project so every time the application runs it creates the specific tables to make the project work properly.
For this you must focus on a folder structure similar to this one:
@ -92,7 +92,9 @@ The folder structure is organized in a way that helps you to **understand** and
For migrations you can use [golang-migrate](https://github.com/golang-migrate/migrate) package or other package that better suits your project
All migrations should be stored on a specific folder, as above. The `sqlite.go` should present the connection to the database, the applying of the migrations and other useful functionalities that you may need to implement.
All migrations should be stored on a specific folder, as above. The `sqlite.go` should present the connection to the database, the applying of the migrations and other useful functionalities that you may need to implement.
This migration system can help you manage your time and testing, by filling you database.
----
@ -122,9 +124,9 @@ To be able for the users to use the social network they will have to make an acc
Note that the **Avatar/Image**, **Nickname** and **About Me** should be present in the form but the user can skip the filling of those fields.
When you login you should stay logged in until you choose a logout option that should be available at all times. For this you will have to implement [sessions](https://allaboutcookies.org/cookies/session-cookies-used-for.html) and [cookies](https://developer.mozilla.org/en-US/docs/Web/HTTP/Cookies).
When you login you should stay logged in until you choose a logout option that should be available at all times. For this you will have to implement [sessions](https://allaboutcookies.org/cookies/session-cookies-used-for.html) and [cookies](https://developer.mozilla.org/en-US/docs/Web/HTTP/Cookies) or [tokens(JWT)](https://jwt.io/).
You can implement your own package for sessions and cookies or you can take a look at some packages to help you.
You can implement your own package for the authentication or you can take a look at some packages to help you.
----
@ -165,7 +167,7 @@ The user must be able to specify the privacy of the post:
### Groups
A user must be able to create a group. The group should have a title and a description given by the creator and he/she can invite other users to join the group.
A user must be able to create a group. The group should have a title and a description given by the creator and he/she can invite other followers to join the group.
The invited users need to accept the invitation to be part of the group. They can also invite other people once they are already part of the group. Another way to enter the group is to request to be in it and only the creator of the group would be allowed to accept or refuse the request.
@ -188,9 +190,9 @@ After creating the event every user can choose one of the options for the event.
### Chat
The user should be able to send private messages to users that he/she is following. It should be able for the users to send emojis to each other.
The user should be able to send private messages to users that he/she is following. It should be able for the users to send emojis to each other too.
The user that the message was sent to, will receive the message instantly, by the usage of Websockets. If he/she is following the user that sent the message or if the user has a public profile.
The user that the message was sent to, will receive the message instantly, by the usage of Websockets. If he/she is following the user that sent the message
Groups should have a common chat room, so if a user is a member of the group he/she should be able to send and receive messages to this group chat.

86
subjects/social-network/audit/README.md

@ -0,0 +1,86 @@
#### Functional
##### Open the project
###### Is the file system for the backend well organized?
##### Open the project
###### Is the file system for the frontend well organized?
#### Database
###### Is Sqlite being used in the project as the DataBase?
###### Does the app implement a migration system?
###### Is that migration file system well organized? (like the example from the subject)
##### Start the social network application, then enter the database using the command `"sqlite3 <database_name.db>"`.
###### Are the migrations being applied by the migration system?
#### Authentication
###### Does the app implement sessions or JWT for the authentication of the users?
###### Are the correct form elements being used in the registration? (Email, Password, First Name, Last Name, Date of Birth, Avatar/Image (Optional), Nickname (Optional), About Me (Optional))
##### Try to register a user.
###### Did the app saved the registered user without error?
##### Try to login with the user you just registered.
###### Did the login worked without problem?
##### Try to login with the user you created, but with a wrong password or email.
###### Did the app detect if the email or password is wrong?
##### Try to register the same user you already registered.
###### Did the app detect if the email/user is already present in the database?
##### Open two browsers (ex: Chrome and Firefox), login into one and refresh the other browsers.
###### Can you confirm that the browser non logged remains unregistered?
##### Using the two browsers, login with different users in each one. Then refresh both the browsers.
###### Can you confirm that both browsers continue with the right users?
#### Chat
##### Try and open two browsers (ex: Chrome and Firefox), login with different users in each one. Then with one of the users try to send a private message to the other user.
###### Did the other user received the message in realtime?
##### Using the two browsers with the users start a chat between the two of them.
###### Did the chat between the users went well? (did not crash the server)
##### Try and open three browsers (ex: Chrome and Firefox or a private browser), login with different users in each one. Then with one of the users try to send a private message to one of the other users.
###### Did only the targeted user received the message?
##### Using the three browsers with the users, enter with each user a common group. Then start sending messages to the common chat room using one of the users.
###### Did all the users that are common to the group receive the message in realtime?
##### Using the three browsers with the users, continue chatting between the users in the group.
###### Did the chat between the users went well? (did not crash the server)
###### Can you confirm that it is possible to send emojis via chat to other users?
#### Docker
#### Bonus
###### +Can you login using Github or other type of external OAuthenticator (open standard for access delegation)?
###### +Did student created a migration to fill the database?
Loading…
Cancel
Save