Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    James Lee
    @uptownhr
    its very useful for destructuring
    now you can do, { User, Project } = require('./models')
    Niall O'Brien
    @niallobrien
    For sure, but makes file hopping a bitch
    James Lee
    @uptownhr
    instead of having multiple lines
    Niall O'Brien
    @niallobrien
    Having 5 index.js files open is not fun
    Man, that Post controller looks damn clean
    No validation in there?
    James Lee
    @uptownhr
    it's just a view
    so no input
    Niall O'Brien
    @niallobrien
    Ah, looking elsewhere :)
    You have a Gitter?
    Instead of polluting this one
    James Lee
    @uptownhr
    yup
    hehe
    uptowhr/hackable
    Niall O'Brien
    @niallobrien
    Any advice for structuring large apps with Hackathon Starter? Thanks.
    Anker
    @ankerbachryhl
    Hi, @sahat Awesome project :smile: :+1: What would you recommend, if I wanna add a chat? :smile:
    tackpapa
    @tackpapa
    is there any way i can replace jade with angular?
    Sahat Yalkabov
    @sahat
    @ankerbachryhl Thanks. There are probably existing chat solutions, but you can also implement it yourself using socket.io.
    Dipesh Bhardwaj
    @Dev-Dipesh
    @tackpapa Jade, which is now Pug is a templating engine. You can use Angular within Jade
    rakesh kumar jha
    @rakeshk706_twitter
    hi
    can anyone please help me with the linkedin login
    Tobias Lundgren
    @lundgren2
    Would you recommend to install React on this starter kit?
    agaez code
    @agaezcode
    It is possible to read images in a folder (upload folder) with fs and make them available in front-end?
    agaez code
    @agaezcode
    I mean, what process/flow are you guys using to work with files uploaded to the server? Are you saving a reference of the images to the database or are you using file system to present them to the client side? I'm stuck
    Sahat Yalkabov
    @sahat

    @agaezcode Yes, Express makes it easy for you to do that. If you really want to share the entire uploads folder with everyone, then you can make it an express.static directory in app.js, just like public directory. By default, if I remember all files are uploaded as random hashes without file extensions, so it's up to you to add file extension when you save a file to /uploads. And yes typically you would save a reference (unique filename) to your database and then upload this file to S3.

    You can then get that file from S3 via URL:
    https://s3.amazonaws.com/YOUR_BUCKET_NAME/YOUR_FILENAME

    The reason why you don't keep all your uploads inside /uploads folder permanently is because those files will all be wiped on your next code push.
    If images are really small and you have plenty of database space, you can store images as Base64 strings in MongoDB/SQL database as well.
    @lundgren2 It's up to you. I think you would be better off with a dedicated React boilerplate by Max Stoiber. https://github.com/mxstbr/react-boilerplate
    @ankerbachryhl Thank you. Go with Socket.io! There are a lot of tutorials that show you how to build a chatroom from scratch using web sockets and socket.io
    Sahat Yalkabov
    @sahat
    @niallobrien For structuring large apps, a lot of these front-end principles still apply to structuring Node.js apps on the back-end: https://vimeo.com/168648012
    @uptownhr @niallobrien I recently worked on a project where all components were organized "by feature" and each component's JS file was named index.js. Sure it makes "require/import" really clean, but oh wow what a pain it was to switch between these files inside IDE when all files are named index.js.
    agaez code
    @agaezcode
    @sahat I recently post this question on stackoverflow on how to save reference of multiple images to database. Can you explain/understand what I am doing wrong on that code? Thank you
    Sahat Yalkabov
    @sahat
    @agaezcode I am not familiar with that jQuery file upload plugin or multi file uploads, but it looks like it's POSTing for each image separately?
    agaez code
    @agaezcode
    @sahat yes! I'm having problems because of that... I'm trying some way to make it post all the images at once, but not getting there yet
    Sahat Yalkabov
    @sahat
    @agaezcode I think you may have to look for a different file upload library, or use some kind of counter in your upload controller, then have an if statement that checks if the counter is complete and execute the required logic to handle all those images. But before that you should try to go with this upload behavior and handle each file individually. If you really need to be notified when all images have been uploaded then you may need to use a counter.
    agaez code
    @agaezcode
    @sahat , thanks for these new perspectives. I'll try them
    Tobias Lundgren
    @lundgren2
    Thanks @sahat ! I’ve tried out your megatboilerplate.com with express and react. Would you recommend to use Max Stobier’s react boilerplate instead of this setup? It would be an simple CRM system as my master thesis… Thanks!
    arashdoescode
    @arashdoescode
    This new open source is truly revolutionary
    Which is megaboilerplate
    I dont know how to repay him
    Dipesh Bhardwaj
    @Dev-Dipesh

    @sahat @uptownhr
    Hola Guys!
    I'm looking for a solution to a problem I'm currently facing, any kind of help will be greatly appreciated.
    I've an array of 35 Yahoo WOEIDs in woeids.trends_country_capital, with which I want to fetch twitter trends for respective WOEIDS. Now twitter has a limit of 1 req/min for it's trends API, so I would like to fetch 35 WOEID's trends with 1 at a time and once all done will repeat the process indefinitely.

    node module - cron

    const worldWide = new CronJob({
      cronTime: '0 */35 * * * *',
      onTick: function() {
        _(woeids.trends_country_capital).forEach(woeid => {
            new CronJob('0 */1 * * * *', function() {
                trendsCountry.get('/trends/place', {id: woeid}, function(error, trends, response) {
                    if (!error) {
                        dbCountries.countries.update(
                            { woeid: woeid },
                            {
                                woeid: woeid,
                                trends: trends[0].trends,
                                lastUpdated: new Date().getTime()
                            },
                            { upsert: true },
                            function (err, data) {
                                console.log(err, data);
                            }
                        )
                    }
                });
            }, null, true, 'America/Los_Angeles');
        });
      },
      start: false,
      timeZone: 'America/Los_Angeles'
    });
    Sahat Yalkabov
    @sahat
    @lundgren2 Max's react-boilerplate has a lot of nice features but it can be overwhelming for beginners. In my latest React project, I took a few good ideas like "CSS modules" from there and used Mega Boilerplate's project structure. Keep it as simple as possible, there is no need to over-engineer.
    Sahat Yalkabov
    @sahat
    Using a combination of async.queue and async.forEach.
    arashdoescode
    @arashdoescode
    @sahat i couldnt find any existing tutorials for socket.io using react , even in the megaboilerplate, its only on the server
    James Lee
    @uptownhr
    @Dev-Dipesh so what is your problem :) ?
    Dipesh Bhardwaj
    @Dev-Dipesh
    Thanks @sahat, I missed that.
    @uptownhr yeah right ;)
    Dipesh Bhardwaj
    @Dev-Dipesh

    Heya guys -
    I have a project at hand, where I'm bit confused in picking up the right database. Project requirements are as follows -

    Data Size -> Small JSON dataset with overall data size in complete database can go as high as 5 Mb. That's right overall size comprised of all datasets.

    Write Frequency -> From 1 write per minute to 16 write per minute at max with a data set size of 10 Kb.

    Read Frequency -> Can scale up to several thousands to millions of request per second.