Skip to content

Commit

Permalink
Adding nodejs-sveltekt example (#20)
Browse files Browse the repository at this point in the history
* added oceanbase-python-api, oceanbase-sequelize, oceanbase-sveltekit examples

* added example

* adding nodejs-svelte example

* adding nodejs-svelte example

* adding nodejs-svelte example updated README

---------

Co-authored-by: Wayne <[email protected]>
  • Loading branch information
wayneshn and wayneshn authored Mar 28, 2024
1 parent 94c0c59 commit 977c03a
Show file tree
Hide file tree
Showing 26 changed files with 6,656 additions and 0 deletions.
270 changes: 270 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,273 @@ build/
### Log ###
*.log
/logs



### Sveltekit/node ###

node_modules
# Keep environment variables out of version control
.env
/.svelte-kit
.svelte-kit

# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
config/
jspm_packages/

# Snowpack dependency directory (https://snowpack.dev/)
web_modules/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional stylelint cache
.stylelintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variable files
.env
.env.development.local
.env.test.local
.env.production.local
.env.local

# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache

# Next.js build output
.next
out

# Nuxt.js build / generate output
.nuxt
dist

# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and not Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public

# vuepress build output
.vuepress/dist

# vuepress v2.x temp and cache directory
.temp
.cache

# Docusaurus cache and generated files
.docusaurus

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# TernJS port file
.tern-port

# Stores VSCode versions used for testing VSCode extensions
.vscode-test

# yarn v2
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*

### Python ###

# Editors
.vscode/
.idea/

# Vagrant
.vagrant/

# Mac/OSX
.DS_Store

# Windows
Thumbs.db

# Source for the following rules: https://raw.githubusercontent.com/github/gitignore/master/Python.gitignore
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
.hypothesis/
.pytest_cache/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
.python-version

# celery beat schedule file
celerybeat-schedule

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json
5 changes: 5 additions & 0 deletions nodejs-sveltekit/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
node_modules
# Keep environment variables out of version control
.env
/.svelte-kit
.svelte-kit
34 changes: 34 additions & 0 deletions nodejs-sveltekit/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Full Stack App with SvelteKit and OceanBase

This project demonstrates how to build a fullstack app using SvelteKit for the frontend and OceanBase as the database. The application is a simple Todo app that allows users to create, read, update, and delete tasks.

## Technologies Used

- SvelteKit: A framework for building web applications of all sizes.
- OceanBase: A distributed relational database management system developed by Ant Group.
- MySQL2: A MySQL driver for Node.js.
- Tailwind CSS: A utility-first CSS framework for rapidly building custom user interfaces.

## Setup

1. Clone the repository to your local machine.

2. Navigate to the project directory.

```
cd nodejs-sveltekit
```

3. Install the necessary dependencies.

```
npm i
```

4. Rename the `.env.example` file to `.env` and update the values with your own OceanBase database credentials.

5. Start the development server.
```
npm run dev
```
6. Open your browser and navigate to `http://localhost:3000` to view the app.
10 changes: 10 additions & 0 deletions nodejs-sveltekit/jsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"compilerOptions": {
"baseUrl": ".",
"paths": {
"$lib": ["src/lib"],
"$lib/*": ["src/lib/*"]
}
},
"include": ["src/**/*.d.ts", "src/**/*.js", "src/**/*.svelte"]
}
Loading

0 comments on commit 977c03a

Please sign in to comment.