Can we create CRUD web apps using next.js, mongodb and netlify? - javascript

I want to create a CRUD web app using next.js with a mongodb database which is then hosted on netlify.
Can we do that???
Or, if that's not possible, do the three things I mentioned (next.js, mongodb, netlify) have an alternative that will make it possible?
Or, if that doesn't work either, is there a solution for me to be able to create CRUD web apps using javascript which are then hosted on netlify?
I have tried looking through all the templates on netlify and found no template for building CRUD web apps using next.js and mongodb.
Maybe I missed.

Yes - You can. Please see this exhaustive tutorial from Mongodb.
https://www.mongodb.com/developer/languages/javascript/developing-web-application-netlify-serverless-functions-mongodb/
It requires the use of netlify serverless functions.
Whilst this example does not include next.js, it provides html and javascript examples that can easily be adapted to any front end framework.

Related

Using Strapi with Nodejs

I am planning out my first project using a Headless CMS. I have settled on using Strapi for my project. Is it logical to use Strapi while not using SPA framework/library? I want to use express and EJS to build my website and Strapi as the backend. Is this okay to do? I assume you would use this with your node server that will make REST requests to the Strapi API. Am I glossing over anything?
It's definitely logical. Just make sure to create your own API-endpoints within Strapi and secure the data as much as possible. So try to do most logic within Node.js and not within front-end.
As far as I am concerned this is pointless to make a headless CMS like strapi, without using a library/framework. There is so many reason why this is no sense. Above of all, in react you can use reusable components, writing in jsx etc. This is something that vanilla javascript no have.
Learn how to make first blog in react and connect it to strapi would you take about 10h if you know basic of javascript, css and html. This my opinion.

Spring-Boot with React JavaScript

As the title says I'm dealing with Spring Boot and react JavaScript at the moment. I would really appreciate it if someone would be able to answer me on a few small questions.
I created a separate react project using vscode IDE. Now I need to add it to my Spring Boot application. I have used Eclipse to code my Spring Boot application.Can I just transfer the react JavaScript files to the Eclipse IDE? Will it work like that?
Also, to configure these two together I read that I should use thymeleaf. What are you thoughts on this and do you think its better to use this.
You may not require to transfer any code from one IDE to another. I assume both this front-end(react) and middle layer(spring boot) are two separate project.
You can still run the boot project in eclipse pointing to same localhost(for development) with a different port and front-end in a different port.
I found this example is quite useful
The modern way to think about your React and Spring apps as of two completely separate applications. The React app is the "front end" application that is displayed to the user and holds the logic for all the user interactions. Spring boot is the "back end" service that holds the state of your application and helps you to save and fetch data.
To get started try building and running your React app from something like Create React App. It is easy to set up a local development server. You should also understand that the React app that you get after building is just some static files - so you can host them very easily and cheaply without need for an actual server. I personally use S3.
Now to your Spring application. This is your 'API' layer and you should read about using APIs for example here: Official Spring Docs .
You still theoretically CAN bundle both together and serve the React bundle out of the Spring static files directory but you will likely find this will get awkward fast. Here is an example of someone doing exactly this
As for Thymeleaf - in the React world you will likely end up using JSX for your templating needs. It is a wonderful way of closely integrating your js and html code and creating highly reusable components.
You can build an automated container deployment. This allows you to test, build and deploy your backend and frontend with every git push to your server.
For example google some keywords: Kubernetes, Docker, Gitlab CI.
There are much more solutions and platforms to build a system for automating deployment.

How to setting up a project in eclipse to program a SPA with JavaEE and AngularJS?

I'm trying to create a project all day long (in vain) to be able to write an SPA (Single Page Application) for learning purposes with JavaEE and AngularJS but I have no idea how to proceed...
I need in following topics your help:
How or which project I have to create/choose in Eclipse to be able to write in JavaEE(Backend) and AngularJS(Frontend Clientside)
What do I need to do this so?
I could not find any continue bringing sources in the net like step by step guides in setting up the project and if needed any dependencies which I will need for the project.
I would really appreciate if someone could help me at least in setting up the project so I can start coding with JavaEE and AngularJS
Thanks!
First of all you have to define your learnig criteria.There are number of ways to start learn on this.
On github you can get some boilerplates available.Using this boilerplates you can start easily.
ex. https://github.com/radcortez/javaee7-angular
you can also refer [https://medium.com/#swhp/build-single-page-application-with-java-ee-and-angularjs-4eaacbdfcd][1]
On client side you can create the application using AngularJS,Bootstrap and integrate this application with backend using API.
On server side you can create API either with latest spring boot
https://www.blazemeter.com/blog/creating-a-simple-spring-boot-api-from-scratch
or
you can create simple java application using JAX-RS and Jersey.

How to embed a database into my vuejs app?

I know this is a "generic" question, but please read it before judging:
I try to create a vuejs fullstack application that i can build and run with a single command. I use the vue-cli to create and build a project. Included is express and node (works fine). But I cannot figure out how to add database functionality to it. I thought mongodb and mongoose would fit, until I learned that I need a separate mongodb server running instead of getting it embedded within my build.
Is this even possible? I mean, android apps ship with SQLite that every app can use. Where do I need to research to get this job done? Google tells me to use mongoose, but it is not embedded as it seems.
As requested, as an answer:
Databases are usually part of the back-end (in this case nodejs). There's plenty of choices for embedable databases, the most popular one is SQLite.
It can be used either purely "in memory" or with persistence in the form of "database files". More information how to use it in node can be found in the node-sqlite3 documentation

Deploying a Symfony2 back-end REST API and a front-end SPA javascript app

Doing a one page application on one side and a REST API to get the ressources on the other side is something a lot companies do. I've been doing a pet project consisting on a REST API built with the Symfony2 framework and a SPA with Web Components and Polymer. The SPA is doing AJAX requests to get the ressources.
Now I'm wondering how to deploy it on the web. I don't have a lot of experience with deployment and I'd like to know if there are best practices to deploy a web app and where to do it.
I've looked at Heroku and the git push is very convenient but I don't know if (of how) I can push my 2 apps on the same dyno and handle the routing between the two.
Any idea on how to deploy such architecture?
You should look at using a deployment manager such as Capistrano. Symfony has it's own version which can be useful. Both a written in Ruby, whilst I like using Magallanes as it has most of the same functionality but is written in PHP so less dependencies and easier to modify.

Categories

Resources