Made with HTML
, CSS
, TypeScript
, ReactJS
, TailwindCSS
Bootstrapped with Create Next App
πΌ Screenshots β’ βΉοΈ About β’ βοΈ Tools β’ π¨ How to Build Project β’ π File Structure
π¦ NPM Packages worth mentioning β’ π‘ Details β’ π Useful resources β’ π€ Author
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
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
- HTML5
- CSS
- TailwindCSS
- TypeScript
- ReactJS
- NextJS
- ShadcnUI
- Vercel
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 |
|
βββ π 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
swiper
- library that I used for displaying iframes in a carouselyet-another-react-lightbox
- used to display image galleries in a carouselvitest
- unit tests
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
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
https://github.com/tailwindlabs/tailwindcss-typography - Typography in TailwindCSS for Markdown
<Markdown className="prose mt-4">{trainer.markDownPageDescription}</Markdown>
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'
n/a