Code Monkey home page Code Monkey logo

social_media_sample_project_2020_may's Introduction

Social Media Sample Project

Database Setup

$ mysql -u root
create database cbsocialmediadb;

create user cbsocialuser identified with mysql_native_password by 'cbsocialpass';

grant all privileges on 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 users this will create a new user with a random username

Posts

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

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

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

  4. delete posts TBD

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=

social_media_sample_project_2020_may's People

Contributors

championswimmer avatar deepak-gupta99 avatar

Stargazers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.