fiosman / mefilez Goto Github PK
View Code? Open in Web Editor NEWFile storage service
File storage service
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
Be able to persist user state throughout app, log them out successfully. Ensure that the proper state is reflected in the redux state shape.
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.
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 a splash page. User should be able to sign up or log in from it.
A user should be able to update the title of a file or folder they have uploaded.
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).
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
Implement user log out functionality
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.
Implement middleware to allow only file owners to modify, delete and/or view their files.
Connect the backend API to react front end. Ensure HTTP requests to API end points return appropriate data.
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:
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)
Store the assigned jwt in browser cookie after successful log in.
Be able to dispatch login/sign up actions; store errors and current user info.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.