Skip to content

Commit ffc8dc3

Browse files
authored
Merge pull request #41 from LightCreator1007/refactor/setup
Fix #33: Updated docs for .env configuration wrt cloudinary
2 parents 87b8b2a + 48fde6e commit ffc8dc3

File tree

1 file changed

+76
-8
lines changed

1 file changed

+76
-8
lines changed

SETUP.md

Lines changed: 76 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
# 🚀 Exam-Bud Setup Guide
2-
### *Your Ultimate Survival Guide to Getting This Beast Running*
2+
3+
### _Your Ultimate Survival Guide to Getting This Beast Running_
34

45
You're about to set up **Exam-Bud** - the open-source project that's going to revolutionize how we survive exams in enineering college. This isn't just another website; it's your digital lifeline when you're drowning in syllabus three days before finals (we've all been there, don't lie).
56

67
---
78

89
## ⚡ TL;DR - For the Impatient Souls
910

10-
*Thought there would be a lot of steps, hehe?*
11+
_Thought there would be a lot of steps, hehe?_
1112

1213
Just run this and pray to the tech gods:
14+
1315
```bash
1416
docker compose up --build -d
1517
```
@@ -25,11 +27,13 @@ Before we dive into the chaos, let's make sure you have the essentials. Think of
2527
### ✅ Essential Tools
2628

