|
1 |
| -# file-sync |
2 |
| -FILE SHARING PLATFORM |
| 1 | + |
| 2 | + |
| 3 | + |
| 4 | + |
| 5 | + |
| 6 | +## |
| 7 | + |
| 8 | +**File sharing web platform** -- stores data and can be used to share files with firebase authentication and custom express api's |
| 9 | + |
| 10 | + # **build using()** |
| 11 | + |
| 12 | + * **HTML >** Markdown |
| 13 | + * **CSS >** Styling Markdown |
| 14 | + * **Javascript >** Plain Javascript in frontend |
| 15 | + * **EJS >** Templating Engine |
| 16 | + * **Node JS >** Backend Server which works on V8 engine of Javascript |
| 17 | + * **Express JS >** Backend Framework |
| 18 | + * **Mongo DB >** Database |
| 19 | + * **Firebase >** Used for authentication of users |
| 20 | + |
| 21 | + |
| 22 | + |
| 23 | +## Run Locally |
| 24 | + |
| 25 | +Clone the project |
| 26 | + |
| 27 | +```bash |
| 28 | + git clone https://github.com/Mr-Internetix/file-sync.git |
| 29 | +``` |
| 30 | + |
| 31 | +Go to the project directory |
| 32 | + |
| 33 | +```bash |
| 34 | + cd file-sync |
| 35 | +``` |
| 36 | + |
| 37 | +Install dependencies |
| 38 | + |
| 39 | +```bash |
| 40 | + npm install |
| 41 | +``` |
| 42 | + |
| 43 | +Start the development server |
| 44 | + |
| 45 | +```bash |
| 46 | + npm run dev |
| 47 | +``` |
| 48 | + |
| 49 | + |
| 50 | + |
| 51 | + |
| 52 | + |
| 53 | +## Environment Variables |
| 54 | + |
| 55 | +To run this project, you will need to add the following environment variables to your .env file |
| 56 | + |
| 57 | + |
| 58 | +`MONGO_CONNECTION_URL = your mongo-db atlas api key` |
| 59 | + |
| 60 | +`APP_BASE_URL = http://localhost:3000` |
| 61 | +`you-can change it when deployment use your domain name` |
| 62 | + |
| 63 | +`PORT = 8000` `not mandatory but use it for safer side` |
| 64 | + |
| 65 | + |
| 66 | + |
| 67 | + |
| 68 | + |
| 69 | + |
| 70 | + |
| 71 | + |
| 72 | + |
| 73 | +## Setting up firebase |
| 74 | + |
| 75 | +` Its simple just add the json file Downloaded from the firabase platform with file-name ` **serviceAccountKey.json** `in your root folder of the project i.e next to - server.js file ` |
| 76 | + |
| 77 | + |
| 78 | + |
| 79 | +## Change configuration in `/public/js/login.js` |
| 80 | + |
| 81 | +``` |
| 82 | +var firebaseConfig = { |
| 83 | + // add your firebase configuration |
| 84 | + }; |
| 85 | +
|
| 86 | +``` |
| 87 | +## Change Host in frontend in order to send files in both files |
| 88 | +`/public/js/index.js` , `/public/js/user.js` |
| 89 | + |
| 90 | +```javascript |
| 91 | +const host = "https://localhost:3000" |
| 92 | + |
| 93 | +``` |
| 94 | + |
| 95 | + |
| 96 | +## Database configs |
| 97 | + |
| 98 | +`Just add the Database url in .env file ( I expect that mongo will create the collections automatically if not |
| 99 | +create manually by creating three collections i.e |
| 100 | +` |
| 101 | +* users |
| 102 | +* files |
| 103 | +* userfiles |
| 104 | +# License |
| 105 | +MIT License. |
| 106 | + |
| 107 | +You can create your own homepage for free without notifying me by forking this project under the following conditions: |
| 108 | + |
| 109 | +* Add a link to my Repository or [my-profile](https://www.github.com/mr-internetix) |
| 110 | +* Star the repository |
| 111 | + |
| 112 | + |
| 113 | + |
| 114 | + |
0 commit comments