Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
August 28, 2020 03:10 pm GMT

Deploying a Next.js project on SashiDo

Youre planning to build your first or your yet another content dense web site then the Next.js framework is probably one of the top choices to go with. I know that because just like you, our team likes building big projects, we like to build them fast and we think Next.js is super cool! So in the next lines, I will show you how to start using Next.js and deploy your new project on SashiDo effortlessly.

A flying start for your Next.js project on SashiDo!

Surely there are lots of ways to deploy your project, some of them are even free. But lets be honest here - youre not looking just for free hosting as with projects that are expected to have massive content piles stacking up there are quite a few things youll need along the way.

Its awesome that Next.js gives you a nice package of ready-to-use stuff, so how about making the list even longer by adding Database + Automatic Backups, REST & GraphQL APIs, scalable file storage for user-generated content with built-in CDN, CRUD, Auto-Scaling, SDKs, User Management + Automated Emails, Background Jobs, Web Hooks and more?

Alt text of image

via GIPHY

Want to get it all? Let me show you how you can kick off your app by simply cloning the boilerplate that our React-loving team has created.

How does this work?

The project our team created is developed as a Next.js boilerplate for SashiDo applications.
SashiDos platform allows the implementation of server-side logic and has a built-in Express, which is directly mounted to the server. We use Express for handling the Next.js and you may find the respective logic at cloud/app.js.

Installation

In case youre new to SashiDo, as a first step have a quick look at our short Getting Started Guide. There youll find all the base steps that will ensure your new app will be on the fastest way to production. But if youre already a happy customer, just make sure you keep your local environment as close as possible to the production one before you begin with the installation of the project.

Im going to keep this short and sweet, so lets get started:

1. Clone the repo

git clone https://github.com/SashiDo/sashido-nextjs-boilerplate.gitcd sashido-nextjs-boilerplate

2. Install Dependencies

npm install

3. ENV Variables

DATABASE_URI - Default: 'mongodb://localhost:27017/dev'
APP_ID Default: 'myAppId'
MASTER_KEY : Default: ''
SERVER_URL : Default: http://localhost:1337/1'
PORT : Default: 1337

4. Development

npm run dev

If everything is okay you should see an output similar to this one:

Running on http://localhost:1337info: Parse LiveQuery Server starts runningDefining routes from exportPathMap[ ready ] compiled successfully

5. Go wild and unleash your Next.js creativity into the ./src folder.

6. Open http://localhost:1337 in your browser and see the changes :)

Deployment into production

Add your new SashiDo app as a remote branch and push changes.

git remote add production [email protected]:parsegroundapps/<your-pg-app-your-app-repo>.gitgit push -f production master

Bonus goodies

Deploying a successful Next.js project is not only the kicking off part, so we made sure youre well equipped for the next steps too. On SashiDo it is not only easy to host and publish static websites, but you can also manage custom domains directly from the dashboard, have a private GitHub Repo, collaborate with as many people as you like, and set up a free SSL certificate with just one click. And lets not forget about scalable file storage for user-generated content with built-in CDN which is offered as a ready-to-use feature. All this for less than a cup of coffee per month. No wonder why Next.js and SashiDo make such a good match!

Technologies

SashiDo.io - a fully-managed serverless API development platform built with Node.js, MongoDB, Kubernetes, and Doker. SashiDo is currently powering 19k+ Parse apps, 110M+ end customers, and 225 million devices accessing the apps all over the world.

Next.js - a great JavaScript framework that lets you easily build a complete web application with React and server-side rendering. People usually fall in love with the technology because you can have an app running as quickly as your computer can install the required packages...seriously.

Fin

That was beyond easy, right? You can thank me in comments or by sharing your awesome ideas in a pull request.

Happy coding!


Original Link: https://dev.to/sashido/deploying-a-next-js-project-on-sashido-1k84

Share this article:    Share on Facebook
View Full Article

Dev To

An online community for sharing and discovering great ideas, having debates, and making friends

More About this Source Visit Dev To