Skip to content

Commit f1837e8

Browse files
committed
Add descriptives to root README.md
1 parent e18fbd0 commit f1837e8

File tree

1 file changed

+239
-21
lines changed

1 file changed

+239
-21
lines changed

Diff for: README.md

+239-21
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,249 @@
1-
[![runs with Expo Go](https://img.shields.io/badge/Runs%20with%20Expo%20Go-000.svg?style=flat-square&logo=EXPO&labelColor=f3f3f3&logoColor=000)](https://expo.io/client)
21

3-
[![runs with Expo Go](https://img.shields.io/badge/Runs%20with%20Expo%20Go-4630EB.svg?style=flat-square&logo=EXPO&labelColor=f3f3f3&logoColor=000)](https://expo.io/client)
2+
<div style="display: flex; justify-content: space-between;">
3+
<a href="https://expo.io/client">
4+
<img src="https://img.shields.io/badge/Runs%20with%20Expo%20Go-000.svg?style=flat-square&logo=EXPO&labelColor=f3f3f3&logoColor=000" alt="runs with Expo Go">
5+
</a>
6+
<a href="https://expo.io/client">
7+
<img src="https://img.shields.io/badge/Runs%20with%20Expo%20Go-4630EB.svg?style=flat-square&logo=EXPO&labelColor=f3f3f3&logoColor=000" alt="runs with Expo Go">
8+
</a>
9+
</div>
10+
11+
<!-- Anchor for Back To Top -->
12+
<a id="readme-top"></a>
13+
414
# ThriftHub
515
An Online Marketplace Application
616

17+
ThriftHub is a platform that allows users to post second-hand goods and connect with vendors interested in such items.
18+
19+
## Getting Started
20+
21+
This project is structured as a monorepo, managing both the frontend and backend applications.
22+
To streamline the setup process, several scripts are provided to configure and run the applications efficiently.
23+
24+
### Root `package.json` Scripts
25+
26+
- **`configure:path`**: Executes [`configurePath.js`](configurePath.js), to ensure environment paths are correctly set up for the backend.
27+
28+
- **`configure:backend`**: Runs [`configureBackend.js`](configureBackend.js), to prepare the Django backend environment by setting up required Python packages and configurations.
29+
30+
- **`setup:backend`**: Sequentially runs `configure:path` and `configure:backend` to prepare the backend environment.
31+
32+
- **`start:backend`**: Initiates the backend server by invoking the start script defined in the backend's [`package.json`](backend/package.json).
33+
34+
- **`start:frontend`**: Starts the frontend application by calling the start script defined in the frontend's [`package.json`](frontend/package.json).
35+
36+
- **`dev`**: Utilizes `concurrently` to run both the backend and frontend servers simultaneously, allowing for concurrent development.
37+
38+
### [`backend/package.json`](backend/package.json) Script
39+
40+
- **`start`**: Executes `start.sh`, a shell script that initializes the backend server. This script typically activates the virtual environment, applies database migrations, and starts the Django development server.
41+
42+
### [`frontend/package.json`](frontend/package.json) Script
43+
44+
- **`start`**: Launches the frontend application using the `expo start` command.
45+
46+
### Setup Instructions
47+
To set up the project as a monorepo:
48+
49+
**Prerequisites**
50+
51+
- Ensure [Yarn](https://yarnpkg.com/) is installed on your system.
52+
53+
**Installation Steps**
54+
55+
1. **Clone the Repository**:
56+
```bash
57+
git clone [email protected]:israelias/thrifthub.git
58+
cd thrifthub
59+
```
60+
61+
2. **Install Dependencies**:
62+
```bash
63+
yarn install
64+
```
65+
This command installs all dependencies for both backend and frontend projects, leveraging Yarn Workspaces for efficient management.
66+
67+
3. **Configure the backend**
68+
```bash
69+
yarn setup:backend
70+
```
71+
This script prepares the backend environment by setting up required environment variables and configurations.
72+
4. **Start the Development Servers**:
73+
```bash
74+
yarn dev
75+
```
76+
This command runs both the backend and frontend servers concurrently, allowing you to develop and test the applications simultaneously.
77+
```
78+
79+
**TODO**
80+
The frontend web-build at [thrifthub-frontend](https://thifthub.vercel.app) is currently still consuming a dead heroku backend.
81+
See [`frontend/src/config.ts`](frontend/src/constants/backend.constants.ts) for the current backend URL. The new production backend is hosted at [thrifthub-backend](https://thrifthub-backend.onrender.com/) and should be updated in the `const API_URL` variable.
782

8-
An app that allows users to post second-hand goods and connect with vendors interested in such goods.
83+
- [ ] Adjust `const API_URL` in [`frontend/src/config.ts`](frontend/src/constants/backend.constants.ts) to variably match the backend server's URL for development and production environments.
984

1085

86+
### Configuration Scripts
87+
88+
To streamline the setup process, several scripts are provided to configure the project efficiently. These scripts are designed to prepare the backend environment, set up paths, and ensure the project is ready for development.
89+
90+
* `configurePath.js`: This script sets up necessary path configurations for the backend, ensuring that all file and directory paths are correctly established.
91+
* `configureBackend.js`: This script prepares the backend environment by setting up required environment variables and configurations, ensuring the backend is ready for development and production.
92+
* `start.sh`: A shell script that initiates the backend server, handling any necessary pre-start tasks and ensuring the server runs with the appropriate settings.
93+
* Activates the virtual environment.
94+
* Applies database migrations.
95+
* Starts the Django development server.
96+
97+
98+
By following these instructions, you can set up and run the project efficiently within a monorepo structure.
99+
100+
<hr>
101+
102+
<details><summary><em><b>Directory Structure </b></em> (tree) </summary>
103+
<br>
104+
105+
```
106+
.
107+
├── backend
108+
│   ├── account
109+
│   │   ├── migrations
110+
│   │   ├── tests
111+
│   │   │   ├── test_models.py
112+
│   │   │   ├── test_serializers.py
113+
│   │   │   ├── test_urls.py
114+
│   │   │   └── test_views.py
115+
│   │   ├── admin.py
116+
│   │   ├── apps.py
117+
│   │   ├── models.py
118+
│   │   ├── schema.py
119+
│   │   ├── serializers.py
120+
│   │   ├── urls.py
121+
│   │   └── views.py
122+
│   │   ├── database_schema.txt
123+
│   │   ├── payments_schema.txt
124+
│   │   └── screenshots
125+
│   ├── order
126+
│   │   ├── migrations
127+
│   │   ├── tests
128+
│   │   │   ├── test_models.py
129+
│   │   │   ├── test_serializers.py
130+
│   │   │   ├── test_urls.py
131+
│   │   │   └── test_views.py
132+
│   │   ├── admin.py
133+
│   │   ├── apps.py
134+
│   │   ├── cart.py
135+
│   │   ├── models.py
136+
│   │   ├── schema.py
137+
│   │   ├── serializers.py
138+
│   │   ├── types.py
139+
│   │   ├── urls.py
140+
│   │   └── views.py
141+
│   ├── store
142+
│   │   ├── migrations
143+
│   │   ├── tests
144+
│   │   │   ├── test_models.py
145+
│   │   │   ├── test_serializers.py
146+
│   │   │   ├── test_urls.py
147+
│   │   │   └── test_views.py
148+
│   │   ├── admin.py
149+
│   │   ├── apps.py
150+
│   │   ├── models.py
151+
│   │   ├── schema.py
152+
│   │   ├── serializers.py
153+
│   │   ├── urls.py
154+
│   │   └── views.py
155+
│   └── vendor
156+
│   │   ├── migrations
157+
│   │   ├── tests
158+
│   │   │   ├── test_models.py
159+
│   │   │   ├── test_serializers.py
160+
│   │   │   ├── test_urls.py
161+
│   │   │   └── test_views.py
162+
│   │   ├── admin.py
163+
│   │   ├── apps.py
164+
│   │   ├── models.py
165+
│   │   ├── schema.py
166+
│   │   ├── serializers.py
167+
│   │   ├── urls.py
168+
│   │   └── views.py
169+
│   ├── core
170+
│   │   ├── asgi.py
171+
│   │   ├── schema.py
172+
│   │   ├── settings.py
173+
│   │   ├── storages.py
174+
│   │   ├── urls.py
175+
│   │   ├── wsgi.py
176+
│   │   └── yasg.py
177+
│   ├── documentation
178+
│   ├── media
179+
│   ├── static
180+
│   ├── staticfiles
181+
│   ├── manage.py
182+
│   ├── requirements.txt
183+
│   ├── Procfile
184+
│   ├── package.json
185+
│   ├── start.sh
186+
│   └── README.md
187+
├── frontend
188+
│   ├── src
189+
│   │   ├── components
190+
│   │   │   ├── account
191+
│   │   │   ├── products
192+
│   │   │   ├── orders
193+
│   │   │   └── common
194+
│   │   ├── context
195+
│   │   │   ├── user.context.tsx
196+
│   │   │   ├── products.context.tsx
197+
│   │   │   ├── vendor.context.tsx
198+
│   │   │   └── authorization.context.tsx
199+
│   │   ├── navigation
200+
│   │   │   ├── accountStackNavigator.tsx
201+
│   │   │   ├── productStackNavigator.tsx
202+
│   │   │   ├── orderStackNavigator.tsx
203+
│   │   │   └── coreNavigator.tsx
204+
│   │   ├── screens
205+
│   │   │   ├── account
206+
│   │   │   ├── products
207+
│   │   │   ├── orders
208+
│   │   │   └── vendor
209+
│   │   ├── hooks
210+
│   │   ├── assets
211+
│   │   ├── services
212+
│   │   ├── utils
213+
│   │   ├── constants
214+
│   │   ├── types.ts
215+
│   │   └──core.tsx
216+
│   ├── native
217+
│   │   └── AppLoader.tsx
218+
│   ├── web-build
219+
│   ├── assets
220+
│   ├── babel.config.js
221+
│   ├── globals.d.ts
222+
│   ├── app.json
223+
│   ├── tsconfig.json
224+
│   ├── types.tsx
225+
│   ├── App.tsx
226+
│   ├── README.md
227+
│   ├── package.json
228+
│   └── yarn.lock
229+
├── .gitignore
230+
├── LICENSE
231+
├── CONTRIBUTING.md
232+
├── CODE_OF_CONDUCT.md
233+
├── SECURITY.md
234+
├── README.md
235+
├── configureBackend.js
236+
├── configurePath.js
237+
├── package.json
238+
└── yarn.lock
239+
```
240+
241+
<br>
242+
</details>
243+
<hr>
244+
245+
<p align="right"><a href="#readme-top">back to top</a></p>
246+
11247
[TOC levels=3]: # "## Contents"
12248

13249
## Contents
@@ -22,7 +258,6 @@ An app that allows users to post second-hand goods and connect with vendors inte
22258
- [Programs and Software](#programs-and-software)
23259
- [Testing](#testing)
24260
- [Deployment](#deployment)
25-
- [Cloning This Repository](#cloning-this-repository)
26261
- [Credits](#credits)
27262
- [Acknowledgements](#acknowledgements)
28263
- [License](#license)
@@ -402,23 +637,6 @@ The project can be understood as a social network with <em><b>collections</b></e
402637
### [`cd backend`](https://github.com/israelias/thrifthub/tree/master/backend)
403638
Please visit the [backend](https://github.com/israelias/thrifthub/tree/master/backend) root directory for details on deployment steps.
404639
405-
## Cloning This Repo
406-
- Clone this repo by running
407-
```bash
408-
git clone [email protected]:israelias/thrifthub.git
409-
```
410-
- at the jump, `cd` to the dir:
411-
```bash
412-
cd thrifthub
413-
```
414-
### [`cd frontend`](https://github.com/israelias/thrifthub/tree/master/frontend)
415-
Please visit the [frontend](https://github.com/israelias/thrifthub/tree/master/frontend) root directory for details on required modules via `yarn install` and to start the frontend development server on `localhost:3000`.
416-
### [`cd backend`](https://github.com/israelias/thrifthub/tree/master/backend)
417-
Please visit the [backend](https://github.com/israelias/thrifthub/tree/master/backend) root directory for details on required modules via `requirements.txt` and to start the backend development server on `localhost:8000`.
418-
419-
420-
<p align="right"><a href="#readme-top">back to top</a></p>
421-
422640
## Credits
423641
424642
### Content and Media

0 commit comments

Comments
 (0)