See Live Demo of this Template
.env
file at the root of the project.env.sample
file to your newly created .env
file..env
file.package.json
file and change the name
property to the name of your application, and author
to your name.npm install
OR npm i
for short.npm run prepare
. This command sets up husky to track eslint errors on commit that will make your deploy fail on Netlify.npm run dev
. THIS IS THE COMMAND YOU WILL USE TO RUN YOUR DEVELOPMENT SERVER FROM NOW ON.You can start editing the page by modifying pages/index.js
. The page auto-updates as you edit the file.
NOTES:
For every file you will need to make an XHR request in, you will need to require Axios
import axios from 'axios';
const examplePromise = () => { axios.get('http://localhost:3001/example') .then((data) => { console.warn(data); }) .catch((error) => { console.error(error); }); });
### Deploying on Netlify
Netlify will automatically detect your project and prepopulate the settings, but should something go wrong and it does not, here are the commands:
- Build Command: `npm run build`
- Publish directory: `.next`
#### Additional Steps to Take on Netlify
- Add Environmental Variables
- Any Enviromental variables you are using in your `.env` file should be added to Netlify.
- Go to Site settings > Build & deploy > Environment > Environment variables and the keys and values there.
- Update Firebase URL Settings
- In Firebase under Authentication select sign in methods, scroll to Authorized domains. Add your Netlify URL.
## Learn More about Next.js
To learn more about Next.js, take a look at the following resources:
- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.