Home > Web Front-end > JS Tutorial > Create an Admin Panel for your project in inutes

Create an Admin Panel for your project in inutes

DDD
Release: 2024-12-22 03:38:10
Original
481 people have browsed it

Kottster is a free tool to help developers quickly build and deploy admin panels. In just 5 minutes, you can generate a fully functional admin panel, deploy it to the cloud, and share it with your team.

When you build apps with Kottster, they run on Remix, a web framework for creating full-stack apps using React and Node.js environment.

In this article, I'll show you how to create a Kottster app, connect it to your database, generate pages for specific tables, and host it anywhere.


Creating a project

Before you begin, make sure Node.js (v20 or higher) is installed on your machine.

To create a new project, run this command:

npx @kottster/cli new
Copy after login
Copy after login

You’ll be asked for a project name, whether you want to use JavaScript or TypeScript, and which package manager to use. After that, a new project folder will be created with everything you need to get started.

Create an Admin Panel for your project in inutes

To start the app locally, open the created folder and run npm run dev:

Create an Admin Panel for your project in inutes

When the app loads, you'll see the login page. Click “Create an account” to sign up on Kottster. After signing up, enter a name for your app and click “Create app”. This will create your app and log you in.

Once everything is set up, you’ll see the “Getting started” page:

Create an Admin Panel for your project in inutes


Connect your database

On the Getting Started page, choose your database type, enter the connection details, and click “Connect”.

This will install the necessary packages and create a file with a data source connected to your database in your project folder.

Please notice that with your app being self-hosted, your credentials always remain private, and the Kottster tool doesn’t have access to your database.


Generate pages

After connecting your database, you'll see the “Generate pages” tab:

Create an Admin Panel for your project in inutes

This page helps you quickly create pages to view or manage data from your database tables.

If you enable “Allow insert” or “Allow update”, forms for adding and updating records will be available. Enabling “Allow delete” will add the ability to delete records.

Once you've made your selections, click "Generate pages". The tool will automatically generate the page files and update the sidebar menu with new items.


How pages work

Each page in your admin panel is located in the app/routes directory. These pages are essentially Remix routes that serve as both the UI and API, and you can customize them however you like.

Each page file in the Kottster app should export a React component, , that represents the page itself. You can include any content inside this component.

When you generate a page for a specific database table, it will include the following: