Welcome to my website!
This is a Next.js project bootstrapped with create-next-app. I use Tailwind CSS for styling. Initial projects have used the built-in backend, but for all new projects, authentication and rate limiting I am using my separate Flask backend (api.ashwingur).
The project is deployed on Vercel under the hobby plan. I am using Vercel analytics to track usage, but I have also been designing my own analytics system that can be viewed as a page on my website, as it provides me greater flexbility to track whatever actions I want and also store it indefinitely.
Routes are located in the pages directory, and the built in api is mapped to pages/api.
- All React components are in the
componentsdirectory. - All context providers are in the
contextdirectory. - The
datadirectory contains any hardcoded json files, such as my Media Reviews. - Themes are defined in the
stylesfolder and the selection logic is in@components/ToggleThemeButton.tsx. The next-themesThemeProvideris used in_app.tsx. - For all api calls with my new backend, zod schema validation is used, defined in
shared/validations. The relevant API calls with react-query are inshares/queries. There are still some old pages where the query function is defined in the react component (to be refactored).
The playwright-tests folder defines E2E tests for various flows on the website. It tests both mobile and desktop layouts, including chrome, safari, firefox and webkit.
npm run test- run all testsnpm run test <folder|file>- run all tests in a folder or filenpm run test -- --headed- run tests and show the browsersnpm run test -- --project=<project name>- run tests for a specific browser:firefox,chromium,safari,"Mobile Chrome","Mobile Safari".
.env
PUSHER_APP_ID = "xxx"
PUSHER_SECRET = "xxx"
NEXT_PUBLIC_PUSHER_CLUSTER = "ap4"
NEXT_PUBLIC_PUSHER_KEY = "xxx"
COC_DEV_EMAIL = "xxx"
COC_DEV_PASS = "xxx"
COC_BEARER_TOKEN = "xxx"
MONGO_USERNAME = "xxx"
MONGO_PASSWORD = "xxx"
MONGODB = "xxx"
CLANTRACK_PIN = "xxx"
OPEN_DATA_TOKEN = "xxx"
NEXT_PUBLIC_ASHWINGUR_API = "http://localhost:5000"
First, run the development server:
npm run dev
# or
yarn devOpen http://localhost:3000 with your browser to see the result.
The pages/api directory is mapped to /api/*. Files in this directory are treated as API routes instead of React pages.
Also make sure api.ashwingur is running for full functionality.
This project uses next/font to automatically optimize and load Inter, a custom Google Font.