Git Product home page Git Product logo

tonymckes / conduit-realworld-example-app Goto Github PK

View Code? Open in Web Editor NEW
59.0 2.0 102.0 2.21 MB

RealWorld example app, created to demonstrate a fully fledged fullstack application built with React / Express.js / Sequelize / PostgreSQL including CRUD operations, authentication, routing, pagination, and more.

Home Page: https://conduit-realworld-example-app.fly.dev/

License: MIT License

JavaScript 98.02% HTML 1.58% CSS 0.40%
nodejs javascript express sequelize react showcase fullstack vitest

conduit-realworld-example-app's Introduction

RealWorld Example App

React / Vite + SWC / Express.js / Sequelize / PostgreSQL codebase containing real world examples (CRUD, auth, advanced patterns, etc) that adheres to the RealWorld spec and API.

This codebase was created to demonstrate a fully fledged fullstack application built with React / Vite + SWC / Express.js / Sequelize / PostgreSQL including CRUD operations, authentication, routing, pagination, and more.

Demo app  |  With Create React App  |  Other RealWorld Example Apps

For more information on how to this works with other frontends/backends, head over to the RealWorld repo.


Getting Started

These instructions will help you install and run the project on your local machine for development and testing.

Prerequisites

Before you run the project, make sure that you have the following tools and software installed on your computer:

  • Text editor/IDE (e.g., VS Code, Sublime Text, Atom)
  • Git
  • Node.js v18.11.0+
  • NPM (usually included with Node.js)
  • SQL database

Installation

To install the project on your computer, follow these steps:

  1. Clone the repository to your local machine.

    git clone https://github.com/TonyMckes/conduit-realworld-example-app.git
  2. Navigate to the project directory.

    cd conduit-realworld-example-app
  3. Install project dependencies by running the command:

    npm install

Configuration

  1. Create a .env file in the root directory of the project

  2. Add the required environment variables as specified in the .env.example file

  3. (Optional) update the Sequelize configuration parameters in the config.js file

  4. If you are not using PostgreSQL, you may also have to install the driver for your database:

    Use one of the following commands to install:

    Note: -w backend option is used to install it in the backend package.json.

    npm install -w backend pg pg-hstore  # Postgres (already installed)
    npm install -w backend mysql2
    npm install -w backend mariadb
    npm install -w backend sqlite3
    npm install -w backend tedious       # Microsoft SQL Server
    npm install -w backend oracledb      # Oracle Database

    ℹ️ Visit Sequelize - Installing for more infomation.


  5. Create database specified by configuration by executing

    ⚠️ Please, make sure you have already created a superuser for your database.

    npm run sqlz -- db:create

    ℹ️ The command npm run sqlz is an alias for npx -w backend sequelize-cli.
    Execute npm run sqlz -- --help to see more of sequelize-cli commands availables.

  6. Optionally you can run the following command to populate your database with some dummy data:

    npm run sqlz -- db:seed:all

Usage

Development Server

To run the project, follow these steps:

  1. Start the development server by executing the command:

    npm run dev
  2. Open a web browser and navigate to:

Running Tests

To run tests, simply run the following command:

npm run test

Production

The following command will build the production version of the app:

npm run start

License

This project is licensed under the MIT License. See the LICENSE file for details.

Acknowledgments

conduit-realworld-example-app's People

Contributors

alonski avatar ericsimons avatar esakkiraj avatar geromegrignon avatar optikfluffel avatar segmentationfaulter avatar tonymckes 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

Watchers

 avatar  avatar

conduit-realworld-example-app's Issues

Dialect undefined does not support db:create / db:drop commands

Summary:
When run command npx sequelize-cli db:create get error: Dialect undefined does not support db:create / db:drop commands

STR:

  1. add .env file to /backend folder
## Environment Variables
JWT_KEY=some_secret

DB_USER=postgres
DB_PASSWORD=xxxxxx
DB_DATABASE=conduit
  1. go to /backend folder and run the command npx sequelize-cli db:create

Expected result:

Sequelize CLI [Node: 16.17.0, CLI: 6.6.0, ORM: 6.29.3]
Loaded configuration file "config/config.js".
Using environment "development".
Database conduit created

Actual result:

Sequelize CLI [Node: 16.17.0, CLI: 6.6.0, ORM: 6.29.3]
Loaded configuration file "config/config.js".
Using environment "development".
ERROR: Dialect undefined does not support db:create / db:drop commands

Configuration:
MacBook Pro (16-inch, 2021) - Apple M1 Pro
node v18.16.1

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.