You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+239-21
Original file line number
Diff line number
Diff line change
@@ -1,13 +1,249 @@
1
-
[](https://expo.io/client)
2
1
3
-
[](https://expo.io/client)
<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
+
<ahref="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
+
<aid="readme-top"></a>
13
+
4
14
# ThriftHub
5
15
An Online Marketplace Application
6
16
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.
-**`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.
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.
7
82
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.
9
84
10
85
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.
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`.
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
-
<palign="right"><ahref="#readme-top">back to top</a></p>
0 commit comments