https://github.com/hussein-m-kandil/odin-file-uploader
A stripped-down version of personal storage service like Google Drive. Built as part of studying The Odin Project's Node.js course.
https://github.com/hussein-m-kandil/odin-file-uploader
backend ejs express express-session express-validator expressjs javascript neon node nodejs passport passportjs postgresql prisma sql supabase uploader vercel vercel-serverless-functions
Last synced: 8 days ago
JSON representation
A stripped-down version of personal storage service like Google Drive. Built as part of studying The Odin Project's Node.js course.
- Host: GitHub
- URL: https://github.com/hussein-m-kandil/odin-file-uploader
- Owner: hussein-m-kandil
- Created: 2024-12-10T10:54:25.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2024-12-30T07:43:16.000Z (10 months ago)
- Last Synced: 2025-02-08T21:45:53.206Z (8 months ago)
- Topics: backend, ejs, express, express-session, express-validator, expressjs, javascript, neon, node, nodejs, passport, passportjs, postgresql, prisma, sql, supabase, uploader, vercel, vercel-serverless-functions
- Language: JavaScript
- Homepage: https://odin-file-uploader-hussein-kandil.vercel.app/
- Size: 541 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Odin File Uploader
A stripped-down version of a personal storage service. Built as part of studying [**The Odin Project's Node.js course**](https://www.theodinproject.com/paths/full-stack-javascript/courses/nodejs).
> Note: I deliberately minimized the project's UI, so I can focus on practicing the back-end technologies I am studying.
## PostgreSQL Recursive Query
While this project introduced me to many new concepts, the most significant aspect I implemented was the parent-child relationship between files in the database. Check out the [`files controller`](./src/controllers/files-controller.js) for an implementation of raw, recursive queries in PostgreSQL.
## Prisma Schema Diagram

## Project Requirements
> Note: These requirements were copied from The Odin Project's website at the time of building this project.
1. Set up a new project using Express and Prisma. Install all the necessary dependencies including Passport etc.
2. Set up session based authentication using Passport.js. Use the Prisma session store library to persist sessions in the database.
3. Add a form where authenticated users can upload a file. Save the file in your filesystem for now. You’ll need to integrate the multer middleware. We’ll upload these files once we have all other features working.
4. Add folders. Users should be able to CRUD folders and upload files in them. Set up routes and necessary database interactions for this.
5. Add a route to view specific file details like name, size, and upload time. There should be a download button to allow users to download the file.
6. Finally, add logic to upload files. You could store it in a database, but it’s advised to use a cloud storage service for this use case. You can use Cloudinary or Supabase storage. When a file is uploaded, save the file URL in the database.
### Extra credit
- Add a share folder functionality. When a user wants to share a folder (and all of its contents), they should have a form to specify the duration i.e. 1d, 10d etc. This should generate a link that can be shared with anyone (unauthenticated users). For example, the link could be in the following format: [`https://odin-file-uploader-hussein-kandil.vercel.app/share/70c353d8-8767-4b52-a5a2-389dfb1f7fc8`](https://odin-file-uploader-hussein-kandil.vercel.app/share/70c353d8-8767-4b52-a5a2-389dfb1f7fc8)