Coder Social home page Coder Social logo

jimmylee / next-postgres-sequelize Goto Github PK

View Code? Open in Web Editor NEW
180.0 8.0 39.0 280 KB

[OUTDATED] React 16.8.4 + NextJS 8.0.3 + Emotion + Sequelize 5/Postgres + Passport Local Auth + Google App Engine or Heroku Deployment

Home Page: https://next-postgres.herokuapp.com/

License: MIT License

JavaScript 100.00%
nextjs postgres passport sequelize react heroku redux emotion google-app-engine

next-postgres-sequelize's People

Contributors

huyhong avatar jimmylee avatar pruhstal avatar whyrusleeping 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  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  avatar  avatar  avatar  avatar  avatar  avatar

next-postgres-sequelize's Issues

Sequelize 5 Warning

(node:19304) [SEQUELIZE0003]
DeprecationWarning: String based operators are deprecated. 
Please use Symbol based operators for better security, 
read more at 

http://docs.sequelizejs.com/manual/querying.html#operators

Using with decoupled API?

Hi there, wonderful library!

Apologies if this isn't a great place for this question, however I've pored over articles/SO/tutorials for awhile now and thought I'd give it a shot here!

I was wondering if you had any suggestions on implementing what you've created here with a decoupled API. In my repo I've got an 'api' folder which contains my Rails API for handling user authentication, but I know this library uses Express/Passport for user authentication. On my frontend I'm using Next.js and modeled my login after this repo.

Thank you!

Handling modal state

I apologize if this is a question that is outside of the scope of this repo, but I'm just unable to find a solution and I'm hoping you can provide a little guidance!

I'm relatively new to the React world (coming from Rails). I've used your next-postgres repo as a guide and altered what I need to fit my app. I'm working on creating a signup modal using Material-UI, however when I hit the Submit button, I get an error:
Unhandled Rejection (TypeError): Cannot read property 'toLowerCase' of undefined

This error is in http.js (line 166), where none of the information is being passed through to the signup method.

I have state set in the parent component (just to check whether the modal is open), and I have state set in the modal component to capture form values. When I console state in the modal component however, it only returns the parent state instead of modal state, which would be the issue back over in http.js.

Do you have any tips or guidance as to how to handle this?
Feel free to remove this question if this isn't a good place for a question like this.

How to connect hosted postgres database secrets?

Amazing repo, thank you for open sourcing. I am trying to connect the project with ElephantSQL's hosted postgres database, but I am unsure of what fields correspond with the fields you included in next-postgres' readme.

Here's a screenshot of a test instance of ElephantSQL:

Screen Shot 2019-03-19 at 10 53 05 AM

In the example you provided, are all the fields required? So far, I have guessed the following pairings, but hasn't doesn't worked.

now secrets add production-username   [User & default database]
now secrets add production-password   [Password]
now secrets add production-database   [Default database or server?]
now secrets add production-host       [Server or URL?]
now secrets add production-port       [Default to 5432?]
now secrets add production-secret     [API Key?]

Thanks for the help!

Building Production Version with Now?

Have you tried running the production build?

I get the following error: error [email protected]: The engine "node" is incompatible with this module. Expected version "10.6.0".

Works if you take out the engine key in package.json. Is that expected?

Full error:

next-postgres-now$ now --public
> Deploying ~/Downloads/next-postgres-now under idkjs
> Synced 1 file (3.37KB) [985ms]
> WARN! Requested node version 10.6.0 is not available
> Using Node.js 8.11.3 (default)
> https://next-postgres-kkgivgnkry.now.sh [in clipboard] (bru1) [5s]
> Building…
> ▲ yarn
> yarn install v1.9.4
> info No lockfile found.
> [1/5] Validating package.json...
> error next-postgres@1.0.0: The engine "node" is incompatible with this module. Expected version "10.6.0".
> Logs from deployments of your account are rate limited. The reason is "writes from reason-docker-server-master-ydunocaape.now.sh". Please upgrade your plan.
> info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
> Error! Build failed

Great Project. Thanks for sharing.

Clean install has issues with babel-cli

When starting the app with yarn dev I kept receiving the message

Error: Plugin 0 specified in "[...]/node_modules/next/babel.js" provided an invalid property of "default"

After removing babel-cli and instead installing @babel/cli local to the project everything started working as expected.

Change paths for textarea, moved under higher-order

In components directory, CommentForm.js, CommentPreview.js, PostForm.js
and in pages directory, pages/post.js
all had paths expecting Textarea to be under components, but it has been moved to the folder higher-order.

Not working locally

Hi Jimmy,

First off -- awesome repo. Been looking for something like this for a couple of days after finally having settled on Next.js. This is like the holy grail of examples.

Which is why I'm trying to get it to work properly, to no avail.

I followed the instructions, ran the migrations (confirmed that the tables were created), and then get the standard next.js output:

 DONE  Compiled successfully in 1701ms                                                                                                                                                          

Running on localhost:8000

From there, I head over to http://localhost:8000 and get the following:

screen shot 2017-08-04 at 4 52 44 pm

Not even sure where to debug this thing since there's not really any output/logging happening when I hit the URL.

Any idea on where to look?

Cheers

Suggestion on how to fetch data on a per page basis?

Hi @jimmylee,

I've been using this repo for about 3 months (since you first released it), and I've been able to fly pretty fast on a side project. So thank you so much for the nice starter kit.

One thing I noticed is that most of the data for all of the pages (comments, posts, etc.) comes from getInitialStateData from within https://github.com/jimmylee/next-postgres/blob/master/higher-order/withData.js#L9. While I can see why the reasoning behind it, it's not entirely optimal on sites that depend on a lot of data.

I'd like to get your thoughts on patterns to fetch data on a per-page basis that would be SEO friendly.

One solution I have for now is on a (logged in) page, say privacy.js: is within componentWillMount doing the fetch and then setting the state for the component based upon what comes back.

E.g.

  componentWillMount() {
    return this.props.dispatch(Actions.requestGetUserPrivacySettings({
      userId: this.props.viewer.id
    })).then((settings) => {
      this.setState(settings);
    });
  }

This works, but like I mentioned, I'd like to have something a bit more SEO friendly. I thought about maybe doing it in one of the controllers (within the route) kinda like this:

https://github.com/jimmylee/next-postgres/blob/master/index.js#L39

Where I'd just fetch the data and somehow pass it through to the component, but I'm stuck on how to do that.

Any ideas?

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.