Git Product home page Git Product logo

123's Introduction

123

This project was generated by Flatlogic generator.

We offer 2 ways how to start the project locally: by running Frontend and Backend or with Docker.

To start the project:

Backend:

Install local dependencies:
  • yarn install

Adjust local db:
1. Install postgres:
  • MacOS:

  • brew install postgres

    if you don’t have ‘brew‘ please install it (https://brew.sh) and repeat step brew install postgres.

  • Ubuntu:

  • sudo apt update

  • sudo apt install postgresql postgresql-contrib

2. Create db and admin user:
  • Before run and test connection, make sure you have created a database as described in the above configuration. You can use the psql command to create a user and database.

  • psql postgres --u postgres

  • Next, type this command for creating a new user with password then give access for creating the database.

  • postgres-# CREATE ROLE admin WITH LOGIN PASSWORD 'admin_pass';

  • postgres-# ALTER ROLE admin CREATEDB;

  • Quit psql then log in again using the new user that previously created.

  • postgres-# \q

  • psql postgres -U admin

  • Type this command to creating a new database.

  • postgres=> CREATE DATABASE development;

  • Then give that new user privileges to the new database then quit the psql.

  • postgres=> GRANT ALL PRIVILEGES ON DATABASE development TO admin;

  • postgres=> \q


Create database:
  • yarn db:create
Start production build:
  • yarn start

Frontend:

Quick Start

1. Run yarn install

This will install both run-time project dependencies and developer tools listed in package.json file.

2. Run yarn start

Runs the app in the development mode.

Open http://localhost:3000 to view it in the browser. Whenever you modify any of the source files inside the /src folder, the module bundler (Webpack) will recompile the app on the fly and refresh all the connected browsers.

3. Run yarn build

Builds the app for production to the build folder. It correctly bundles React in production mode and optimizes the build for the best performance.

The build is minified and the filenames include the hashes. Your app is ready to be deployed!

To start the project with Docker:

Description:

The project contains docker-compose.yml and a couple of helper scripts:

Run services:

  1. Install docker compose (https://docs.docker.com/compose/install/)

  2. Move to docker folder. All next steps should be done from this folder.

    cd docker

  3. Make executables from wait-for-it.sh and start-backend.sh:

    chmod +x start-backend.sh && chmod +x wait-for-it.sh

  4. Download dependend projects for services.

  5. Review the docker-compose.yml file. Make sure that all services have Dockerfiles. Only db service doesn't require a Dockerfile.

  6. Make sure you have needed ports (see them in ports) available on your local machine.

  7. Start services:

    7.1. With an empty database rm -rf data && docker-compose up

    7.2. With a stored (from previus runs) database data docker-compose up

  8. Check http://localhost:3000

  9. Stop services:

    9.1. Just press Ctr+C

Most common errors:

  1. connection refused

    There could be many reasons, but the most common are:

    • The port is not open on the destination machine.

    • The port is open on the destination machine, but its backlog of pending connections is full.

    • A firewall between the client and server is blocking access (also check local firewalls).

    After checking for firewalls and that the port is open, use telnet to connect to the IP/port to test connectivity. This removes any potential issues from your application.

    MacOS:

    If you suspect that your SSH service might be down, you can run this command to find out:

    sudo service ssh status

    If the command line returns a status of down, then you’ve likely found the reason behind your connectivity error.

    Ubuntu:

    Sometimes a connection refused error can also indicate that there is an IP address conflict on your network. You can search for possible IP conflicts by running:

    arp-scan -I eth0 -l | grep <ipaddress>

    arp-scan -I eth0 -l | grep <ipaddress>

    and

    arping <ipaddress>

  2. yarn db:create creates database with the assembled tables (on MacOS with Postgres database)

    The workaround - put the next commands to your Postgres database terminal:

    DROP SCHEMA public CASCADE;

    CREATE SCHEMA public;

    GRANT ALL ON SCHEMA public TO postgres;

    GRANT ALL ON SCHEMA public TO public;

    Afterwards, continue to start your project in the backend directory by running:

    yarn start

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.