Skip to content

Commit e896ecb

Browse files
code updates
code updates
1 parent ec97ad4 commit e896ecb

26 files changed

+6364
-0
lines changed

.github/workflows/main.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Deploy circuit-sketcher-app
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
permissions:
9+
contents: write # Allows actions to push to the repository (required for gh-pages)
10+
pages: write # Allows actions to deploy to GitHub Pages
11+
12+
jobs:
13+
build:
14+
runs-on: ubuntu-latest
15+
steps:
16+
# Step 1: Checkout the code
17+
- name: Checkout code
18+
uses: actions/checkout@v3
19+
20+
# Step 2: Set up Node.js using .nvmrc
21+
- name: Set up Node.js
22+
uses: actions/setup-node@v3
23+
with:
24+
node-version-file: .nvmrc
25+
26+
# Step 3: Install dependencies
27+
- name: Install dependencies
28+
run: npm install
29+
30+
# Step 4: Build the project
31+
- name: Build project
32+
run: npm run build
33+
34+
# Step 5: Upload production-ready build files (artifact)
35+
- name: Upload production-ready build files
36+
uses: actions/upload-artifact@v3
37+
with:
38+
name: production-files
39+
path: ./dist
40+
41+
deploy:
42+
runs-on: ubuntu-latest
43+
needs: build
44+
steps:
45+
# Step 1: Download artifact
46+
- name: Download artifact
47+
uses: actions/download-artifact@v3
48+
with:
49+
name: production-files
50+
path: ./dist
51+
52+
# Step 2: Deploy to GitHub Pages
53+
- name: Deploy to GitHub Pages
54+
uses: peaceiris/actions-gh-pages@v3
55+
with:
56+
github_token: ${{ secrets.GITHUB_TOKEN }}
57+
publish_dir: ./dist

.gitignore

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
pnpm-debug.log*
8+
lerna-debug.log*
9+
10+
node_modules
11+
dist
12+
dist-ssr
13+
*.local
14+
15+
# Editor directories and files
16+
.vscode/*
17+
!.vscode/extensions.json
18+
.idea
19+
.DS_Store
20+
*.suo
21+
*.ntvs*
22+
*.njsproj
23+
*.sln
24+
*.sw?

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
v23.3.0

README.md

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,84 @@
11
# circuit-sketcher-app
22
An application to draw circuits on a canvas, based on circuit-sketcher-core.
3+
4+
## Table of Contents
5+
6+
- [Features](#features)
7+
- [Development](#development)
8+
- [Installation](#installation)
9+
- [Building](#building)
10+
- [Linting](#linting)
11+
- [Preview](#preview)
12+
- [Usage](#usage)
13+
- [Demo](#demo)
14+
- [License](#license)
15+
16+
## Features
17+
18+
- Draw and save circuit diagrams
19+
- Load and save canvas and library data
20+
- Save to Local Storage Library the customized circuit nodes
21+
- Responsive design
22+
- Interactive user interface
23+
24+
## Development
25+
26+
### Installation
27+
28+
1. Clone the repository:
29+
```sh
30+
git clone https://github.com/code-forge-temple/circuit-sketcher-app.git
31+
cd circuit-sketcher-app
32+
```
33+
34+
2. Set the Node.js version:
35+
- For Unix-based systems:
36+
```sh
37+
nvm use
38+
```
39+
- For Windows:
40+
```sh
41+
nvm use $(cat .nvmrc)
42+
```
43+
44+
3. Install dependencies:
45+
```sh
46+
npm install
47+
```
48+
49+
4. Start the development server:
50+
```sh
51+
npm run dev
52+
```
53+
54+
### Building
55+
56+
To build the project for production, run:
57+
```sh
58+
npm run build
59+
```
60+
61+
### Linting
62+
To lint the project, run:
63+
```sh
64+
npm run lint
65+
```
66+
67+
### Preview
68+
To preview the production build, run:
69+
```sh
70+
npm run preview
71+
```
72+
73+
### Usage
74+
75+
1. Open the application in your browser.
76+
2. Use the toolbar to draw and manipulate circuit elements.
77+
3. Save your work using the save buttons.
78+
4. Load previously saved canvases and libraries using the load buttons.
79+
80+
## Demo
81+
You can view the deployed version of the application [here](https://code-forge-temple.github.io/circuit-sketcher-app).
82+
83+
## License
84+
This project is licensed under the GNU General Public License v3.0. See the [LICENSE](LICENSE) file for more details.

eslint.config.mjs

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
import js from '@eslint/js'
2+
import globals from 'globals'
3+
import reactHooks from 'eslint-plugin-react-hooks'
4+
import reactRefresh from 'eslint-plugin-react-refresh'
5+
import tseslint from 'typescript-eslint'
6+
7+
export default tseslint.config(
8+
{ ignores: ['dist'] },
9+
{
10+
extends: [js.configs.recommended, ...tseslint.configs.recommended],
11+
files: ['**/*.{ts,tsx}'],
12+
languageOptions: {
13+
ecmaVersion: 2020,
14+
globals: globals.browser,
15+
},
16+
plugins: {
17+
'react-hooks': reactHooks,
18+
'react-refresh': reactRefresh,
19+
},
20+
rules: {
21+
...reactHooks.configs.recommended.rules,
22+
'react-refresh/only-export-components': [
23+
'warn',
24+
{ allowConstantExport: true },
25+
],
26+
'max-len': ['error', { code: 180 }],
27+
'indent': ['error', 4, { "SwitchCase": 1 }],
28+
'@typescript-eslint/no-explicit-any': 'off',
29+
'no-trailing-spaces': 'error', // Disallow trailing spaces
30+
'no-multi-spaces': 'error', // Disallow multiple spaces
31+
'no-irregular-whitespace': 'error', // Disallow irregular whitespace
32+
'space-in-parens': ['error', 'never'], // Enforce spacing inside parentheses
33+
'space-before-function-paren': ['error', 'always'], // Enforce spacing before function parenthesis
34+
'comma-spacing': ['error', { before: false, after: true }], // Enforce spacing after commas
35+
'object-curly-spacing': ['error', 'never'], // Enforce spacing inside curly braces
36+
},
37+
},
38+
)

index.html

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<!doctype html>
2+
<html lang="en">
3+
4+
<head>
5+
<meta charset="UTF-8" />
6+
<link rel="icon" type="image/x-icon" href="/logo.ico" />
7+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
8+
<title>Circuit Sketcher</title>
9+
</head>
10+
11+
<body>
12+
<div id="root"></div>
13+
<script type="module" src="/src/main.tsx"></script>
14+
</body>
15+
16+
</html>

0 commit comments

Comments
 (0)