This is the admin frontend for the Files project, built using React, TypeScript, and Vite for a fast and modern development experience. It is styled with TailwindCSS and features GraphQL integration.
- Features
- Getting Started
- Project Structure
- Technical Details
- Scripts
- Linting & Code Standards
- License
- React + TypeScript SPA architecture
- Vite for fast development and builds
- TailwindCSS for utility-first styling
- GraphQL Codegen for typed queries and mutations
- Authentication context and protected routes
- Apollo Client integration for GraphQL
- Toast notifications via sonner
- Custom utility functions and styling
- Node.js >= 18
- Yarn or npm
npm install
# or
yarn install
npm run dev
# or
yarn dev
Open http://localhost:5173 (default) to view the app.
.
├── src/
│ ├── App.tsx # Main App component, sets up routes
│ ├── main.tsx # App entrypoint, context providers
│ ├── pages.tsx/ # Page components (Index, Users, Login, Files)
│ ├── hooks/ # Custom hooks (e.g., use-auth)
│ ├── utils/ # Apollo client setup, route protection
│ ├── lib/ # Utility functions (e.g., cn for classnames)
│ ├── __generated__/ # GraphQL codegen output
│ ├── index.css # Global styles and Tailwind config
│ ├── App.css # Component-level styles
├── codegen.ts # GraphQL codegen config
├── vite.config.ts # Vite config, alias setup
├── eslint.config.js # ESLint configuration
├── index.html # App HTML template
└── README.md # Project documentation
- Routing: Uses
react-router-dom
for navigation, with route protection for authenticated areas. - Authentication: Provided via a context (
use-auth
). - GraphQL: Apollo Client setup in
utils/apolloClient.tsx
. Code generation configured viacodegen.ts
connecting to your backend athttp://localhost:8888/query
. - Styling: TailwindCSS is imported and configured in
index.css
. Utility functioncn
merges classnames usingclsx
andtailwind-merge
. - Notifications:
sonner
provides rich toast notifications.
dev
: Start local development serverbuild
: Build for productioncodegen
: Generate GraphQL typeslint
: Run ESLint
- ESLint is configured for TypeScript and React, including recommended hooks and refresh plugins.
- See
eslint.config.js
for details and customization options.