diff --git a/.env.example b/.env.example new file mode 100644 index 0000000000000000000000000000000000000000..b0f389181d8e9abe88b1194d72781f969930af40 --- /dev/null +++ b/.env.example @@ -0,0 +1,31 @@ +# Server +PORT=5000 +NODE_ENV=development + +# MongoDB +MONGODB_URI=mongodb://localhost:27017/directorai + +# Redis +REDIS_URL=redis://localhost:6379 + +# JWT +JWT_SECRET=your_jwt_secret_here +JWT_EXPIRES_IN=7d + +# Antigravity CLI +ANTIGRAVITY_CLI_PATH=antigravity + +# Email (Nodemailer) +SMTP_HOST=smtp.gmail.com +SMTP_PORT=587 +SMTP_USER=your_email@gmail.com +SMTP_PASS=your_app_password + +# Stripe (payments only) +STRIPE_SECRET_KEY=sk_test_xxx +STRIPE_WEBHOOK_SECRET=whsec_xxx + +# File storage +UPLOAD_DIR=./uploads +GENERATED_DIR=./generated +MAX_UPLOAD_SIZE=104857600 diff --git a/.gitattributes b/.gitattributes index a6344aac8c09253b3b630fb776ae94478aa0275b..a3e39872a8e6c47dc270e47dd8c3a90fcf6d9eff 100644 --- a/.gitattributes +++ b/.gitattributes @@ -33,3 +33,6 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text *.zip filter=lfs diff=lfs merge=lfs -text *.zst filter=lfs diff=lfs merge=lfs -text *tfevents* filter=lfs diff=lfs merge=lfs -text +data/db/diagnostic.data/metrics.2026-03-04T05-33-55Z-00000 filter=lfs diff=lfs merge=lfs -text +data/db/journal/WiredTigerLog.0000000001 filter=lfs diff=lfs merge=lfs -text +data/db/journal/WiredTigerPreplog.0000000001 filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..ec23899ef83c8229b2f0e157c7ff018672f8f166 --- /dev/null +++ b/.gitignore @@ -0,0 +1,18 @@ +node_modules/ +dist/ +build/ +.env +*.log +uploads/ +generated/ +exports/ +.DS_Store +Thumbs.db +coverage/ +.vite/ +*.mjs +vite.config.ts.timestamp-* +data/ +*.lock +*.wt +WiredTiger* diff --git a/README.md b/README.md new file mode 100644 index 0000000000000000000000000000000000000000..0890510c47229396ba7d6d607cea297c0454eb0a --- /dev/null +++ b/README.md @@ -0,0 +1,162 @@ +# Director.AI + +> **Faceless video creation platform powered by real AI CLI integration.** +> Built with React, TypeScript, Express, MongoDB, and Socket.IO. + + + + + + + + +--- + +## Quick Setup Tutorial + +Follow these steps to get Director.AI running on your local machine. + +### 1. Clone the Repository +```bash +git clone https://huggingface.co/algorembrant/1st-hackaton +cd 1st-hackaton +``` + +### 2. Install MongoDB and Compass +- **Download MongoDB Community Server**: Visit the [MongoDB Download Center](https://www.mongodb.com/try/download/community) and download the MSI installer for Windows. +- **Install**: Run the installer and ensure "Install MongoDB as a Service" is checked. +- **MongoDB Compass**: During installation, check the box to install MongoDB Compass (the GUI for managing your data). +- **Verify**: Open MongoDB Compass and connect to `mongodb://localhost:27017`. + +### 3. Environment Configuration +- Create a `.env` file in the root directory by copying the example: + ```bash + cp .env.example .env + ``` +- Open `.env` and fill in the following: + - `MONGODB_URI`: `mongodb://localhost:27017/director-ai` + - `PORT`: `5000` + - `JWT_SECRET`: Any random long string + - `REDIS_URL`: `redis://localhost:6379` (If using Redis features) + + or simply just tell you AI agent to configure things for you. + +### 4. Install Dependencies +```bash +npm install +``` + +### 5. Running the Application +- **Server**: `cd server && npm run dev` +- **Client**: `cd client && npm run dev` +- **Both**: From the root, run `npm run dev`. + +--- + +## Overview + +Director.AI allows users to input scripts, customize voices, music, visual styles, and assets, then generate optimized faceless videos for social platforms (TikTok, Reels, Shorts, YouTube). + +The application features a novel **real-time AI Terminal** that directly bridges the webapp to the **Google Antigravity CLI**, streaming output via WebSocket—no simulations, no mocks. + +### Key Features + +- **AI Terminal**: Real-time CLI bridge via WebSocket—type prompts in the webapp, get live output from the Antigravity CLI. +- **5-Step Video Wizard**: Script, Voice, Music, Style, Assets → Generate. +- **Multi-Platform Export**: 9:16 (TikTok/Reels/Shorts), 16:9 (YouTube), 1:1 (Instagram). +- **JWT Authentication**: Secure register/login with bcrypt hashing. +- **Luxury Dark Theme**: Gold accents, Playfair Display + Montserrat, glassmorphism, Framer Motion animations. +- **Style Presets**: Save and reuse brand configurations. +- **File Upload**: Multer with 100MB limit and file type filtering. +- **Admin Dashboard**: Queue monitoring and stats overview. + +--- + +## System Architecture + +```mermaid +graph TD + A["User Browser"] -->|HTTP + WebSocket| B["Express Server :5000"] + B -->|Mongoose| C[MongoDB] + B -->|Socket.IO| D["WebSocket Layer"] + D -->|child_process.spawn| E["Antigravity CLI"] + E -->|stdout/stderr stream| D + D -->|Real-time output| A + B -->|Multer| F["File Storage /uploads"] + B -->|"Generated"| G["/generated"] + + subgraph Frontend [":5173"] + H["React + TypeScript"] + I["Redux Toolkit"] + J["Framer Motion"] + K["Tailwind CSS"] + L["AI Terminal Component"] + end + + subgraph Backend [":5000"] + M["JWT Auth"] + N["REST API Routes"] + O["CLI Bridge Service"] + P["Rate Limiting + Helmet"] + end + + A --> H + H --> I + H --> L + L -->|Socket.IO Client| D +``` + +--- + +## Project Structure + +```text +1st-hackaton/ +├── .env.example +├── .gitignore +├── package.json +├── prompt.md +├── README.md +├── server/ +│ ├── src/ +│ │ ├── index.ts # Main Entry +│ │ ├── config/ # Database & App Config +│ │ ├── models/ # Mongoose Schemas +│ │ ├── routes/ # API Endpoints +│ │ ├── services/ # Business Logic +│ │ └── utils/ # Helpers +│ └── tsconfig.json +└── client/ + ├── src/ + │ ├── components/ # UI Building Blocks + │ ├── pages/ # Main Views + │ ├── services/ # API Integration + │ └── store/ # Redux State Management + ├── vite.config.ts + └── tailwind.config.js +``` + +--- + +## Hugging Face Deployment + +This project is optimized for deployment on Hugging Face. + +- **Repository**: [https://huggingface.co/algorembrant/1st-hackaton](https://huggingface.co/algorembrant/1st-hackaton) +- **Author Profile**: [https://huggingface.co/algorembrant](https://huggingface.co/algorembrant) + +> [!IMPORTANT] +> Large assets or binary files should be handled via **Xet Storage** or **Git LFS** to ensure optimal performance on Hugging Face. + +--- + +## Author + +**Rembrant Oyangoren Albeos** +- Hugging Face: [@algorembrant](https://huggingface.co/algorembrant) + +--- + +## License + +MIT License | © 2026 **Rembrant Oyangoren Albeos** diff --git a/client/index.html b/client/index.html new file mode 100644 index 0000000000000000000000000000000000000000..c7c265393d761b588fc406e99d3d5fef4f998e57 --- /dev/null +++ b/client/index.html @@ -0,0 +1,16 @@ + + +
+ + + ++ Manage your projects and create new videos +
+{stat.value}
+{stat.label}
+Create your first project to start generating videos
+ ++ {project.videos?.length || 0} video{project.videos?.length !== 1 ? 's' : ''} -- {project.defaultFormat} +
+ ++ {step.desc} +
+{f.desc}
+{a.desc}
+{answer}
+Sign in to your Director.AI account
++ Don't have an account?{' '} + + Create one + +
+No preview available yet
+Generate a preview using the AI Terminal below
++ {video.script || 'No script provided'} +
+Last updated: March 2026
+ +We collect information you provide directly: email address, password (encrypted), project data, uploaded assets, and video generation preferences. We also collect usage data including session duration, feature usage patterns, and error logs for improving our service.
+ +Your information is used to provide and improve the Director.AI service, process video generation requests, authenticate your account, send essential service notifications, and maintain security. We do not sell your personal data to third parties.
+ +All data is stored on secure servers with encryption at rest and in transit. Passwords are hashed using bcrypt with a cost factor of 12. Uploaded assets and generated videos are stored in isolated user-specific directories.
+ +Account data is retained as long as your account is active. You may request deletion of your account and all associated data at any time by contacting support. Generated videos and uploaded assets are retained for 90 days after account deletion.
+ +Director.AI may integrate with payment processors (Stripe) for subscription management. These services have their own privacy policies. No personal data is shared with AI model providers beyond what is necessary for video generation.
+ +For privacy-related inquiries, contact the development team through the project repository.
++ {project.defaultPlatform} -- {project.defaultFormat} -- {project.videos?.length || 0} videos +
+Create your first video in this project
+ ++ {video.script?.slice(0, 120) || 'No script yet'}... +
+ +Start creating faceless videos today
++ Already have an account?{' '} + + Sign in + +
+ ++ By creating an account, you agree to our{' '} + Terms + {' '}and{' '} + Privacy Policy. +
+Last updated: March 2026
+ +By accessing or using Director.AI, you agree to be bound by these Terms of Use. If you do not agree to all terms, do not use the service.
+ +Director.AI is a web-based platform for creating faceless videos using AI-powered tools. The service includes script-to-video conversion, AI voice generation, subtitle creation, and multi-format video export.
+ +You must provide a valid email address and maintain the security of your account credentials. You are responsible for all activity under your account. Sharing account access is not permitted without prior authorization.
+ +You retain ownership of scripts, assets, and other content you provide. Videos generated through the platform are owned by you. Director.AI does not claim any rights to user-generated content. You are responsible for ensuring your content does not infringe on third-party rights.
+ +You agree not to use Director.AI for generating content that is illegal, harmful, defamatory, or infringes on the rights of others. Abuse of the AI generation system, including attempts to circumvent rate limits or usage quotas, may result in account suspension.
+ +Free tier users receive a limited number of video generations per month. Paid subscriptions unlock additional features and higher usage limits. All payments are processed through Stripe. Subscriptions can be cancelled at any time.
+ +Director.AI is provided "as is" without warranties of any kind. We are not liable for any damages arising from the use or inability to use the service, including lost profits or data loss.
+ +We reserve the right to modify these terms at any time. Continued use of the service after changes constitutes acceptance of the updated terms.
+Paste your video script or write it directly. This will be used for voiceover and subtitles.
+Configure the AI voiceover for your video.
+Choose music for your video or upload your own track.
+Customize the look and feel of your video.
+Add clips, images, or logos to include in your video.
+