Ask File is a secure, AI-powered document management and chat application built with Next.js and TypeScript. Upload your files, store them safely in AWS S3, and interact with your documents through a conversational interface powered by OpenAI embeddings and Pinecone vector search.
- User authentication and session management
- Secure file uploads to AWS S3
- Relational data persisted in PostgreSQL via Drizzle ORM
- AI-driven document embeddings with OpenAI
- Vector search and chat using Pinecone
- Responsive UI built with Next.js, Tailwind CSS, Radix UI, and Framer Motion
- Framework: Next.js 15 (App Router)
- Language: TypeScript
- Styling: Tailwind CSS
- State Management: Zustand
- Authentication: better-auth
- ORM: Drizzle ORM
- Database: PostgreSQL
- File Storage: AWS S3
- AI & Embeddings: OpenAI API
- Vector DB: Pinecone
- Utilities: Zod, clsx
- Node.js (>=20)
- pnpm (or npm/yarn)
- PostgreSQL database
- AWS S3 bucket
- OpenAI API key
- Pinecone account
# Clone the repository
git clone https://github.com/your-org/ask-file.git
cd ask-file
# Install dependencies
pnpm install(Note: you can also use npm install or yarn install.)
Create a .env.local file in the project root and configure the following variables:
# Database
DATABASE_URL=postgresql://<USER>:<PASSWORD>@<HOST>:<PORT>/<DB_NAME>
# AWS S3
S3_BUCKET_NAME=your-s3-bucket-name
MY_AWS_REGION=us-east-1
MY_AWS_ACCESS_KEY_ID=your-access-key-id
MY_AWS_SECRET_ACCESS_KEY=your-secret-access-key
# OpenAI
OPENAI_API_KEY=your-openai-api-key
# Pinecone
PINECONE_API_KEY=your-pinecone-api-key
PINECONE_HOST=your-project.svc.<region>.pinecone.ioNext.js will automatically load variables from .env.local.
Generate and apply database migrations:
pnpm run db:migrateThis will create the necessary tables in your PostgreSQL database.
Start the development server:
pnpm run devOpen http://localhost:3000 in your browser.
├── src/
│ ├── app/ # Next.js App Router pages & layouts
│ ├── components/ # Reusable React components
│ ├── db/ # Drizzle schemas, migrations & Pinecone utils
│ └── util/ # Services (AWS, OpenAI) & helpers
├── drizzle.config.ts # Drizzle-ORM configuration
├── next.config.ts # Next.js configuration
├── tailwind.config.ts # Tailwind CSS configuration
└── README.md # Project overview
pnpm run dev— Start development serverpnpm run build— Build for productionpnpm run start— Start production serverpnpm run lint— Run ESLintpnpm run format— Format code with Prettierpnpm run db:migrate— Generate & apply Drizzle migrations
Contributions are welcome! Please open issues or pull requests to improve the project.
This project is licensed under the MIT License.