Giter VIP home page Giter VIP logo

postits-server's Introduction

PostIt's - Server Repository

License: MIT

PostIts-min

The server that will send and update data recieved from the PostIt's clients side website.

Installation

  • Clone and download this repo.

Usage

  • Open the terminal
  • Run npm install
  • Run npm start to start the server

Technologies

  • Express and body parser
  • CORS
  • FileSystem (fs)
  • nyc istanbul
  • Supertest
  • Mocha
  • Chai

Process

The project started with the analysis of the website requirements based on which a rough design was sketched using Figma. We then created a plan in a shared Google Docs file where we outlined what features we wanted to include, allocated a time frame for each one and logged our progress and remaining tasks.

After the planning and designing step, we worked on the initial HTML, Javascript and Server-side JavaScript by mob programming. This step ensured we had a basic functioning website before we split tasks and worked on specific features individually.

Everytime a new functioning feature was completed, its branch was merged to the Development branch and pushed to the main git repository. At the end all final changes were merged with the master branch.

Code Snippets

Server post method

server.post('/posts', (req, res)=>{
    const reqBody = req.body;
    const newPostKey = Object.keys(data).length;
    const newPost = {
        name: reqBody.name,
        post: reqBody.post,
        gif: reqBody.gif,
        emoji: reqBody.emoji,
        comments: []
    }
    data[newPostKey] = newPost;
    const newData = JSON.stringify(data, null, 2);
    fs.writeFileSync('postData.json', newData);

    res.status(201).send(data);
})

Wins & Challenges

Wins

  • Testing the ID of comments.
  • Achieving 100% coverage in the nyc.
  • Storing new data into the external json file.
  • Entering new comments and emojis on existing posts.

Challenges

  • Rewriting existing data in the external file.

Features

  • Posting and Getting data from an external file.
  • Saving data to an external file.

Future Features

  • Ability to connect to a database.

Licence

To visit the site click this link. Here is the url for our API https://postits-site.herokuapp.com/posts.

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.