GithubHelp home page GithubHelp logo

darkyeg / startup-nextjs-template Goto Github PK

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

Next.js Template: Simplified Development Environment for Web Apps

License: Apache License 2.0

TypeScript 88.41% CSS 4.76% JavaScript 6.83%

startup-nextjs-template's Introduction

Startup Next.js Template

Welcome to Startup Next.js Template! This template is designed to kickstart your next web application project with a robust foundation and best practices in mind. Whether you're a beginner or an experienced developer, this template provides everything you need to start building your application efficiently.

Features

  • Fetch: Simplifies fetch requests handling and error management, inspired by Rust.
  • Components Folder: Contains common reusable components and containers to accelerate development.
  • Providers: Provides a structured approach to managing global state and dependencies.
  • Multi-language Support: Integrated with next-intl for effortless internationalization.
  • MobX Stores: Pre-configured MobX stores for managing user-related state.
  • SDK System: Easily consume backend APIs with an intuitive SDK system (sdk.user.login()).

Getting Started

Follow these steps to start using the template:

  1. Clone the Repository:

    git clone https://github.com/darkyeg/startup-nextjs-template
    cd startup-nextjs-template
  2. Install Dependencies:

    bun install
  3. Run the Development Server:

    bun dev
  4. Start Building: Begin building your application by editing the provided components, stores, and SDK methods.

Directory Structure

.
├── app/                 # Main application folder
├── assets/              # Static assets
├── components/          # UI components
│   ├── Common/          # Common components
│   ├── Containers/      # Containers
│   ├── Forms/           # Form components
│   └── Icons/           # Icon components
├── hooks/               # Custom hooks
├── i18n/                # Internationalization configuration and messages
├── layouts/             # Layout components
├── providers/           # Global state providers
├── public/              # Public assets
├── sdk/                 # Backend API SDK
├── stores/              # MobX stores
└── styles/              # Stylesheets

Usage

Fetch Class

The Fetch class simplifies API requests and error handling:

const fetch = new Fetch(); // or useFetch();

async function fetchData() {
  const result = await fetch.delete('/api/data');
  if (result.isOk()) {
    const responseData = result.unwrap().data;
    // Handle successful response
  } else {
    const error = result.unwrapErr();
    // Handle error
  }
}

Multi-language Support

Utilize next-intl for internationalization:

import { useIntl } from 'next-intl';

function MyComponent() {
  const t = useTranslations();

  return <h1>{t('common.hi')}</h1>;
}

Contributing

We welcome contributions from the community! Feel free to open issues for feature requests, bug reports, or pull requests to enhance this template.

License

This template is licensed under the Apache License 2.0 License. See the LICENSE file for details.

startup-nextjs-template's People

Contributors

darkyeg 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.