Skip to content
Closed
Show file tree
Hide file tree
Changes from 26 commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
4011a4b
add tailwind
ken-zlai Sep 24, 2024
f46c568
format code w/ prettier
ken-zlai Sep 24, 2024
6a05ff7
add shadcn
ken-zlai Sep 24, 2024
2a9aad1
add shadcn button
ken-zlai Sep 24, 2024
f96c4fe
use button on home page for simple counter
ken-zlai Sep 24, 2024
570ba5d
npm run format
ken-zlai Sep 24, 2024
2b2bddc
modify typescript rules to ignore specific errors in shadcn components
ken-zlai Sep 24, 2024
53e759e
configure tailwind typography
ken-zlai Sep 24, 2024
8dab5f7
Merge branch 'ken-websvc' into ken-frontend
ken-zlai Sep 25, 2024
71895c7
basic dark mode config
ken-zlai Sep 25, 2024
d0b55ea
ignore warnings from node_modules folder
ken-zlai Sep 25, 2024
1e11bc2
configure testing stuff
ken-zlai Sep 25, 2024
3205caa
readme
ken-zlai Sep 25, 2024
afb9aea
move tests
ken-zlai Sep 25, 2024
05bce39
dark mode should be applied in the app.html
ken-zlai Sep 25, 2024
1c31f4a
create a reusable echart component
ken-zlai Sep 26, 2024
8f5bd92
basic heatmap to start testing
ken-zlai Sep 26, 2024
201dc8e
install echarts
ken-zlai Sep 26, 2024
251a052
fix type issues
ken-zlai Sep 26, 2024
a77da82
add sheet component
ken-zlai Sep 26, 2024
6d3a1e9
use resizeobserver on my echart
ken-zlai Sep 27, 2024
7462ed4
refactor echart for clarity
ken-zlai Sep 27, 2024
b2270f6
use proper type
ken-zlai Sep 27, 2024
cf8c8e6
svelte 5 state
ken-zlai Sep 27, 2024
ea4ba7b
create SplitView.svelte
ken-zlai Sep 27, 2024
db32508
use SplitView to show heatmap/sidebar
ken-zlai Sep 27, 2024
f8060b1
Merge branch 'piyush--apis' into ken-frontend
ken-zlai Sep 30, 2024
fffd0ed
add table component
ken-zlai Sep 30, 2024
ea0cd3c
index to export table elements
ken-zlai Sep 30, 2024
fd3702b
add basic api
ken-zlai Sep 30, 2024
7eb1bea
type for model
ken-zlai Sep 30, 2024
00f3807
format code
ken-zlai Sep 30, 2024
dc76a03
add ModelsResponse
ken-zlai Sep 30, 2024
998956a
render a basic table with models data
ken-zlai Sep 30, 2024
7ab1d5d
change route structure
ken-zlai Sep 30, 2024
79268df
add preview of timeseries data
ken-zlai Sep 30, 2024
8e9327c
add avatar
ken-zlai Sep 30, 2024
1855d2e
zipline logo
ken-zlai Sep 30, 2024
3d76751
Wire up Play frontend + server in docker setup
piyush-zlai Sep 30, 2024
c3f728a
create a layout for the app w/ top and left bar
ken-zlai Sep 30, 2024
578ed5b
move model code to model route
ken-zlai Sep 30, 2024
a284edb
add loading indication on nav
ken-zlai Sep 30, 2024
114511f
Merge branch 'main' into ken-frontend
ken-zlai Sep 30, 2024
7e7d697
Fix based on coder rabbit suggestions
piyush-zlai Sep 30, 2024
557555b
Address feedback
piyush-zlai Oct 1, 2024
5691a3c
Merge remote-tracking branch 'origin/piyush/docker-play' into ken-fro…
ken-zlai Oct 1, 2024
34da3a4
configure frontend to build using nodejs
ken-zlai Oct 1, 2024
811cb65
create a custom build for docker to use that env file
ken-zlai Oct 1, 2024
6b27bd3
add a quick coming soon to the / route
ken-zlai Oct 1, 2024
115faa3
zipline logo routes to / route
ken-zlai Oct 1, 2024
9e63629
quick header for timeseries data
ken-zlai Oct 1, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,6 @@ releases
# Frontend Vite
/frontend/vite.config.js.timestamp-*
/frontend/vite.config.ts.timestamp-*

# Frontend Test Results
/frontend/test-results
133 changes: 115 additions & 18 deletions frontend/README.md
Original file line number Diff line number Diff line change
@@ -1,38 +1,135 @@
# create-svelte
# Chronon Frontend

