Skip to content

Commit

Permalink
add: script, data, models, and config to populate a local sqlite data…
Browse files Browse the repository at this point in the history
…base with example bryntum scheduler data
  • Loading branch information
MattDClarke committed Oct 2, 2024
1 parent 24de83b commit 5360ceb
Show file tree
Hide file tree
Showing 34 changed files with 2,987 additions and 1,054 deletions.
97 changes: 95 additions & 2 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,96 @@
{
"extends": "next/core-web-vitals"
}
"extends": "next/core-web-vitals",
"globals": {
"browser": true
},
"rules": {
"accessor-pairs": "off",
"array-bracket-spacing": ["warn", "never"],
"array-callback-return": "off",
"brace-style": [
"warn",
"stroustrup",
{
"allowSingleLine": false
}
],
"comma-dangle": ["error", "never"],
"computed-property-spacing": ["warn", "never"],
"dot-notation": "off",
"eqeqeq": "off",
"indent": [
"error",
4,
{
"SwitchCase": 1,
"ignoredNodes": ["TemplateLiteral"]
}
],
"key-spacing": [
"warn",
{
"multiLine": {
"afterColon": true,
"align": "colon",
"beforeColon": true
},
"singleLine": {
"afterColon": true,
"beforeColon": true
}
}
],
"linebreak-style": ["error", "unix"],
"multiline-ternary": "off",
"new-cap": [
"warn",
{
"capIsNew": false,
"newIsCap": false,
"properties": false
}
],
"no-duplicate-imports": "error",
"no-extra-boolean-cast": "off",
"no-inner-declarations": "off",
"no-mixed-operators": "off",
"no-multi-spaces": "off",
"no-new-func": "off",
"no-new-wrappers": "off",
"no-prototype-builtins": "off",
"no-restricted-globals": ["error", "event", "describe"],
"no-return-assign": "off",
"no-trailing-spaces": "warn",
"no-unmodified-loop-condition": "off",
"no-unused-expressions": "off",
"no-use-before-define": "off",
"node/no-callback-literal": "off",
"object-curly-spacing": ["warn", "always"],
"one-var": "off",
"padded-blocks": "off",
"prefer-const": "warn",
"prefer-promise-reject-errors": "off",
"prefer-regex-literals": "off",
"quotes": [
"warn",
"single",
{
"allowTemplateLiterals": true,
"avoidEscape": true
}
],
"semi": ["error", "always"],
"space-before-function-paren": ["warn", "never"],
"spaced-comment": "off",
"standard/no-callback-literal": "off",
"template-curly-spacing": "off",
"yoda": [
"error",
"never",
{
"onlyEquality": true
}
],
"n/no-callback-literal": "off"
}
}
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,6 @@ yarn-error.log*

# typescript
*.tsbuildinfo
next-env.d.ts
next-env.d.ts

database.sqlite3
57 changes: 29 additions & 28 deletions README.MD
Original file line number Diff line number Diff line change
@@ -1,46 +1,47 @@
# starter-repo
# Create a Bryntum Scheduler component in a Refine application using NextJS

<div align="center" style="margin: 30px;">
<a href="https://refine.dev">
<img alt="refine logo" src="https://refine.ams3.cdn.digitaloceanspaces.com/readme/refine-readme-banner.png">
</a>
</div>
<br/>
This [Refine](https://github.com/refinedev/refine) project was generated using the [Refine CLI-based Scaffolder](https://github.com/refinedev/refine/tree/master/packages/create-refine-app). The following CLI options were selected:

This [Refine](https://github.com/refinedev/refine) project was generated with [create refine-app](https://github.com/refinedev/refine/tree/master/packages/create-refine-app).
- **Choose a project template**: Next.js
- **Choose your backend service to connect**: REST API - Installs the REST API data provider.
- **Do you want to use a UI Framework?**: Headless - No UI framework.
- **Do you want to add example pages?**: Yes
- **Do you need any Authentication logic?**: None

## Getting Started
The following code was added to the Next.js template for creating a SQLite database populated with Bryntum Scheduler data:

A React Framework for building internal tools, admin panels, dashboards & B2B apps with unmatched flexibility ✨
- `/src/config/database.ts`: [Sequelize](https://sequelize.org/), a Node.js ORM, SQLite database configuration.
- `/src/models`:  Sequelize models for Bryntum Scheduler data.
- `/src/initialData`: Example events, resources, and assignments JSON Bryntum Scheduler data.
- `/src/addExampleData.js`: Seed script to populate a local SQLite database with example JSON data.

Refine's hooks and components simplifies the development process and eliminates the repetitive tasks by providing industry-standard solutions for crucial aspects of a project, including authentication, access control, routing, networking, state management, and i18n.
The following npm packages were added:

## Available Scripts
- `sequelize`
- `sqlite3`

### Running the development server.
## Getting started

```bash
npm run dev
```

### Building for production.
Install the dependencies by running the following command: 

```bash
npm run build
```sh
npm install
```

### Running the production server.
Populate a local SQLite database with the example scheduler data in `src/initialData`:

```bash
npm run start
```sh
node src/addExampleData.js
```

## Learn More
## Running the app

To learn more about **Refine**, please check out the [Documentation](https://refine.dev/docs)
Run the local dev server using the following command:

- **REST Data Provider** [Docs](https://refine.dev/docs/core/providers/data-provider/#overview)
```sh
npm run dev
```

## License
You'll see the template Next.js CRUD app at `http://localhost:3000/` with a blog posts and categories page:

MIT
![Initial Bryntum Gantt with two tasks and a dependency between the tasks](images/initial-app.png)
Binary file added images/initial-app.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 5360ceb

Please sign in to comment.