2729
1. **Docker** 🐳
30+
2831
- Download from [Docker's official website](https://www.docker.com/get-started)
2932
- Make sure the Docker daemon is running (you'll see a cute whale icon in your system tray)
3033
- If Docker gives you installation errors, take a deep breath. We've all been there. Check the troubleshooting section below.
3134

3235
2. **Node.js** 🟢
36+
3337
- Get it from [nodejs.org](https://nodejs.org/)
3438
- We're not picky about versions, but don't use something from 2015 please
3539

@@ -38,6 +42,7 @@ Before we dive into the chaos, let's make sure you have the essentials. Think of
3842
- Yes, it's that simple
3943

4044
### 🧠 Mental Preparation
45+
4146
- Accept that something will probably go wrong
4247
- Have your favorite debugging playlist ready
4348
- Keep some coffee/chai nearby
@@ -48,31 +53,88 @@ Before we dive into the chaos, let's make sure you have the essentials. Think of
4853
## 🎬 The Main Event: Setup Steps
4954

5055
### Step 1: Enter the Project Directory
56+
5157
```bash
5258
cd <project-name>
5359
```
54-
*Replace `<project-name>` with `Exam-bud`.*
60+
61+
_Replace `<project-name>` with `Exam-bud`._
5562

5663
### Step 2: Backend Magic ✨
5764

5865
Navigate to the backend and install dependencies:
66+
5967
```bash
6068
cd backend
6169
npm install
6270
```
6371

6472
**Pro Tip:** While npm install is running, this is the perfect time to:
73+
6574
- Question why you chose engineering
6675
- Pray that no dependency conflicts arise
6776

6877
**IMPORTANT:** Rename `.env.sample` to `.env`:
69-
- **Windows:** Right-click → Rename → Remove ".sample"
70-
- **Mac/Linux:** `mv .env.sample .env`
71-
- **Why?** Because this file contains all the secret sauce (database configs, API keys, etc.)
78+
79+
- Just rename the file from `.env.sample` to `.env`
80+
- Or if you are a terminal guy and do not wish to dabble in the methods of mere mortals,here are your commands:
81+
82+
1.**Windows(Powershell)**:
83+
84+
```powershell
85+
Rename-Item .env.sample .env
86+
```
87+
88+
2.**Mac/Linux(bash/zsh)**:
89+
90+
```bash
91+
mv .env.sample .env
92+
```
93+
94+
- **Why?** Because this file contains all the secret sauce (database configs, API keys, etc.). Samples of .env are meant to act as a guide to how you setup your environment variables and keys, since actually sharing details of such things might compromise sensitive informtion, it is rather a common practice to share a .env.sample for the aforementioned reasons.
95+
96+
#### Cloudinary credentials setup:
97+
98+
You might see the following in your newly renamed .env file
99+
100+
```
101+
#DATABASE_URL="postgresql://johndoe:randompassword@localhost:5432/mydb?schema=public"
102+
103+
DATABASE_URL="postgresql://prisma:prisma@db:5432/exam_bud?schema=public"
104+
PORT=4000
105+
106+
CLOUDINARY_URL=cloudinary://<your_api_key>:<your_api_secret>@<product_environment_name>
107+
CLOUDINARY_PUBLIC_ID=<product_environment_name>
108+
```
109+
110+
wth placeholders such as
111+
112+
- <your_api_secret>
113+
- <your_api_secret>
114+
- <product_environment_name>.
115+
116+
#### 🔑 Where to find them
117+
118+
All of these can be found once you login to cloudinary.
119+
120+
- Login to your dashboard.
121+
122+
- You will see `Cloud Name` and a **Go to API Keys**,copy the Cloud name and place it in <product_environment_name>.
123+
124+
- Click on the **Go to API Keys** button.
125+
126+
![Cloudinary Dash](https://github.com/user-attachments/assets/e9e8d168-7e32-42e6-8222-64a405ab5029)
127+
128+
- The link opens a new page with your API keys and secret, now copy the `API Key` and paste it in <your_api_key>, then copy the `API Secret` and paste in place of <your_api_secret>.
129+
130+
![Cloudinary Creds](https://github.com/user-attachments/assets/01f8dcdd-0521-4f28-8c18-eb400d9345ad)
131+
132+
That's it with the .env configuration.
72133

73134
### Step 3: Frontend Wizardry 🎨
74135

75136
Exit backend and enter frontend:
137+
76138
```bash
77139
cd .. # Escape from backend
78140
cd frontend # Enter the realm of JavaScript chaos
@@ -92,6 +154,7 @@ docker compose up --build -d
92154
```
93155

94156
**What does this do?**
157+
95158
- `docker compose up`: Starts all the containers
96159
- `--build`: Rebuilds images if needed (covers your back if you made changes)
97160
- `-d`: Runs in detached mode (so you can use your terminal for other important things like memes)
@@ -105,6 +168,7 @@ If everything worked, you should see something like this in your terminal:
105168
![Success Screenshot](https://github.com/user-attachments/assets/bc617a55-7945-421f-bb26-8c21b2295e63)
106169

107170
**The Moment of Truth:**
171+
108172
1. Open your favorite browser (we don't judge, even if it's Internet Explorer... okay, we judge a little)
109173
2. Navigate to `localhost:3001`
110174
3. Take a deep breath, close your eyes, and hit Enter
@@ -117,21 +181,25 @@ If everything worked, you should see something like this in your terminal:
117181
### Common Issues & Solutions
118182

119183
#### "Docker not found" or "Docker daemon not running"
184+
120185
- **Windows:** Check if Docker Desktop is actually running (not just installed)
121186
- **Mac:** Same as Windows, look for the whale icon
122187
- **Linux:** `sudo systemctl start docker`
123188

124189
#### "npm install" taking forever
190+
125191
- This is normal. npm has a special relationship with time and space.
126192
- If it's been more than 10 minutes, try `npm cache clean --force` and retry
127193
- If it's still stuck, check your internet connection or blame your ISP
128194

129195
#### "Permission denied" errors
196+
130197
- **Linux/Mac:** You might need `sudo` for some operations
131198
- **Windows:** Run terminal as Administrator
132199
- If all else fails, Google the exact error message (we've all been there)
133200

134201
#### "Port 3001 already in use"
202+
135203
- Something else is using that port
136204
- Kill whatever's using it: `lsof -ti:3001 | xargs kill -9` (Mac/Linux)
137205
- Or just use a different port by modifying the docker-compose file
@@ -156,8 +224,8 @@ Now go forth, set up this project, and may your builds be fast and your bugs be
156224

157225
**Pro Life Tip:** Bookmark this guide. You'll probably need it again when you inevitably forget how you set this up the first time. We've all been there, and we're all lying if we say we haven't.
158226

159-
*Happy coding, and may your notes always be complete!* 📚✨
227+
_Happy coding, and may your notes always be complete!_ 📚✨
160228

161229
---
162230

163-
*Made with ❤️, ☕, and a healthy dose of procrastination by the Exam-Bud team*
231+
_Made with ❤️, ☕, and a healthy dose of procrastination by the Exam-Bud team_

0 commit comments

Comments
 (0)