- backend/: FastAPI application, runs using Uvicorn.
- frontend/: Next.js application, runs using npm.
- Download the latest Python installer from the official website.
- Run the installer and check the box for "Add Python to PATH".
- Click Install Now and follow the setup instructions.
Verify installation:
python --version
sudo apt update && sudo apt install -y python3
Verify installation:
python3 --version
Using Homebrew:
brew install python
Verify installation:
python3 --version
Install Node.js and npm from the official website, or use:
# macOS/Linux
brew install node
# Windows (via Chocolatey)
choco install nodejs
Verify installation:
node -v
npm -v
-
Download MongoDB Community Server from MongoDB Official Website.
-
Run the installer (
.msi
file) and follow the setup instructions. -
Choose Complete setup.
-
Ensure the option 'Install MongoDB as a service' is checked.
-
Complete the installation and verify using:
mongod --version
-
Open Terminal and run:
brew tap mongodb/brew brew install [email protected]
-
Start MongoDB service:
brew services start [email protected]
-
Verify installation:
mongod --version
-
Import the MongoDB public key:
wget -qO - https://www.mongodb.org/static/pgp/server-6.0.asc | sudo apt-key add -
-
Add the MongoDB repository:
echo "deb [ arch=amd64 ] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/6.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-6.0.list
-
Update the package database:
sudo apt update
-
Install MongoDB:
sudo apt install -y mongodb-org
-
Start MongoDB:
sudo systemctl start mongod
-
Enable MongoDB to start on boot:
sudo systemctl enable mongod
- Verify installation:
mongod --version
-
Download MongoDB Compass from MongoDB Compass Official Website.
-
Run the installer and follow the setup process.
-
Open MongoDB Compass and connect using:
mongodb://localhost:27017
Clone the repository:
git clone https://github.com/Aditya-Coomar/file-server.git
cd your-repo
Navigate to the backend folder:
cd backend
Create and configure a .env
file:
FILE_SERVER_ROOT_STORE='Local_Folder_Path'
JWT_SECRET='your_jwt_secret'
MAIL_USER='[email protected]'
MAIL_SECRET='your_mail_secret'
MAIL_PORT=your_mail_port
MAIL_HOST='your_mail_host'
Configure the Database Connection accordingly in main.py
file:
100 class DatabaseConnection:
101 def __init__(self):
102 self.client = MongoClient("mongodb://localhost:27017/")
103 self.db = self.client["file_server"]
104 self.users_collection = self.db["users"]
105
106 self.users_collection.create_index("email", unique=True)
107 self.users_collection.create_index("username", unique=True)
Install dependencies and start the backend:
pip install -r requirements.txt
uvicorn main:app --host 0.0.0.0 --port 8000 --reload
Navigate to the frontend folder:
cd ../frontend
Create and configure a .env.local
file:
SERVER_URL="http://localhost:8000"
Install dependencies and start the frontend:
npm install
npm run dev
Run the backend and frontend, then open the frontend in a browser:
http://localhost:3000
This project is licensed under the MIT License.