Skip to content

Commit

Permalink
Rename to Habiti
Browse files Browse the repository at this point in the history
  • Loading branch information
koredefashokun committed Jun 17, 2024
1 parent 2bfeab8 commit db5511d
Show file tree
Hide file tree
Showing 189 changed files with 272 additions and 274 deletions.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
# Market
# Habiti

Market is an open-source mobile-first e-commerce platform that aims to improve the online shopping and store management experience for small to medium-scale retailers in Nigeria.
Habiti is an open-source mobile-first e-commerce platform that aims to improve the online shopping and store management experience for small to medium-scale retailers in Nigeria.

## Motivation

### For shoppers

The average online shopper usually has to create multiple accounts for each store, and keep going back to get information on new arrivals, product discounts and availability. Market solves this by providing an app where shoppers can purchase products, discover and follow stores, get updates and more, all from a single account.
The average online shopper usually has to create multiple accounts for each store, and keep going back to get information on new arrivals, product discounts and availability. Habiti solves this by providing an app where shoppers can purchase products, discover and follow stores, get updates and more, all from a single account.

### For store owners

For most small to medium-scale retailers, setting up an online store is difficult and expensive, and attracting potential customers is even more so. Market solves this by providing an affordable and simple dashboard to manage orders, inventory, analytics and other store-related information. It also helps merchants advertise both their store and products, making it easier for newer stores to gain traction.
For most small to medium-scale retailers, setting up an online store is difficult and expensive, and attracting potential customers is even more so. Habiti solves this by providing an affordable and simple dashboard to manage orders, inventory, analytics and other store-related information. It also helps merchants advertise both their store and products, making it easier for newer stores to gain traction.

## Getting Started

This section will help you get Market up and running in your development environment.
This section will help you get Habiti up and running in your development environment.

### Prerequisites

Expand All @@ -30,7 +30,7 @@ To clone this repo and install the base dependencies:

```sh
# Clone the repository
git clone https://github.com/overthq/Market.git && cd Market
git clone https://github.com/overthq/Habiti.git && cd Habiti

# Install general dependencies
yarn
Expand All @@ -48,7 +48,7 @@ Contributions are welcome. Be sure to check out the [contribution guidelines](.g

## Tech Stack

Market is a TypeScript-based application. It is built with popular JS libraries/frameworks like React, React Native and Express. Here's what the stack looks like:
Habiti is a TypeScript-based application. It is built with popular JS libraries/frameworks like React, React Native and Express. Here's what the stack looks like:

- Front-End
- Framework: [React Native](https://reactnative.dev) and [Expo](https://expo.io)
Expand Down
5 changes: 2 additions & 3 deletions api/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Market API
# Habiti API

This package contains the code for the API that powers Market. It consists of GraphQL types and resolvers, database and cache bindings, as well storage and file upload functions.
This package contains the code for the API that powers Habiti. It consists of GraphQL types and resolvers, database and cache bindings, as well storage and file upload functions.

## Installation and Setup

Expand All @@ -12,4 +12,3 @@ yarn
yarn start-redis # Only necessary if Redis isn't running in the background.
yarn dev
```

2 changes: 1 addition & 1 deletion api/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@market/api",
"name": "@habiti/api",
"version": "0.0.1",
"main": "dist/index.js",
"license": "GPL-3.0",
Expand Down
6 changes: 3 additions & 3 deletions api/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { initSentry } from './config/sentry';
import payments from './payments';
import schema from './schema';
import Services from './services';
import { MarketRequest } from './types/misc';
import { HabitiRequest } from './types/misc';
import webhooks from './webhooks';

