Skip to content

arlagonix/dance-school-moscow

Repository files navigation

D.A.N.C.E. School Redesign

Made with HTML, CSS, TypeScript, ReactJS, TailwindCSS
Bootstrapped with Create Next App

GitHub Workflow Status GitHub last commit GitHub

πŸ–Ό Screenshots β€’ ℹ️ About β€’ βš™οΈ Tools β€’ πŸ”¨ How to Build Project β€’ πŸ“ File Structure

πŸ“¦ NPM Packages worth mentioning β€’ πŸ’‘ Details β€’ πŸ”— Useful resources β€’ πŸ‘€ Author

πŸ–Ό Screenshots

Also I significantly optimized the site:

The performance of my site: https://pagespeed.web.dev/analysis/https-dance-school-moscow-vercel-app/eb21uy6l9z?form_factor=mobile&hl=en

The performance of the old site: https://pagespeed.web.dev/analysis/https-danceschool-moscow/4c6sxfv3ke?form_factor=mobile%3Fhl%3Den&hl=en

ℹ️ About

I studied dances in D.A.N.C.E. school. When I saw their site I thought that there is some space for improvement.

The original site looks like that: https://danceschool.moscow/

Thus I made a new design from scratch and implemented it.

The main goal of the project is to demonstrate my skills in NextJS, TailwindCSS. Also I wanted to try out the ShadcnUI library

βš™οΈ Tools

  • HTML5
  • CSS
    • TailwindCSS
  • TypeScript
    • ReactJS
    • NextJS
    • ShadcnUI
  • Vercel

πŸ”¨ Build project

Command Description
npmΒ i First things first, install all required packages
npmΒ runΒ dev Run the app in development mode
npmΒ runΒ build Build the app
npmΒ runΒ start Run the app in production mode
npmΒ runΒ lint Check compliance with Eslint rules
npmΒ runΒ test Run unit tests

πŸ“ File Structure

|
β”œβ”€β”€ πŸ“ public                 Static assets
|
β”œβ”€β”€ πŸ“ screenshots            App screenshots
|
β”œβ”€β”€ πŸ“ src                    Source code of the app
|   |
β”‚   β”œβ”€β”€ πŸ“ app                NextJS pages (routing)
|   |   |
|   |   β”œβ”€β”€ πŸ“ PageName
|   |   |   β”œβ”€β”€ πŸ“ page.tsx            Page logic
|   |   |   β”œβ”€β”€ πŸ“ page.types.tsx      (optional) Page types
|   |   |   β”œβ”€β”€ πŸ“ hooks.tsx           (optional) Custom react hooks
|   |   |   β”œβ”€β”€ πŸ“ utils.ts            (optional) Custom utility functions
|   |   |   └── πŸ“ other files         Other additional files
|   |   |
β”‚   |   β”œβ”€β”€ πŸ“ globals.scss            Global styles
β”‚   |   β”œβ”€β”€ πŸ“ icon.png                Favicon
β”‚   |   β”œβ”€β”€ πŸ“ layout.tsx              Root app layout
β”‚   |   └── πŸ“ page.tsx                Root page
|   |
β”‚   β”œβ”€β”€ πŸ“ components                  React components
|   |   |
β”‚   |   β”œβ”€β”€ πŸ“ ComponentName.tsx       Component logic and styles
|   |   |
|   |   β”œβ”€β”€ πŸ“ svg                     Svg icons imported in the app
|   |   |
|   |   └── πŸ“ ComponentName
|   |       β”œβ”€β”€ πŸ“ index.tsx           Component logic
|   |       β”œβ”€β”€ πŸ“ index.module.css   (optional) Component styles
|   |       β”œβ”€β”€ πŸ“ index.types.tsx     (optional) Component types
|   |       β”œβ”€β”€ πŸ“ hooks.tsx           (optional) Custom hooks used only in this component
|   |       β”œβ”€β”€ πŸ“ utils.ts            (optional) Custom utility functions used only in this component
|   |       └── πŸ“ other files         Other additional files
|   |
β”‚   β”œβ”€β”€ πŸ“ data                        Code responsible for providing data to display on the pages
|   |
β”‚   β”œβ”€β”€ πŸ“ lib
β”‚   |   β”œβ”€β”€ πŸ“ hooks                   Custom React hooks
|   |   β”œβ”€β”€ πŸ“ utils.test.ts           Unit tests
|   |   └── πŸ“ utils.ts                Utility functions
|   |
|   |
β”‚   β”œβ”€β”€ πŸ“ globals.scss       Global styles
β”‚   β”œβ”€β”€ πŸ“ index.html         Root HTML file
β”‚   β”œβ”€β”€ πŸ“ index.tsx          Entry point for the module bundler
β”‚   └── πŸ“ vite-end.d.ts      Some Typescript stuff for Vite
|
β”œβ”€β”€ πŸ“ .eslintrc.cjs          ESLint configuration file
β”œβ”€β”€ πŸ“ .gitignore             Instructions for Git about what files to ignore
β”œβ”€β”€ πŸ“ .prettierrc            Prettier configuration file
β”œβ”€β”€ πŸ“ components.json        (automatically generated) Config file for ShadcnUI components
β”œβ”€β”€ πŸ“ LICENSE                MIT License. Basically you can do whatever you want with the code
β”œβ”€β”€ πŸ“ next.config.mjs        NextJS config file
β”œβ”€β”€ πŸ“ package-lock.json      Keeps track of the exact version of every package that is installed
β”œβ”€β”€ πŸ“ package.json           Various metadata relevant to the project, scripts, dependencies
β”œβ”€β”€ πŸ“ postcss.config.mjs     PostCSS config file (for TailwindCSS)
β”œβ”€β”€ πŸ“ README.md              Project description
β”œβ”€β”€ πŸ“ svgr.d.ts              Types required for using .svg files as React components
β”œβ”€β”€ πŸ“ taildwind.config.ts    TailwindCSS config file
└── πŸ“ tsconfig.json          TypeScript configuration file

