You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
createdatabasecbsocialmediadb;createusercbsocialuser identified with mysql_native_password by'cbsocialpass';grant all privilegeson cbsocialmediadb.* to cbsocialuser;flush privileges;
Project Structure
Backend (Server)
src├── controllers# functions to connect routes to db operations├── db# db connection and model definitions├── public# html/js/css files for static part of site└── routes# express middlewares (route wise)
Frontend (Client Side Code)
src/public├── app# our own frontend js code│ └── common.js├── components# own own html snippets│ └── navbar.html├── css# css libraries we are using│ └── bootstrap.css├── fonts# fonts that we are using│ ├── Muli-Italic.woff2│ ├── Muli.woff2│ └── muli.css├── index.html# first / home page└── js# js libraries we are using ├── bootstrap.js ├── jquery-3.4.1.js └── popper.js
Business Logic
Users
create usersthis will create a new user with a random username
Posts
create postthis will create a new post, required fields are
username (the author of this post)
title
body
show all postslist all existing posts, we should have following filtering support
filter by username
filter by query contained in title (search by title)
edit postsTBD
delete postsTBD
Comments
show all comments (of a user)
show all comments (under a post)
add a comment
API Documentation
users
POST /users
Creates a new user with random username and an user id