This talk was part of my presentation for Junior Guru organisation. Junior Guru is a platform for junior developers and switchers, who wants to join IT. Creator of this club is Honza Javorek. Everybody, not only juniors are welcome here.
Next.js is open source web framework based on React.js library. Main features of this framework are:
- Different types of rendering - client side, server side, pre-rendering
- Image optimalisation
- Font optimalisation
- Better SEO
- Easy routing
- Navigating with Link component between pages
In this example of the app, we have created:
- Page with Server Side Rendering
- Page with Static Generation
- Page with Incremental Static Generation
- Routing
- Dynamic routing
- Next Link
- Next Router
- Next Head
- Next Layout
- Styling in CSS modules
- Styling with Tailwind
- Api Routes
This app is about tweeting and about chickens. Backend is supported with Prisma ORM connected to local PostgreSQL database.
- Create local PostgreSQL database
- Setup env variable to connect to the database in secret .env file with name DATABASE_URL
- Run
npm install
# or
yarn install
- Run
npx prisma db push
- Run
npx prisma studio
for data manipulation 6. Run
npx prisma generate
npm run dev
# or
yarn dev
Open http://localhost:3000 with your browser to see the result.
To learn more about Next.js, take a look at the following resources:
- Next.js Documentation - learn about Next.js features and API.
- Learn Next.js - an interactive Next.js tutorial.
You can check out the Next.js GitHub repository - your feedback and contributions are welcome!