Giter Site home page Giter Site logo

locokit / locokit Goto Github PK

View Code? Open in Web Editor NEW
63.0 2.0 7.0 109.54 MB

The Low Code Kit repository

Home Page: https://locokit.io

License: MIT License

Dockerfile 0.07% Shell 0.03% JavaScript 23.68% TypeScript 48.27% HTML 0.15% PEG.js 0.68% EJS 0.11% Vue 23.87% CSS 0.07% SCSS 3.07%
airtable locokit low-code nocode

locokit's Introduction

LocoKit - the Low-Code Kit Platform

LocoKit logo

Welcome on the monorepo of LocoKit, aka Low-Code Kit platform.

LocoKit is an AirTable alternative, providing database management as a spreadsheet and an app builder.

There is the backend part (api directory), the frontend (front directory), the documentation (docs) and several packages. (only glossary actually).

Getting started

Before all, you need to use the version of node indicates in .nvmrc:

npm use

Initialize node modules:

For each directory (api, front, docs, packages/glossary), you need to:

npm ci # install deps

From here you need docker and docker-compose in recent version.

In the front directory, you need to create a .env file from the .env.dist. Then in public, you also need to create a config.js file from the config.js.dist. View the full config reference.

cp .env.dist .env
cp public/config.js.dist public/config.js

In the api directory, same thing, but with the .env.example file.

cp .env.example .env
docker-compose up # you can add -d to use the daemon option of docker-compose

# in another terminal
npm ci
npm run migrate:latest
npm run seed:run
npm run start

The default user created is [email protected] with password locokit.

API

Swagger

A swagger is available on http://localhost:3030/swagger/ once the project has started.

This is made with RapiDoc.

Restore a dump

You can restore any staging / production dump you have access to by putting them in the dumps directory.

This directory is shared with the postgres dockers. (lck-db and lck-db-test)

For restoring a dump :

docker exec -it lck-db bash
pg_restore --no-owner --clean --create -d public -U postgres -W /dumps/your_dump # you'll have to enter the password yourPostgresPassword

Scaffolding

Feathers has a powerful command line interface. Here are a few things it can do:

$ npm install -g @feathersjs/cli          # Install Feathers CLI

$ feathers generate service               # Generate a new Service
$ feathers generate hook                  # Generate a new Hook
$ feathers help                           # Show all commands

Front end

Configuration

public/config.js

This file contains a LCK_SETTINGS variable allowing the app to know some settings like the API URL, the localStorage key, ...

const LCK_SETTINGS = {
  API_URL: 'http://localhost:3030',
  LOCALSTORAGE_KEY: 'lck-auth',
  SENTRY_DSN: '', // here you can set your SENTRY_DSN, please check sentry documentation
  SENTRY_ENV: 'local',
  STORAGE_PATH: 'http://localhost:8000/storage'
}

This file is used at runtime, so you could customise it when you deploy the app.

You have an example in the public/config.js.dist ready to be used with the lck-api project. Copy paste this file in a new public/config.js and it should do the trick.

.env

Same for this file, you'll find an example at the root in .env.dist file.

This file contains more global variables used at compilation time.

As you can't change these vars after compilation time, we have made a special index.html file to be a template when the build is done. You'll find after build in the dist/index-template.html file. This file contains the .env variables in an template-handlebar syntax.

This allows you to compile only the html file if you need to customize these vars before deploy. We've made a node script for that, in scripts/compileTemplate.js that you can trigger with npm run build:html. If you use it in a CI environment, you could give to your CI some env vars that will be injected in your html file.

Compiles and hot-reloads for development

npm run serve

Compiles and minifies for production

npm run build

You'll get an index-template.html file in the dist directory. You can use the npm run build:html if you want to customize the title or other vars.

Run your unit tests

  • only stories of the storybook
npm run test:unit-stories
  • run stories and update imageshots
npm run test:update-imageshot
  • except stories
npm run test:unit-src
  • all unit tests
npm run test:unit

Lints and fixes files

npm run lint

Storybook

npm run storybook:serve

Every story in the project is snapshoted + imageshoted.

We use the addon storyshot of storybook, for both snap and images.

Sometimes, an imageshot need to wait for an element, wait for its DOM injection.

Sometimes too, there are animations that slow the process of taking the screenshot.

For every story you write, you can add an arg waitForSelector that would be a CSS selector, and we use it to tell puppeteer (used under the hood by storyshot for imageshot) to wait the DOM element with the CSS selector you define is really in the DOM.

We encounter lots of issues on Mac OS, so if you use this OS, don't worry if your CI is broken. Ask a developer with a Linux OS to update your shots.

The storybook of the master branch is available on http://lck-storybook.surge.sh/.

You can write your own configuration settings here, when you deploy this front, you will have to override these settings to match your environement configuration.

Git Commit Messages

Inspired and copied from https://github.com/Schneegans/dynamic-badges-action#git-commit-messages

Commits should start with a Capital letter and should be written in present tense (e.g. ๐ŸŽ‰ Add cool new feature instead of ๐ŸŽ‰ Added cool new feature). You should also start your commit message with one applicable emoji. This does not only look great but also makes you rethink what to add to a commit. Make many but small commits!

Emoji Description
๐ŸŽ‰ :tada: When you added a cool new feature.
โœจ :sparkles: When you added a little but necessary feature.
๐Ÿ”ง :wrench: When you refactored / improved a small piece of code.
๐Ÿ”จ :hammer: When you refactored / improved large parts of the code.
๐ŸŽจ :art: When you improved / added assets like themes.
๐Ÿš€ :rocket: When you improved performance.
๐Ÿ“ :memo: When you wrote documentation.
๐Ÿชฒ :beetle: When you fixed a bug.
๐Ÿ”ฅ :fire: When you removed something.
๐Ÿšš :truck: When you moved / renamed something.

Contribute

If you encounter a bug, please submit an issue.

If you want to contribute to the code, first ask to the team where to begin (with an issue).

  1. create an issue, or be assigned on an issue
  2. put the issue in the "Doing" column of the board
  3. create a local branch prefixed by the issue's id (23-add-of-a-new-feature or 23-fix-this-horrible-bug)
  4. add some tests / stories for the code you're writing
  5. when your work is ok for you, push it to the repo
  6. create a MR
  7. check the CI is ok. CD is configured too, you could check your storybook & on surge.sh to see if it's working (this will help us for the review process)
  8. if all is green, put your issue in "To be reviewed" column of the board
  9. affect your MR to someone in the team to be reviewed
  10. maybe you'll have to take in consideration some aspects of your code, so discuss and take in consideration the remarks (restart to 4.)
  11. if review is ok, the reviewer will approve it
  12. now, you can merge it !!!... Congratulations !

locokit's People

Contributors

alketta avatar bastyen avatar becaye avatar bruhnild avatar jcougnaud avatar jrmi avatar mdartic avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

locokit's Issues

[Filter] Impossible to select more than 20 options to filter a multiselect field

To Reproduce

Go in Database and try filter a column of type "multiselect" with at least 20 options with the action "contains all element" or "contain at least ...".

Origin of the bug

In Api the request look like this