import './config/cloudinary';
Expand All @@ -24,7 +24,7 @@ const main = async () => {
initSentry(app);

app.use(express.json());
// app.use(compression());
app.use(compression());
app.use(
expressjwt({
secret: process.env.JWT_SECRET,
Expand All @@ -50,7 +50,7 @@ const main = async () => {
'/graphql',
express.json(),
expressMiddleware(apolloServer, {
context: async ({ req }: { req: MarketRequest }) => ({
context: async ({ req }: { req: HabitiRequest }) => ({
user: req.auth ?? null,
storeId: req.headers['x-market-store-id'] || undefined,
prisma: prismaClient,
Expand Down
4 changes: 2 additions & 2 deletions api/src/payments.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { Router } from 'express';

import { MarketRequest } from './types/misc';
import { HabitiRequest } from './types/misc';
import { verifyTransaction } from './utils/paystack';

const router: Router = Router();

router.post('/verify-transaction', async (req: MarketRequest, res) => {
router.post('/verify-transaction', async (req: HabitiRequest, res) => {
const { reference } = req.body;

try {
Expand Down
2 changes: 1 addition & 1 deletion api/src/schema.graphql
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This file implements a new Relay-compatible schema for Market.
# This file implements a new Relay-compatible schema for Habiti.
# This will probably not be implemented for a while, as I'm still figuring out how to
# implement the Relay pagination spec with Prisma.
# This will also make it easier to port to Go/Rust for v2.
Expand Down
2 changes: 1 addition & 1 deletion api/src/types/misc.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { User } from '@prisma/client';
import { Request } from 'express';

export interface MarketRequest extends Request {
export interface HabitiRequest extends Request {
auth?: User;
}
4 changes: 2 additions & 2 deletions api/src/webhooks.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { createHmac } from 'crypto';
import { Router } from 'express';

import { MarketRequest } from './types/misc';
import { HabitiRequest } from './types/misc';
import { storeCard } from './utils/paystack';
import { handleTransferFailure, handleTransferSuccess } from './utils/webhooks';

const router: Router = Router();

router.post('/paystack', async (req: MarketRequest, res) => {
router.post('/paystack', async (req: HabitiRequest, res) => {
const hash = createHmac('sha512', process.env.PAYSTACK_SECRET_KEY)
.update(JSON.stringify(req.body))
.digest('hex');
Expand Down
2 changes: 1 addition & 1 deletion apps/app/App.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'core-js/full/symbol/async-iterator';
import { ThemeProvider } from '@market/components';
import { ThemeProvider } from '@habiti/components';
import React from 'react';
import { GestureHandlerRootView } from 'react-native-gesture-handler';
import { SafeAreaProvider } from 'react-native-safe-area-context';
Expand Down
3 changes: 1 addition & 2 deletions apps/app/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Market App
# Habiti App

This is the front-facing app that shoppers will use.

Expand All @@ -13,4 +13,3 @@ yarn
yarn start
```

12 changes: 6 additions & 6 deletions apps/app/app.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"expo": {
"name": "Market",
"slug": "market",
"name": "Habiti",
"slug": "habiti",
"owner": "overthq",
"version": "1.0.0",
"orientation": "portrait",
"icon": "./assets/icon.png",
Expand All @@ -18,7 +19,7 @@
"supportsTablet": true
},
"android": {
"package": "dev.overt.market",
"package": "app.habiti.app",
"adaptiveIcon": {
"foregroundImage": "./assets/adaptive-icon.png",
"backgroundColor": "#FFFFFF"
Expand All @@ -29,9 +30,8 @@
},
"extra": {
"eas": {
"projectId": "cb3a245a-4a6a-4c65-979d-bb5ef810b12c"
"projectId": "f09782f6-8048-4ad4-8ff1-3fb7a65fbe48"
}
},
"owner": "overthq"
}
}
}
7 changes: 4 additions & 3 deletions apps/app/package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
{
"name": "@market/app",
"name": "@habiti/app",
"version": "1.0.0",
"private": true,
"main": "index.js",
"license": "GPL-3.0-or-later",
"scripts": {
"lint": "eslint .",
"generate-types": "graphql-codegen --config codegen.yml",
Expand All @@ -13,8 +14,8 @@
"eject": "expo eject"
},
"dependencies": {
"@market/common": "*",
"@market/components": "*",
"@habiti/common": "*",
"@habiti/components": "*",
"@react-native-async-storage/async-storage": "1.23.1",
"@react-native-masked-view/masked-view": "0.3.1",
"@react-navigation/bottom-tabs": "^6.3.1",
Expand Down
4 changes: 2 additions & 2 deletions apps/app/src/components/cart/CartProduct.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { formatNaira } from '@market/common';
import { CustomImage, Spacer, Typography } from '@market/components';
import { formatNaira } from '@habiti/common';
import { CustomImage, Spacer, Typography } from '@habiti/components';
import React from 'react';
import { View, Pressable, StyleSheet } from 'react-native';

Expand Down
2 changes: 1 addition & 1 deletion apps/app/src/components/cart/CartSummary.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Spacer, Typography } from '@market/components';
import { Spacer, Typography } from '@habiti/components';
import { NavigationProp, useNavigation } from '@react-navigation/native';
import React from 'react';
import { View } from 'react-native';
Expand Down
4 changes: 2 additions & 2 deletions apps/app/src/components/cart/CartTotal.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { formatNaira } from '@market/common';
import { Typography } from '@market/components';
import { formatNaira } from '@habiti/common';
import { Typography } from '@habiti/components';
import React from 'react';
import { StyleSheet, View } from 'react-native';

Expand Down
2 changes: 1 addition & 1 deletion apps/app/src/components/cart/DeliveryInfo.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Spacer, Typography } from '@market/components';
import { Spacer, Typography } from '@habiti/components';
import React from 'react';
import { View } from 'react-native';

Expand Down
2 changes: 1 addition & 1 deletion apps/app/src/components/cart/SelectCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
TextButton,
Typography,
useTheme
} from '@market/components';
} from '@habiti/components';
import { useNavigation, NavigationProp } from '@react-navigation/native';
import React from 'react';
import { View } from 'react-native';
Expand Down
2 changes: 1 addition & 1 deletion apps/app/src/components/cart/StoreInfo.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Typography } from '@market/components';
import { Typography } from '@habiti/components';
import React from 'react';
import { View } from 'react-native';

Expand Down
2 changes: 1 addition & 1 deletion apps/app/src/components/carts/CartsListItem.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { CustomImage, Icon, Typography, useTheme } from '@market/components';
import { CustomImage, Icon, Typography, useTheme } from '@habiti/components';
import React from 'react';
import { View, StyleSheet, Pressable } from 'react-native';

Expand Down
2 changes: 1 addition & 1 deletion apps/app/src/components/edit-profile/EditProfileMain.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { FormInput, Screen, TextButton } from '@market/components';
import { FormInput, Screen, TextButton } from '@habiti/components';
import { useNavigation } from '@react-navigation/native';
import React from 'react';
import { useForm } from 'react-hook-form';
Expand Down
2 changes: 1 addition & 1 deletion apps/app/src/components/explore/ExploreHeader.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Icon, TextButton, useTheme } from '@market/components';
import { Icon, TextButton, useTheme } from '@habiti/components';
import React from 'react';
import { View, TextInput, StyleSheet } from 'react-native';
import Animated, {
Expand Down
2 changes: 1 addition & 1 deletion apps/app/src/components/explore/ExploreMain.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ScrollableScreen, useTheme } from '@market/components';
import { ScrollableScreen, useTheme } from '@habiti/components';
import React from 'react';
import { ActivityIndicator, StyleSheet } from 'react-native';

Expand Down
2 changes: 1 addition & 1 deletion apps/app/src/components/explore/ProductResultRow.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { CustomImage, Spacer, Typography } from '@market/components';
import { CustomImage, Spacer, Typography } from '@habiti/components';
import React from 'react';
import { Pressable, StyleSheet } from 'react-native';

Expand Down
2 changes: 1 addition & 1 deletion apps/app/src/components/explore/RecentSearches.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Screen, SectionHeader, useTheme } from '@market/components';
import { Screen, SectionHeader, useTheme } from '@habiti/components';
import React from 'react';
import { StyleSheet } from 'react-native';

Expand Down
2 changes: 1 addition & 1 deletion apps/app/src/components/explore/SearchResults.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Screen, useTheme } from '@market/components';
import { Screen, useTheme } from '@habiti/components';
import { NavigationProp, useNavigation } from '@react-navigation/native';
import { FlashList } from '@shopify/flash-list';
import React from 'react';
Expand Down
2 changes: 1 addition & 1 deletion apps/app/src/components/explore/StoreResultRow.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { CustomImage, Spacer, Typography } from '@market/components';
import { CustomImage, Spacer, Typography } from '@habiti/components';
import React from 'react';
import { Pressable, StyleSheet } from 'react-native';

Expand Down
2 changes: 1 addition & 1 deletion apps/app/src/components/explore/TrendingStores.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ListEmpty, SectionHeader } from '@market/components';
import { ListEmpty, SectionHeader } from '@habiti/components';
import { NavigationProp, useNavigation } from '@react-navigation/native';
import { FlashList } from '@shopify/flash-list';
import React from 'react';
Expand Down
2 changes: 1 addition & 1 deletion apps/app/src/components/explore/TrendingStoresItem.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { CustomImage, Typography } from '@market/components';
import { CustomImage, Typography } from '@habiti/components';
import React from 'react';
import { Pressable, StyleSheet } from 'react-native';

Expand Down
2 changes: 1 addition & 1 deletion apps/app/src/components/home/FollowedStores.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Dialog, SectionHeader } from '@market/components';
import { Dialog, SectionHeader } from '@habiti/components';
import { useNavigation, NavigationProp } from '@react-navigation/native';
import { FlashList } from '@shopify/flash-list';
import React from 'react';
Expand Down
2 changes: 1 addition & 1 deletion apps/app/src/components/home/FollowedStoresItem.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { CustomImage, Typography } from '@market/components';
import { CustomImage, Typography } from '@habiti/components';
import React from 'react';
import { StyleSheet, Pressable } from 'react-native';

Expand Down
2 changes: 1 addition & 1 deletion apps/app/src/components/home/NewArrivals.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Typography } from '@market/components';
import { Typography } from '@habiti/components';
import { FlashList } from '@shopify/flash-list';
import React from 'react';
import { View } from 'react-native';
Expand Down
4 changes: 2 additions & 2 deletions apps/app/src/components/home/OrderStatusPill.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Typography, useTheme } from '@market/components';
import { ThemeObject } from '@market/components/src/styles/theme';
import { Typography, useTheme } from '@habiti/components';
import { ThemeObject } from '@habiti/components/src/styles/theme';
import React from 'react';
import { View, StyleSheet } from 'react-native';

Expand Down
2 changes: 1 addition & 1 deletion apps/app/src/components/home/RecentOrder.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { CustomImage, Typography } from '@market/components';
import { CustomImage, Typography } from '@habiti/components';
import React from 'react';
import { View, StyleSheet, Pressable } from 'react-native';

Expand Down
2 changes: 1 addition & 1 deletion apps/app/src/components/home/RecentOrders.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ListEmpty, Typography } from '@market/components';
import { ListEmpty, Typography } from '@habiti/components';
import { useNavigation, NavigationProp } from '@react-navigation/native';
import React from 'react';
import { View, StyleSheet } from 'react-native';
Expand Down
2 changes: 1 addition & 1 deletion apps/app/src/components/home/Watchlist.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ListEmpty, SectionHeader } from '@market/components';
import { ListEmpty, SectionHeader } from '@habiti/components';
import { useNavigation, NavigationProp } from '@react-navigation/native';
import { FlashList } from '@shopify/flash-list';
import React from 'react';
Expand Down
4 changes: 2 additions & 2 deletions apps/app/src/components/home/WatchlistProduct.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { formatNaira } from '@market/common';
import { CustomImage, Typography } from '@market/components';
import { formatNaira } from '@habiti/common';
import { CustomImage, Typography } from '@habiti/components';
import React from 'react';
import { Pressable, StyleSheet } from 'react-native';

Expand Down
4 changes: 2 additions & 2 deletions apps/app/src/components/order/OrderMeta.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { formatNaira } from '@market/common';
import { Typography } from '@market/components';
import { formatNaira } from '@habiti/common';
import { Typography } from '@habiti/components';
import React from 'react';
import { View, StyleSheet } from 'react-native';

Expand Down
4 changes: 2 additions & 2 deletions apps/app/src/components/order/OrderProduct.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { formatNaira } from '@market/common';
import { CustomImage, Typography } from '@market/components';
import { formatNaira } from '@habiti/common';
import { CustomImage, Typography } from '@habiti/components';
import React from 'react';
import { View, Pressable, StyleSheet } from 'react-native';

Expand Down
2 changes: 1 addition & 1 deletion apps/app/src/components/order/StoreMeta.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { CustomImage, Typography, useTheme } from '@market/components';
import { CustomImage, Typography, useTheme } from '@habiti/components';
import { NavigationProp, useNavigation } from '@react-navigation/native';
import React from 'react';
import { Pressable, View } from 'react-native';
Expand Down
2 changes: 1 addition & 1 deletion apps/app/src/components/orders/OrdersListItem.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Typography } from '@market/components';
import { Typography } from '@habiti/components';
import React from 'react';
import { View, Pressable } from 'react-native';

Expand Down
2 changes: 1 addition & 1 deletion apps/app/src/components/product/AddToCart.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useTheme } from '@market/components';
import { useTheme } from '@habiti/components';
import React from 'react';
import { View, StyleSheet } from 'react-native';
import { useSafeAreaInsets } from 'react-native-safe-area-context';
Expand Down
Loading

0 comments on commit db5511d

Please sign in to comment.