Code Monkey home page Code Monkey logo

boilerplate-knex's Introduction

Solution description -

Language- I used JS as it is my strongest programming language (as of right now).

Linting- My linting preferences were set to EDA, which was my tertiary educational provider.

Testing- I was going to use jest to test my functions but I did not have enough time. Cheerio and supertest are also for testing.

Template- I initially used prior project I had done for the skeletal structure of this project.

I installed babel for trans-compatibility with older versions of js.

Server side - For the back end I used knex for the databases. Sqlite3 was used for database management. It follows PostgreSQL syntax. For the routes I used express. To implement the uuid I used a package called ."uuid" that I added to database function insertCow, line 17.

Client side- Used React as my client side user interface. Used Superagent for my api calls to the sever side.

  • Guide to run service locally -

1- Running client a- cd in to client folder b- npm i c- npm run dev

2- Running server (remember to do this in separate terminal windows) a- cd in to server folder b- npm i c- npm run knex migrate:latest d- npm run knex seed:run e- npm run dev

3- Navigate to localhost in browser a- http://localhost:3000

Here you can access all of the functionalities. No css.

(if you want to reset the database delete dev.sqlite3 and re-run the npm knex commands above)

  • Guide to run service with docker - (Not fully functional)

a- run docker-compose build in terminal within root of project b- run docker-compose up in terminal within root of project c- navigate to http://localhost:3000 and open inspect tool to see errors

Explanation of problem- I tried fixing this problem many ways yet I could not get past the problem within the node modules. I implemented .dockerignore and it seemed to fix one of the problems but once I inputed the commands npm run knex migrate:latest & npm run knex seed:run in the Dockerfile (server) the prior problem arose again. Example of problem below:

server_1 | Cannot find module '/app/node_modules/sqlite3/lib/binding/napi-v3-linux-x64/node_sqlite3.node'

I looked within the node modules and found that sqlite3 was changing the required path linux-x64 with darwin-x64.

https://stackoverflow.com/questions/51769034/how-to-use-sqlite3-with-docker-compose

The link above was the closet solution I found to the problem.

boilerplate-knex's People

Contributors

nicolashayvice3 avatar richchurcher avatar dependabot-preview[bot] avatar bryceknz avatar don-smith avatar joshuavial avatar emilyparkes avatar tony-luisi avatar lache-melvin avatar pouramua 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.