Skip to content

UNIZAR-30226-2023-01/chess-frontend

Repository files navigation

chess-frontend Production CI

node npm

Next JS TailwindCSS ESLint Docker cypress

Folder structure

Note _document.js vs. _app.js -- What is the difference?

  • _app.js: Core of the application, everything is assembled from here at runtime.
  • _document.js: Where side effects are possible.
  • components: Contains the reusable layouts of the application.
  • context: Encapsulates a global state that can be accessed from anywhere in the application.
  • hooks: Encapsulates small pieces of code that represent a certain type of logic.
  • lib: Chaos property, stores here functionalities that do not have to do with the rest of the mentioned sections.
  • pages/api: Endpoints for creating an api rest.
  • pages: pages accessible from the browser via .../page
  • public: Static content.
  • styles: Contains the styles of the application. Override or new styles in tailwind.config.js.
  • nginx: Contains the nginx server configuration.

Getting Started

Run for a development environment

Warning This version does not include nginx redirectión.
Server will be available in: localhost:3000

npm run dev

Run for a production environment

Warning This version does not include nginx redirectión.
Server will be available in: localhost:3000

npm run build
npm run start

Compile for docker

Note This version includes nginx redirectión.
Server will be available in: localhost:80

docker-compose up -d

Learn More

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

You can check out the Next.js GitHub repository