Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
NotificationsYou must be signed in to change notification settings

coding-blocks-archives/Social_Media_Sample_Project_2020_May

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Database Setup

$ mysql -u root
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

  1. create usersthis will create a new user with a random username

Posts

  1. create postthis will create a new post, required fields are

    • username (the author of this post)
    • title
    • body
  2. show all postslist all existing posts, we should have following filtering support

    • filter by username
    • filter by query contained in title (search by title)
  3. edit postsTBD

  4. delete postsTBD

Comments

  1. show all comments (of a user)

  2. show all comments (under a post)

  3. add a comment

API Documentation

users

  1. POST /users

Creates a new user with random username and an user id

  1. GET /users/{userid}

Get an user with a given user id

  1. GET /users/{username}

Get an user with a given username

posts

  1. GET /posts

Get all posts by everyone

  1. POST /posts

Create a new post.Required fields in body -

userId=title=body=

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp