Coder Social home page Coder Social logo

lumi's Introduction

Sample

Name: Francisco Cajlon Jhonathan Moura Batista
Email: [email protected]
LinkedIn: https://www.linkedin.com/in/nathan2slime/
Portfolio: https://www.nathan3boss.dev/

๐Ÿ’ป Prerequisites

If you have Docker installed, skip this step

You need the following prerequisites installed on your system.

๐Ÿ’พ Packages

This is a modularized project in different packages, each with a specific function

Name Description
@lumi/api API GraphQL for data management, made in Nestjs and TypeGraphQL
@lumi/types Auto-generated GraphQL types
@lumi/tsconfig TypeScript configuration files
@lumi/service API for extracting data from PDFs, made in Nestjs
@lumi/database Contains the table models for the database
@lumi/env Configuration and validation of environment variables
@lumi/firebase Load firebase-admin credentials
@lumi/logs Custom logging

๐Ÿ‘พ Environment variables

If you are using Docker, you will not need to configure a .env . I left a file .env.prod with environment variables needed to run in a Docker environment.

There is a .env.example file where there are examples of how to configure environment variables

## PostgreSQL

POSTGRES_PORT=
POSTGRES_USER=
DATABASE_TYPE=postgres
POSTGRES_PASSWORD=
POSTGRES_HOST=localhost
POSTGRES_DB=

## JWT
TOKEN_SECRET=

## Seed Data
ADMIN_PASSWORD=
ADMIN_EMAIL=

## Enviroment
NODE_ENV=production

## Service Ports
APP_API_PORT=
APP_SERVICE_PORT=

## Services URL
NEXT_PUBLIC_APP_API_URL=
NEXT_PUBLIC_APP_SERVICE_URL=
APP_WEB_URL=


## Firebase Credentials 
NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET=
NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID=
NEXT_PUBLIC_FIREBASE_API_KEY=
NEXT_PUBLIC_FIREBASE_PROJECT_ID=
NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN=
NEXT_PUBLIC_FIREBASE_APP_ID=

๐Ÿง Setup

Start by downloading the repository using this Git command.

git clone https://github.com/nathan2slime/lumi.git

Enter the project directory.

cd lumi

๐Ÿš€ Running

Commands from here are run in the project's root directory

  • Using Docker

    Run the command below, make sure the ports configured in .env.prod are available.

    docker compose up
    
  • No Docker

    Create the .env file with the environment variables configured.

    Run the following commands, make sure you are using a package manager that supports workspaces. For this project I recommend using Yarn in its PKG version.

    yarn install
    
    yarn dotenv -e .env -- yarn build
    

    If you have been successful so far, run the following commands on different terminals. Make sure the PostgreSQL database is running, with the database created and its name referenced in the .env, along with the credentials.

    This runs a seed that creates the administrator user with necessary rules and permissions.

    yarn seed
    

    This runs the API for extracting data from a PDF.

    yarn dev --filter=@lumi/service
    

    This runs the API GraphQL

    yarn dev --filter=@lumi/api
    

    This runs the web application in Next.js.

    yarn dev --filter=@lumi/web
    

โœ”๏ธ Testing

Jest was used to implement tests.

  • UT

    To run the unit tests, run the command below.

    The following command depends on the build command (yarn build), consider running them first if you haven't done so before.

      yarn test
    
  • Cov

    To run coverage tests, run the command below.

    The following command depends on the build command (yarn build), consider running them first if you haven't done so before.

      yarn test:cov
    

๐Ÿ”– Docs

The extraction API documentation is available in the /api/docs route and the GraphQL API Playground GraphQL is available in /graphql. Make sure you put the correct host and port to access them

๐Ÿค™ Usage

To interact with the Lumi application, authentication is required. Follow the steps below to manage users and create invoices:

  1. User authentication:

    • Log in using your admin credentials (You can find them in your .env).
    • If you don't have an admin account, create a regular user account.
  2. Invoice creation:

    • Only admin users have the privilege to create invoices.
  3. Invoice creation page:

    • Navigate to the "New Bill" section by clicking on your avatar, available in the side menu.
    • Select the "New bill" option from the dropdown menu.
  4. New invoice:

    • On the invoice creation page, you can upload an invoice.
    • Validate the extracted data to ensure accuracy.

โ›„ Preview

lumi's People

Contributors

nathan2slime 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.