Coder Social home page Coder Social logo

jaraquistain / supereffective Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jrel/supereffective

0.0 1.0 0.0 88.76 MB

The most complete Pokémon and PokéDex Tracker

Home Page: https://supereffective.gg

License: MIT License

Shell 0.10% JavaScript 2.73% TypeScript 74.76% CSS 13.11% Makefile 0.14% MDX 9.17%

supereffective's Introduction

SuperEffective

Check Code Quality wakatime

Source code for supereffective.gg 's website.

Data can be found in supereffective-sdk.

Software Stack

We use the following technologies, services and tools:

  • We use Node v18 LTS
  • pnpm v8 for package management
  • Turborepo (turbo) to accelerate running scripts
  • NextJS 13 + React 18 for the website
  • CSS Modules for styling without styling libraries (to be integrated with TailwindCSS in v4)
  • React Context for state management (to be replaced by Redux Toolkit in v4)
  • MDX + FrontMater CMS as the local/static CMS
  • Next Auth, Prisma and Neon.tech PostgreSQL for authentication and dex data storage (after migrating from Firebase)
  • Vercel (Pro tier) for hosting and deployments
  • GitHub for hosting static data
  • CloudFlare for caching and DNS
  • Docker, PostgreSQL and Maildev for local development environment
  • Other tools: ESLint, Prettier, Husky, etc.

This repository is a Turbo monorepo, meaning it contains multiple packages and apps.

Project Structure

The main application is the website, which is located in ./packages/website. The MDX files for pages and articles are located under the ./cms directory.

Website is a NextJS application with the following structure:

./packages/website:

  • pages: next routes/pages and APIs
  • public: static assets (for the UI and also for the CMS pages)
  • src:
    • config: general app config (e.g. from env vars, json files or ts code)
    • containers: root-level app components (this is not a NextJS 13 app dir structure)
    • features: business logic in bounded contexts, following some DDD principles
      • /**/: name of the domain / feature
        • components: components specific to this domain
        • hooks: hooks specific to this domain
        • state: domain state: contexts, objects and types
        • views: domain views: views composed with many other components
    • hooks: reusable hooks
    • layouts: reusable page skeletons / themes
    • primitives: reusable components without business logic or global state
    • styles: global css styles
    • utils: reusable generic functions that do not belong to services or to a specific domain

All code that it's subject to be rewritten and refactored is under src/**/legacy/ subfolders or has "legacy" as part of the filename.

Monorepo packages

  • auth: Authentication abstraction layer
  • config: Project confing and env vars wrapper
  • database: Database abstraction layer. It also abstracts the Pokemon JSON data from supereffective-sdk.
  • mailer: Transactional mailing service abstraction layer
  • mdx: MDX abstraction layer (loader and react components).
  • patreon: All necessary code to connect to Patreon API and get infos
  • ui: Stateless UI components, assets, fonts, SVGs, and tools. Uses TailwindCSS and Lucide Icons.
  • utils: Generic utilities for various environments (universal, commonjs, react, nextjs)
  • website: v3 site, using Next pages dir

Prerequisites

You will need Docker (for the local DB and mail server), Node v18 LTS and pnpm v8.

Quick Start

  1. Clone the repository
  2. Install dependencies: pnpm install
  3. Generate necessary data and code locally: pnpm codegen
  4. Configure your PostgreSQL DB connection strings. You can use the db service in docker-compose.yml to spawn a local DB using Docker, or or use a provider like Neon.tech, then configure the database env vars in:
  • packages/database/.env
  • packages/website/.env.local
  1. Run the website in development mode: run any of: pnpm dev / make.
  2. Open http://localhost:3001 or run pnpm open to open the website in your browser. Other URLs:

Maintenance scripts

  • pnpm build: builds the website.
  • pnpm codegen: pulls the data from itsjavi/supereffective-sdk repo, and generates all necessary code (including CSS).

For other scripts, please check the package.json files.

Dependencies

  • Q: Why packages like "turbo" or "eslint" are under "dependencies" instead of "devDependencies"?
  • A: Because on Vercel, the "devDependencies" are not installed, and NextJS apps need many of them during the build process (especially ESLint plugins and configs and all their dependencies).

Contributing

Contributions are welcome! Please read the contributing guidelines before submitting a PR.

For other feedback that is not related to issues, please use our Discord server

License

This project is licensed under the MIT License.

supereffective's People

Contributors

itsjavi avatar github-actions[bot] avatar jaraquistain avatar jrel 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.