Coder Social home page Coder Social logo

2be.solar's Introduction

Elite Solar Solutions

A SAAS Portfolio project for Elite Solar Solutions

NOTES

  • This Project using "pnpm" as package manager. (not npm or yarn)!!!
  • Nuxt 3 stable version

Table of Contents

Deploy as Static Site

Notes

Styles

Tailwindcss import managed by windicss. and you can add custom styles in :

/path/to/assets/sass/app.scss

Theme (Dark Mode)

ThemeManager is a plugin that allows you to switch between themes. this lib in :

/path/to/utils/theme.ts

Thememanager is a function-class construct when app.vue before mounted. theme construct inside AppSetup() in /path/to/app.vue :

<!-- /path/to/app.vue -->
<script lang="ts" setup>
import { AppSetup } from '~/utils/app';
// app setup
AppSetup()
</script>

To change theme, you can direct set theme from state theme.setting, example :

<script lang="ts" setup>
import { IThemeSettingOptions } from '~/utils/theme'
const themeSetting = useState<IThemeSettingOptions>('theme.setting')
themeSetting.value = 'dark'
</script>

When you change state theme.setting, it will automatically change theme.

Theme Setting have 4 options :

  • light
  • dark
  • system (operating system theme)
  • realtime (realtime theme, if 05:00 - 17:00, it will change to light theme, otherwise dark)

We have state theme.current, this state return light or dark theme. basically it's process from theme.setting. dont change theme with this state.

Localization

Localization is a plugin that allows you to switch between languages. this lib in :

/path/to/utils/lang.ts

LanguageManager is a function-class construct when app.vue before mounted. this lib depend on @intlify/nuxt3 lang construct inside AppSetup() in /path/to/app.vue :

<script lang="ts" setup> import { AppSetup } from '~/utils/app'; // app setup AppSetup() </script>

To change language, you can direct set language from state lang.setting, example :

<script lang="ts" setup>
const langSetting = useState<string>('locale.setting')
langSetting.value = 'en'
</script>

When you change state locale.setting, it will automatically change language.

Generate Locales

I made an automatic tool to automatically translate to all languages that have been prepared in the ./locales/ folder So, you can just update "locales/en.yml" and run this tools, it will automatically translate to all languages.

You can just run :

pnpm generate:locales

# or :

node ./tools/translator.js ./locales en.yml

Icons

This project using unplugin-icons for auto generate and import icon as component.

You can see collection icon list in : https://icones.js.org/

you can use <prefix-collection:icon /> or <PrefixCollection:Icon />.

in this project, configuration prefix as a "icon", you can see in nuxt.config.ts :

export default defineNuxtConfig({
    ...

    vite: {
        plugins: [
            UnpluginComponentsVite({
                dts: true,
                resolvers: [
                    IconsResolver({
                        prefix: 'Icon',
                    }),
                ],
            }),
        ],
    },

    ...
})

Example :

// use icon from collection "Simple Icons" and name icon is "nuxtdotjs"
<IconSimpleIcons:nuxtdotjs />

// use icon from collection "Unicons" and name icon is "sun"
<IconUil:sun />

Precommit and Postmerge

This project using husky and commitlint for precommit and postmerge. when you commit, it will check your commit message and running "pnpm lint-staged" to check your staged files. configuration in : /path/to/.husky/pre-commit and /path/to/commitlint.config.js

And when Postmerge, it will run "pnpm" to automatically install new dependencies. configuration in /path/to/.husky/post-merge

License

This project is licensed under the Apache License 2.0, Copyright (c) 2022 Muthu Prasath. For more information see the LICENSE file.

2be.solar's People

Contributors

vitye avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.