W-Tales Studio is a comprehensive, all-in-one solution for managing your studio. From bookings and clients to shoots and payments, this application provides a centralized platform to streamline your entire workflow.
- Framework: Next.js
- Database: Supabase
- ORM: Drizzle ORM
- Authentication: Supabase Auth
- Styling: Tailwind CSS
- UI Components: shadcn/ui
- Linting & Formatting: Biome, ESLint
Before you begin, ensure you have the following installed:
- Node.js (v20 or later)
- pnpm
- Supabase CLI
-
Clone the repository:
git clone https://github.com/your-username/w-tales-studio.git cd w-tales-studio -
Install dependencies:
pnpm install
-
Set up environment variables:
Create a
.env.localfile in the root of the project and add the following environment variables:DATABASE_URL="your-supabase-database-url"
You can get the
DATABASE_URLfrom your Supabase project settings. TheOPEN_AI_API_KEYis required for Supabase AI features in the Studio. TheNEXT_PUBLIC_PUBLISHABLE_KEYis a placeholder for any public keys your application might need.
This project uses Supabase for the database and Drizzle ORM for interacting with it.
-
Start Supabase locally:
supabase start
-
Apply database schema:
Instead of running migrations directly, you can push the schema to your local Supabase instance:
supabase db push
This command will synchronize the database schema with your local Supabase database.
-
Making schema changes:
When you make changes to the database schema in
src/lib/db/schema.ts, you'll need to generate a new migration file. To do this, run the following command:pnpm drizzle-kit generate
This will create a new migration file in the
supabase/migrationsdirectory. You can then apply the migration using thepnpm drizzle-kit migratecommand.
This project uses better-auth for authentication, a flexible and powerful authentication library for modern web applications.
Make sure you have the following authentication-related environment variables in your .env.local file:
GOOGLE_CLIENT_ID="your-google-client-id"
GOOGLE_CLIENT_SECRET="your-google-client-secret"
BETTER_AUTH_URL="http://localhost:3000"GOOGLE_CLIENT_IDandGOOGLE_CLIENT_SECRET: These are required for Google OAuth. You can obtain them from the Google API Console.BETTER_AUTH_EMAIL: The email address to use for sending verification and password reset emails.BETTER_AUTH_URL: The base URL of your application.
The authentication setup is defined in src/lib/auth/index.ts. It uses the Drizzle adapter to connect to the database and resend for sending emails. The configuration includes support for email/password authentication and Google OAuth.
- Email/Password: Users can sign up and sign in with their email and password. Password reset functionality is also implemented.
- Google OAuth: Users can sign in with their Google account.
- Organizations: The application supports multi-tenancy through organizations. Users can create and be invited to organizations.
- Email Templates: The email templates for invitations and password resets are located in
src/lib/email/.
To run the application in development mode, use the following command:
pnpm devThis will start the development server at http://localhost:3000.
To deploy the application, you can use a platform like Vercel or Netlify.
- Push your code to a Git repository.
- Connect your repository to your chosen deployment platform.
- Configure the environment variables on your deployment platform.
- Trigger a deployment.
The build command is pnpm build and the start command is pnpm start.