Full-stack codebase for akfamakon.uz. The backend is an Express + MongoDB API that also serves the compiled UI, while the frontend is a Vite + React SPA that renders marketing pages, product listings, and admin placeholders.
backend/ REST API, JWT auth, Mongo models, AWS S3 uploads, SSR host
frontend/ Vite + React + Tailwind storefront and admin shell
- Node.js/Express server defined in
backend/server.js; exposes namespaced routes for auth, files, content modules (partners, services, products, news, sliders, banners, portfolios, receptions), site settings, visitor statistics, and visit logs. - MongoDB models under
backend/models/capture multi-language content, price ranges, and media relations. - Authentication uses bcrypt-hashed credentials plus custom JWT middleware (
middleware/auth.middleware.js). - File uploads stream directly to AWS S3 via
multer-s3;FileController.DeleteManykeeps S3 keys and MongoFiledocs in sync. - Production mode serves the built frontend bundle from
backend/dist.
- Vite + React + TypeScript app (
frontend/) styled with Tailwind and utility CSS. - Routing handled through
react-router-domwith lazy-loaded sections: Home, Products, News, Contact, and an/adminshell. - UI composed from
components/(Header, Footer, Layout) andpages/Home/components/*for hero banners, stats, partner slider, and contact CTA blocks. - Animations via
react-animate-on-scroll, deferred images viareact-lazy-load-image-component, and masked inputs via@react-input/mask.
cd backend
cp .env.example .env # create this file; see variables below
npm install
npm start # starts on PORT (default 3000)cd frontend
npm install
npm run dev # Vite dev server on port 5173 by default
npm run build # outputs dist/ you can copy into backend/dist for SSRPORT=3000
DB_URI=mongodb+srv://...
SECRET=super-secret-jwt
S3_ACCESS_KEY_ID=...
S3_SECRET_ACCESS_KEY=...
S3_BUCKET_REGION=eu-central-1
S3_BUCKET_NAME=akfamakon-assets
npm run buildinfrontend/and copy the generateddist/intobackend/dist/.- Provide the
.envvalues above on the server (Node 18+ recommended). npm install --productioninsidebackend/and runnpm start(or wrap with a process manager).
For route-by-route backend details, see backend/README.md.