Everything you need to build a Svelte project, powered by [`create-svelte`](https://github.com/sveltejs/kit/tree/main/packages/create-svelte).
The frontend for Chronon.

## Creating a project
## Getting Started

If you're seeing this, you've probably already done this step. Congrats!
### Prerequisites

- [Node.js](https://nodejs.org/en/) (LTS version recommended)
- npm (comes with Node.js)

### Installation

1. Clone the repository:

```bash
git clone https://github.com/zipline-ai/chronon.git
cd chronon
```

2. Navigate to the frontend directory:

```bash
cd frontend
```

3. Install dependencies:
```bash
npm install
```

### Development

To start the development server:

```bash
# create a new project in the current directory
npm create svelte@latest
npm run dev
```

This will start a local server. The app will automatically reload if you make changes to the code.

# create a new project in my-app
npm create svelte@latest my-app
### Build

To create an optimized production build:

```bash
npm run build
```

## Developing
This will create an optimized version of your project in the `build` directory.

### Preview

Once you've created a project and installed dependencies with `npm install` (or `pnpm install` or `yarn`), start a development server:
To preview the production build locally:

```bash
npm run dev
npm run preview
```

# or start the server and open the app in a new browser tab
npm run dev -- --open
### Running Tests

#### All Tests

To run both unit and integration tests together:

```bash
npm run test
```

## Building
#### Unit Tests

To create a production version of your app:
To run unit tests using Vitest:

```bash
npm run build
npm run test:unit
```

To run unit tests once:

```bash
npm run test:unit:once
```

#### Integration Tests

To run integration tests using Playwright:

```bash
npm run test:integration
```

To run integration tests once:

```bash
npm run test:integration:once
```

For the Playwright UI to explore test results:

```bash
npm run test:integration:ui
```

### Linting and Formatting

To check code formatting and linting issues:

```bash
npm run lint
```

To format the codebase:

```bash
npm run format
```

### Type Checking

To check the TypeScript types:

```bash
npm run check
```

To continuously check types while developing:

```bash
npm run check:watch
```

You can preview the production build with `npm run preview`.
## Best Practices

> To deploy your app, you may need to install an [adapter](https://kit.svelte.dev/docs/adapters) for your target environment.
1. **Code Style**: This project uses Prettier and ESLint for code formatting and linting. Please run `npm run lint` and `npm run format` before committing changes.
2. **Testing**: Ensure all changes are covered with unit and integration tests. Use Vitest for unit tests and Playwright for integration tests.
Comment on lines +132 to +135
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Consider expanding the Best Practices section.

The current Best Practices section provides a good starting point, but it could be enhanced to provide more comprehensive guidance for contributors.

Consider the following improvements:

  1. Add more specific guidelines, such as:

    • Naming conventions
    • Component structure
    • State management practices
    • Performance considerations
  2. Include a link to a more comprehensive style guide or contribution guidelines document.

  3. Mention any specific coding patterns or architectural decisions that are important for the project.

  4. Add a note about documentation expectations for new features or significant changes.

Example expansion:

## Best Practices

1. **Code Style**: This project uses Prettier and ESLint for code formatting and linting. Please run `npm run lint` and `npm run format` before committing changes.
2. **Testing**: Ensure all changes are covered with unit and integration tests. Use Vitest for unit tests and Playwright for integration tests.
3. **Naming Conventions**: Use PascalCase for component names, camelCase for variables and functions, and UPPER_CASE for constants.
4. **Component Structure**: Follow the Single Responsibility Principle. Keep components small and focused on a single task.
5. **State Management**: Use React hooks for local state and [preferred state management solution] for global state.
6. **Performance**: Optimize renders by using React.memo, useMemo, and useCallback where appropriate.
7. **Documentation**: Update relevant documentation when adding new features or making significant changes.

For more detailed guidelines, please refer to our [Contribution Guidelines](link-to-guidelines).

14 changes: 14 additions & 0 deletions frontend/components.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"$schema": "https://shadcn-svelte.com/schema.json",
"style": "new-york",
"tailwind": {
"config": "tailwind.config.js",
"css": "src/app.css",
"baseColor": "neutral"
},
Comment on lines +4 to +8
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codebase verification

Missing Tailwind Configuration Files

The Tailwind configuration is referencing tailwind.config.js and src/app.css, but neither of these files exist in the repository. Please ensure these files are added or update the references accordingly.

🔗 Analysis chain

LGTM! Verify the existence of specified Tailwind files.

The Tailwind configuration looks good. The base color is set to "neutral", which is a valid Tailwind color.

Please run the following script to verify the existence of the specified Tailwind files:


Please run the following corrected script to verify the existence of the specified Tailwind files:

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the existence of Tailwind configuration files

# Test: Check if tailwind.config.js exists
if [ -f "tailwind.config.js" ]; then
    echo "tailwind.config.js exists"
else
    echo "tailwind.config.js does not exist"
fi

# Test: Check if src/app.css exists
if [ -f "src/app.css" ]; then
    echo "src/app.css exists"
else
    echo "src/app.css does not exist"
fi

Length of output: 431


Script:

# 
#!/bin/bash
# Description: Verify the existence of Tailwind configuration files

# Test: Check if tailwind.config.js exists
if [ -f "tailwind.config.js" ]; then
    echo "tailwind.config.js exists"
else
    echo "tailwind.config.js does not exist"
fi

# Test: Check if src/app.css exists
if [ -f "src/app.css" ]; then
    echo "src/app.css exists"
else
    echo "src/app.css does not exist"
fi

Length of output: 196

"aliases": {
"components": "$lib/components",
"utils": "$lib/utils"
},
"typescript": true
}
Comment on lines +1 to +14
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Consider additional configurations for enhanced setup.

The overall structure of the configuration file is good and covers the basic setup for a SvelteKit project with shadcn UI and Tailwind CSS. However, you might want to consider adding some additional configurations to enhance your setup:

  1. Add a outDir property to specify the output directory for the built files.
  2. Include a componentPath to define a custom path for shadcn components if needed.
  3. Consider adding a themes array if you plan to support multiple themes.

Here's an example of how these additions might look:

{
  // ... existing configurations ...
  "outDir": "src/lib/components/ui",
  "componentPath": "src/lib/components/ui",
  "themes": ["light", "dark"]
}

These additions can provide more flexibility and control over your project structure and theming.

9 changes: 9 additions & 0 deletions frontend/eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,15 @@ export default [
parserOptions: {
parser: ts.parser
}
},
rules: {
'@typescript-eslint/no-unused-vars': [
'error',
{
argsIgnorePattern: '^_',
varsIgnorePattern: '^\\$\\$(Props|Events|Slots|Generic)$'
}
]
}
},
{
Expand Down
Loading