Skip to content

R4ULtv/archive-space

Repository files navigation

Archive Space - Simple Archive with Cloudflare R2

This repository provides a simple website for managing your personal archive using Next.js and Cloudflare R2. The application allows users to save files in the cloud and organize them by categories and tags.

Prerequisites

  • Node.js: Download and install the LTS version of Node.js from the official website: Node.js Download.
  • Cloudflare Account: A free or paid Cloudflare account is required. You can create an account at Cloudflare.

Installation

1. Cloudflare Account + API Key:

  • Go to Cloudflare and create a new account or log in to your existing account.
  • In the Cloudflare dashboard, click on "R2" in the left-hand menu.
  • Click on "Create bucket".
  • Give your bucket a name and select the region where you want to create it.
  • Create an API key for the r2 bucket. Check on your profile page.

2. Create your Cloudflare worker:

You need to create a cloudflare worker that manage the download and upload of files. You can create one using the following instructions and examples from my multi-region-r2-bucket-system.

3. Set up your environment variables:

  • Create a .env.local file in the root directory of the project.
  • You need to follow the example on .env.example and fill in all the steps.

4. Install the repository locally:

  • Open a terminal and navigate to the directory where you want to install the repository.
  • Run the following command to clone the repository:
# Clone the repository:
git clone https://github.com/r4ultv/archive-space.git
# Navigate into the project directory:
cd archive-space
# Install the dependencies using npm:
npm install

5. Run the development server:

In the repository directory, run the following command to start the development server:

# Start the development server:
npm run dev

6. Open your browser:

Navigate to http://localhost:3000 to view the application.