This is a Next.js project bootstrapped with create-next-app.
First, run the development server:
npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun devTo generate a hashed password for the admin user, run the following script in the project root:
node -e "const bcrypt = require('bcrypt'); bcrypt.hash('<YOU_PASSWORD>', 10).then(hash => console.log(hash));"This project includes a database preloaded with dummy data for testing purposes. No additional setup is required to use the database.
Please note that file upload functionality is disabled in this test project. Any attempts to upload files will not be processed.
To enable image saving functionality, you need to connect the application to a bucket storage service (e.g., AWS S3, Google Cloud Storage, etc.). Configure the storage settings in the environment variables.
To enable images for your custom image bucket, update the next.config.js file in the project root with the following configuration:
images: {
domains: ["your-image-domain.com"], // Replace with your image domain
}The project requires the following environment variables to be set in a .env file at the root of the project:
# Authentication
NEXTAUTH_SECRET=<secret_string> # random string
NEXTAUTH_URL=<full_path> # http://localhost:3500
# R2 Storage Configuration
NEXT_PRIVATE_R2_TOKEN_VALUE=<valid_token>
NEXT_PRIVATE_R2_ACCESS_KEY_ID=<valid_token>
NEXT_PRIVATE_R2_SECRET_ACCESS_KEY=<valid_token>
NEXT_PUBLIC_R2_ENDPOINT=<valid_url>
NEXT_PUBLIC_R2_BUCKET_NAME=<valid_bucket_name>
NEXT_PUBLIC_UPLOADS_PATH=<valid_path>Ensure you replace <valid_token>, <valid_url>, <valid_bucket_name>, and <valid_path> with the appropriate values for your setup.
To configure R2 Cloudflare for this project, follow these steps:
-
Log in to your Cloudflare account and navigate to the R2 section.
-
Create a new bucket or use an existing one.
-
Obtain the following details:
- Access Key ID
- Secret Access Key
- Bucket Name
- Endpoint URL
-
Update the
.envfile in the project root with the R2 credentials:
NEXT_PRIVATE_R2_ACCESS_KEY_ID=<your_access_key_id>
NEXT_PRIVATE_R2_SECRET_ACCESS_KEY=<your_secret_access_key>
NEXT_PUBLIC_R2_BUCKET_NAME=<your_bucket_name>
NEXT_PUBLIC_R2_ENDPOINT=<your_endpoint_url>-
Ensure the bucket permissions are configured to allow access from your application.
-
Test the configuration by running the application and verifying that the R2 integration works as expected.
Open http://localhost:3500 with your browser to see the result.
