Coder Social home page Coder Social logo

api_texo_it's Introduction

Backend

This repository hosts an API built with NestJS and an SQLite database. It features automatic data importation, seamlessly integrating information into the database upon application initialization. Designed for efficiency and ease of use, the API ensures a streamlined data management experience.

Quick Start

To run the project and test it quickly, rename the .env.sample file to .env and then execute the command

yarn start:dev

Description

Database Synchronization

This feature is used to automatically synchronize your entities (data models) with the database. To activate, simply change the DATABASE_SYNCHRONIZE environment variable to true.

File Importation to the Database

  • The importation is automatically performed whenever the application starts.
  • The file sought for import is named movielist.csv and must be located in the main project folder next to the .env files.
  • If you wish to clear all imports, use the start:clean command.

Development

To start the project in development mode, execute the following commands:

yarn start:dev

To execute in development mode with a clean base from previous imports, use the command below:

yarn start:cleanDev

Migrations

Migrations can be used if the DATABASE_SYNCHRONIZE environment variable is set to false.

yarn migration:run

to create a new migration use the command changing {name_table} to the name of the table

yarn migration:generate -- src/common/database/migrations/{name_table}

Environment

Variable Description Required
DATABASE_SYNCHRONIZE Activates synchronization with entities no
DATABASE_PATH Location of the SQLite database yes

Test

File Import

Tests have been created for the file import functionality. They will test the import feature based on a file located at src/common/test/movielist.csv.

How to Execute Tests

Execute the following command in your terminal:

yarn test

Data

the data is generated on default path src\common\database\sql, change te DATABASE_PATH if you want to change the database path.

api_texo_it's People

Contributors

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