GithubHelp home page GithubHelp logo

priyanshu88 / news-app Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 82 KB

LIVE NEWS APP with Next.js 13 (TypeScript, StepZen, Tailwind CSS, Dark Mode, GraphQL)

Home Page: https://news-app-theta-bice.vercel.app/

License: Apache License 2.0

TypeScript 94.15% JavaScript 2.80% CSS 3.05%
dark-mode dynamic-data dynamic-routing graphql mediastackapi nextjs13 reactjs static-data stepzen tailwindcss

news-app's Introduction

logo

LIVE NEWS APP with Next.JS 13

LIVE NEWS APP with Next.JS 13! Implemented to handle dynamic data and static data alternative to Server Side Rendering and Incremental Static Regeneration. The website is fully responsive and uses Tailwind CSS which further incorporates the feature of dark mode to the app. User can search news with the keywords, categories. Implementation of dynamic page routing and pulling the data from MediaStack News API in efficient and optimized manner has been done to prevernt overloading. Stepzen has been used to launch a GraphQL interface which is queried by FETCH API. Further Typescript is used to reduce the overall number of bugs and errors and the deployed on vercel.


📔 Table of Contents

🌟 About the Project

📷 Screenshots

image

📹 Demo

News-App.Demo.mp4

forthebadge forthebadge forthebadge

👾 Tech Stack

Client
API
GraphQL

Google

🧰 Getting Started

‼️ Prerequisites

  • Sign up for a StepZen account HERE
  • Log in for a MediaStack API account HERE
  • Install Node JS in your computer HERE

🔑 Environment Variables

To run this project, you will need to add the following environment variables to your .env file

STEPZEN_API_KEY

MEDIASTACK_API_KEY

⚙️ Installation

Install my-project with npm

npx create-next-app news-app
cd news-app

Install dependencies

🧪 Install Tailwind CSS with Next.js

Install Tailwind CSS

Install tailwindcss and its peer dependencies via npm, and then run the init command to generate both tailwind.config.js and postcss.config.js.

npm install -D tailwindcss postcss autoprefixer
npx tailwindcss init -p

Configure your template paths

Add the paths to all of your template files in your tailwind.config.js file.

module.exports = {
  content: [
    "./pages/**/*.{js,ts,jsx,tsx}",
    "./components/**/*.{js,ts,jsx,tsx}",
  ],
  theme: {
    extend: {},
  },
  plugins: [],
}

Add the Tailwind directives to your CSS

Add the @tailwind directives for each of Tailwind’s layers to your ./styles/globals.css file.

@tailwind base;
@tailwind components;
@tailwind utilities;

OR

setup directly with configured installation

  npx create-next-app -e with-tailwindcss news-app

Install dependencies

🔶 Other Dependency Info

🏃 Run Locally

Clone the project

  git clone https://github.com/Priyanshu88/News-App.git

Install dependencies This is a Next.js project bootstrapped with create-next-app.

  npm install

Getting Started

Start the server First, run the development server:

  npm run dev

This is a Next.js project bootstrapped with create-next-app.

Open http://localhost:3000 with your browser to see the result.

Convert Next.js12 to Next.js13 by modifying next.config.js with

  experimental: {
    appDir: true,
  }

Create an app folder with page.tsx and delete index.js to avoid conficts. Now, create head.tsx and layout.tsx and import the globals.css in layout file.

You can start editing the page by modifying app/page.tsx. The page auto-updates as you edit the file.

API routes can be accessed on http://localhost:3000/api/hello. This endpoint can be edited in pages/api/hello.js.

The pages/api directory is mapped to /api/*. Files in this directory are treated as API routes instead of React pages.

Learn More

To learn more about Next.js, take a look at the following resources:

You can check out the Next.js GitHub repository - your feedback and contributions are welcome!

Instagram

👽 API Implementation and StepZen

MediastackAPI

Signup at Medistack platform, copy the API Access API key.

Instagram

Setting Up StepZen

Create an account

  • Sign up for a StepZen account HERE

Running StepZen

Install the CLI

npm install -g stepzen

After installing the CLI, you can connect it to your account.

Start by logging in using the following command:

stepzen login

You'll see a series of command prompts asking for your StepZen account name and admin key:

What is your account name?: {ACCOUNT}
What is your admin key?: {ADMINKEY}

Your Admin Key and API Key**

When you get your account, log in to StepZen and navigate to the StepZen dashboard, where you will find your account name, and the two keys you need for API authentication:

stepzen init

Initialize a StepZen workspace in the current directory.

stepzen init

GET requests

Auto-generate your schemas and resolvers using the following StepZen CLI command:

News

stepzen import curl "http://api.mediastack.com/v1/news?access_key=YOUR_ACCESS_KEY&countries=us%2Cgb&limit=100&offset=0&sort=published_desc"

Deploy

stepzen start

🚩 Deployment

To deploy this project run

Deploy on Vercel

The easiest way to deploy your Next.js app is to use the Vercel Platform from the creators of Next.js.

Check out our Next.js deployment documentation for more details.

🤝 Contact

Your Name - @twitter_handle - [email protected]

Project Link: https://github.com/Priyanshu88/News-App.git


image

Don't forget to leave a star ⭐️

news-app's People

Contributors

priyanshu88 avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.