select count("table_row"."id") as "total"
from "table_row"
where "table_id" = ? and (
(CAST("table_row"."3fa40035-eff5-4fe9-bd53-e6b5bc830132"#>>'{0}' AS text) = ? and 
...
CAST("table_row"."3fa40035-eff5-4fe9-bd53-e6b5bc830132"#>>'{21}' AS text) = ?)
)

The data property is missing.
We should have

select count("table_row"."id") as "total"
from "table_row"
where "table_id" = ? and (
(CAST("table_row"."data"."3fa40035-eff5-4fe9-bd53-e6b5bc830132"#>>'{0}' AS text) = ? and 
...
CAST("table_row"."data"."3fa40035-eff5-4fe9-bd53-e6b5bc830132"#>>'{21}' AS text) = ?)
)

In api/patch/feathers-objection/lib/index.js:307, I have modified by
refColumn = (0, _objection.ref)(`${this.Model.tableName}.${'data' || column}:${prop}`) ans the resquet succeed.

It seems methodKey is null.

[Record] Add the ability to delete cascade a record

For now, records are removable only on the frontend side, and the API check all relations of the record.

Depending it's a child / parent relation, the removal will be accepted.

Maybe we can do better by updating table_row_relation table, with a DELETE CASCADE foreign key on the child OR the parent relation (need to be tested).

[Admin/CMS] The page layout is not applied

When we configure a specific page layout in the administration/cms part, it is not applied in this part although it is correctly saved in the database and applied in the visualization part.

[Quality] Enhance stories for components

The main idea is to add stories for components that don't have today any stories, or not enough.

Please check all components of the components directory, and add stories for components that don't have any.

If you find some components with not enough "good" stories, please add some.

[View] When view is locked, forbid the filter saving

As the view can be used in a TableSet block or other blocks in the visualization part,
we could use the "lock" feature of a view to forbid the filters saving on a view,
when it's locked.

Accidentally a user saved a filter in a view, as he was an admin,
and the "reader" didn't see anymore all the records of the correlated table. Only those who respected the saved filter.

newsletter button not working

Hi,
author of feathers-casl here ๐Ÿ‘‹.
I saw that you're using feathers-casl which is pretty awesome! I'm curious what locokit will be like. The website looks promising. If I understand it right, it's a headless cms based on vue and feathers.js. I also thought about this approach. If you need help with feathers-casl please let me know!

I wanted to subscribe to your newsletter. Unfortunately the button Yes, subscribe me to the newsletter. in the mail is not clickable (mac monterey 12, chrome and safari). Sorry if it's the wrong place here.

[AuthManagement] When a user want to send a reset password, don't send a HTTP 400

On the front side, a user can ask the API to send him a reset password link.

For this use case, he gives us its email.

When the user is not found, the API returns an HTTP 400 error.

So, a user could know an email is registered or not in our database.

I think we need to return a 200 instead ? And say to the user "If your account exist, an email has been sent to it" ?

[Perf] Add index for all foreign keys

Actually, all foreign keys had been created with knew foreign function.

But I forgot to create indexes for all these foreign keys, which slow a lot SQL requests,
for example when deleting records.

[DataDetail] Problem to update number / float values

Changing the value of a number field from the DataDetail component no longer causes the value to be saved in the database.

It seems that the InputNumber primevue component no longer emits the blur event. However, this event was previously captured to trigger the database update.

An issue has been opened on the primevue repository to find out if this change is permanent or not.

While waiting for the answer, a new component can be created, based on the primevue one, and triggering the blur event as before.

But a better solution should be considered if they no longer wish to trigger this event.

[CI] Create an artifact for the front build

When building the project, we have a docker for the API, containing the frontend build.

It should be nice for advanced deployments to have the frontend build in a dedicated artifact, available for a release.

Maybe it could be interesting to have also available for any MR.

We had this feature in the previous Gitlab CI.

[DataDetail] The map fields must be updated to enable the submit button

When we have a creation form with a facultative geographic field, the submit button doesn't be enabled when we update one other fields, contrary to what normally happens.

So we need to validate the geographic fields at initialization to check if the value is valid or not, as it is already implicitly done for components that use the v-model directive.

[User Administration] Add the possibility to send an email to warn user that his email has been modified by an administrator

Scenario: A user 1 of the application is no longer available for x reason. User 2 wants to continues tasks of user 1. In order to keep the same rights and data, the administrator changes data of the old account (name + email).

Currently, it is impossible from the application for the administrator to inform user that the change has been made and that they need to change the password.

[Field] Add the label of the field type when editing it

When the user edit field properties in DataTable view,
the field type is not displayed.

The only way to know exactly the type is to remember the icon meaning, displayed on the column header.

We could display the icon AND the type label on the right panel too.
This could help the user.

[Perf] When making parallel requests to the API, we got HTTP 500 errors

From a n8n worfklow, and by starting the api with pm2 and pm2-runtime lib/index.js -n lck-api -i max docker command,

After trying to inject a hundred lines, so a hundrer API requests, we got 500.

If we start the API with node lib/index.js, seems ok and no errors are provided.

Seems when we parallelize work, there is a mess inside the API.

[UX] How display a large database schema ?

In the FรฉdรฉSCoT instance, @bruhnild create a schema with tables and a lot of fields :

image

I find this schema hard to read, and the user need to zoom a lot before knowing on which table he's clicking.

Maybe we could search a way to display schema only with table names instead of table + field names ?
This could be a display option ?

What do you think @bruhnild @DarkVisenya @jcougnaud ?

[LUC / VLUC] Is it useful to create a LookUpColumn on a Geometry field ?

Actually, the user can create a LookUp Column on any field of a related table.

This include geometry fields, like Point / Polygon / Line. (or Multi)

For these specific fields, as the LookUpColumn duplicate data,
we could generate a lot of data to be stored.

But is this needed ?

Maybe we could just tell user that they need to use VLUC if it's only for display purposes,
as the storage would not be useful.

I think LUC could still be useful for computing (and in the future, formula on geometry fields),
but used carefully...

What do you think @jcougnaud @DarkVisenya ?

[Theme] Enhance css vars for app sidebar

Thanks to the work made around UI, the sidebar looks more great than before.

But we have lost the ability to style it independently between the App and the Admin section.

Maybe we'll need to add new vars for sidebar, dedicated to the App section.

These vars could be :

  --sidebar-app-width: 18rem;
  --sidebar-app-background-color: var(--primary-color-lighten);
  --sidebar-app-text-color: var(--primary-color-dark);
  --sidebar-app-text-color-active: var(--primary-color-dark);

[Archi] Generate automatically SQL views for each table of a workspace in a dedicated database

  • generate SQL request for each table
    • beware to single / multi select, users, groups to retrieve the label
    • add reference / values for RBT, and all fields related to a table with an id
    • cast each field to its database type : number, string, geometry, ... ?
  • add a setting to the workspace to allow the creation of a dedicated database in readonly for these views
  • add a slug to workspace, table, fields, init by default to the snake case of the label
    • add a constraint to check that the slug is in [a-z_] format with SIMILAR TO
  • add hooks (need to decide where to put them) for :
    • after each update of a table / field / workspace, recompute automatically views
  • add a setting to create a materialized view ?? (optional)
  • document the feature

[View] Clarify the removal of a column from a view

It seems that it's not very clear to understand how to remove a column from a view.

First, there is a confusion between completely removing a column from a view and hiding it for the Visualization part only.
So we have to specify that if we click on the "hide column" button, the column will still be in the view but hidden in the Visualization part.

Moreover, in a view, we can configure a column as displayed, editable and/or transmitted.
But in fact, the column must be transmitted if we want to display or edit it so we need to explain / simplify the process here, maybe just in front side for now.

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.