πŸ“¦ NPM Packages worth mentioning

  • swiper - library that I used for displaying iframes in a carousel
  • yet-another-react-lightbox - used to display image galleries in a carousel
  • vitest - unit tests

πŸ’‘ Details

Design

The most of efforts was dedicated to creating a prototype in Figma. It was quite a challenge to come up with a proper design that would feasible, yet nice looking.

Here is the prototype: https://www.figma.com/design/RNcFcOtzYXltCOzdM1dqKr/DANCE-School?node-id=0-1&t=omUocB5RXLxJ4pVq-1

TailwindCSS

Not a big fan of it. Initially thought that if I make a big project with TailwindCSS I would change my mind about it. No, I still don't understand the big hype around it

Just look at that:

<nav
  className={cn(
    'fixed top-16 z-10 max-h-screen',
    'mobile:left-1/2 mobile:top-0 mobile:w-[min(100%,var(--standard-width))] mobile:-translate-x-1/2 mobile:bg-white',
    'desktop:left-16 desktop:max-h-[calc(100vh-4rem)]'
  )}
>

I don't like when styles are mixed with page logic. CSS Modules is still the best solution for me, so far.

Advantages:

  • Less style files in the app
  • I didn't have to think about naming classes (although it wasn't a problem for me)
  • Was able to use ShadcnUI (it works only with TailwindCSS)

Disadvantages:

  • Unintuitive syntax: I had to often look in the cheat sheet
  • Hard to read: plain CSS is so much more comfortable to read
  • Messy code: from time to time I had to figure out what element on screen that was

Tailwind might be nice for smaller projects, but I wouldn't recommend to use it on big projects

Markdown Typography

https://github.com/tailwindlabs/tailwindcss-typography - Typography in TailwindCSS for Markdown

<Markdown className="prose mt-4">{trainer.markDownPageDescription}</Markdown>

Svgr

See: https://react-svgr.com/docs/next/#typescript

Helps to turn svg into React Components

Add svgr.d.ts in the root:

declare module '*.svg' {
  import { FC, SVGProps } from 'react'
  const content: FC<SVGProps<SVGElement>>
  export default content
}

declare module '*.svg?url' {
  const content: any
  export default content
}

Then you can import them like that:

import PartyIcon from '@/components/svg/icons_small/party.svg'

πŸ”— Useful resources

n/a