This project is a hobby project with the main purpose of utilizing Cloudflare D1 and RemixJS on Cloudflare Pages. It uses d1-auto-migrate.ts
for database migration, Prisma for ORM, and Cloudflare's native database methods for querying.
- Users can see text based on their roles.
- By default, when users register, they don't have roles.
- An admin assigns roles to users from the database, creates roles, and assigns role-based secret texts.
- An expiration date is added for users to track their expiration.
- Cloudflare D1: For database management.
- RemixJS: For building the web application.
- Prisma: For ORM.
- Cloudflare Native Database Methods: For querying the database.
- Cloudflare D1 remote database does not work in local development when using Cloudflare Pages.
To get started with this project, follow these steps:
- Clone the repository.
- Install the dependencies using
bun install
. - Set up your environment variables in a
.env
file. - Rename
wrangler.example.toml
towrangler.toml
and set the necessary configuration:name = "realmaccess" compatibility_date = "2024-11-12" pages_build_output_dir = "./build/client" [[d1_databases]] binding = "DB" database_name = "test_prisma" database_id = "c74c2f94-f157-4d83-a140-f81ce916a0ca"
- Run the database migrations using
d1-auto-migrate.ts
. - Start the development server using
bun run dev
.
This project is licensed under the MIT License. See the LICENSE file for details.