GithubHelp home page GithubHelp logo

mefilez's People

Contributors

fiosman avatar jeanniewang avatar

Watchers

 avatar

Forkers

jeanniewang

mefilez's Issues

Creating RestAPI to delete files or file folder by applying Transaction mechanism

When deleting a nested file folder, all its child files, and file folder needs to be deleted at one time. If this deletion task is broken in the middle, there will be orphaned files or file folders. Therefore, the transaction mechanism needs to be implemented to make this process atomic: if any step fails, the whole process will rollback, any deleted files will be recovered.

The primary goal of a transaction is to let you update multiple documents in MongoDB in isolation, and potentially undo all the updates if some error occurs by aborting the transaction.

https://mongoosejs.com/docs/transactions.html
https://thecodebarbarian.com/whats-new-in-mongoose-5-10-improved-transactions.html

Populate all files when visiting index page

When a user logs in, they will be redirected to the main index page (i.e. /files). Create a route and associated route handler to return in JSON format all root level folder and files associated with the user.

frontend sign up functionality

Create a sign up form, render proper response from the redux state shape. Ensure jwt gets stored in client cookie upon successful registration and that the user gets signed in.

create splash page

Create a splash page. User should be able to sign up or log in from it.

update file title

A user should be able to update the title of a file or folder they have uploaded.

Update file schema to resemble tree structure

Each file document that is created needs to be aware of its ancestors. The best way to do this is to create an array field and populate it with ancestor ObjectIds prior to saving in database. Ideally this would be done using a middleware (i.e. mongoose pre hook).

showFile controller

We will need to implement a handler for a URI pattern that matches /api/files/:fileId, where fileId is the mongoDB _id of a certain document (in this case it would be a folder).

When a user clicks on a folder, they should be able to get redirected to a new page with an updated URL that matches the above pattern. For example, if they were on the main page (i.e. /api/files, and clicked on the folder 2020 (assume the id of the folder of 2020 is 123456789), they should be redirected to /api/files/123456789.

Our backend is strictly a JSON api. We will not be rendering any views from the backend, so we will only return json data. We should return all files associated with that parent that the user gets redirected to.

I have set up a template in api/routes/files.js as well as api/controllers/fileController.js

Populate user files

Currently the User mongoose model "User" has a "files" field, which is meant to populate an array of all the files a specific user has created. However, this returns an empty array at the moment, even though mongodb file collection shows files with a certain user Id.

We need to be able to properly return the list of files associated with each user, using mongoose methods.

Git-Feature-Branch-Workflow-Training

Description: This ticket is to go through each step of the Git Feature Branch Workflow. Atlassian offered an excellent explanation:
https://www.atlassian.com/git/tutorials/comparing-workflows/feature-branch-workflow

The core idea behind Git Feature Branch Workflow is that all feature development should take place in a dedicated branch instead of the master branch.

Task one: Example with creating any conflict:

  • Work on your new branch
    Create a branch from the master branch
    Create a new-branch
    Update, add, commit, and push changes
    Push feature branch to remote
  • Create a pull request for your feature branch
  • Merge the pull request

Task two: Example with creating some conflict and need to resolve:
This is just to repeat the previous steps, however, the task performer should intentionally skip updating the origin/main branch.

More reference:
https://guides.github.com/introduction/flow/ (Nice diagram)
https://gist.github.com/blackfalcon/8428401 (Solutions to resolve conflict: Merge vs Rebase)

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.