Ensure you have the following installed before proceeding:
-
Clone the repository
git clone https://github.com/AdityaPatil22/ zen-ui.git cd zen-ui -
Install dependencies
npm install
Create a .env file in the root directory and add the necessary environment variables:
# Example environment variables
MONGO_URI=mongodb+srv://<username>:<password>@cluster.mongodb.net/<dbname>
JWT_SECRET=<your_jwt_secret>
NEXTAUTH_URL=http://localhost:3000To start the development server, run:
npm run devThis will launch the application in development mode at http://localhost:3000.
To build the project, use:
npm run build- Run ESLint to check for issues:
npm run lint
- Format the code using Prettier:
npm run format
Tailwind is included in the project. If you need to configure it, update the tailwind.config.js file.
- Next.js for server-side rendering and frontend framework.
- React & React DOM for UI components.
- NextAuth.js for authentication.
- Mongoose for MongoDB integration.
- bcrypt & jsonwebtoken for authentication and security.
- dotenv for managing environment variables.
- Tailwind CSS for styling.
- Fork the repository.
- Create a new branch (
git checkout -b feature-branch). - Commit your changes (
git commit -m 'Add new feature'). - Push to the branch (
git push origin feature-branch). - Open a Pull Request.
The project includes an NPM package (zenkit-ui) for reusable UI components. Components are built using Lit.
-
Navigate to the package directory:
cd zen-ui/ui-components -
Create a new component file , e.g.,
Button.js:import { LitElement, html, css } from 'lit'; class MyButton extends LitElement { static styles = css` button { background: blue; color: white; padding: 10px; border: none; cursor: pointer; } `; render() { return html`<button><slot></slot></button>`; } } customElements.define('Button', MyButton);
-
Export the component in
index.ts:export * from './my-button';
To build the package, run:
rm -rf dist
npm run buildThis will generate the dist folder containing the bundled components.
- Ensure you are logged into NPM:
npm login
- Publish the package:
npm publish --access public